Function: undelete-frame-by-id
undelete-frame-by-id is an interactive and byte-compiled function
defined in frame.el.gz.
Signature
(undelete-frame-by-id ID &optional NOERROR)
Documentation
Undelete the frame with the matching ID.
Return the undeleted frame if the ID is that of an undeletable frame,
otherwise, signal an error.
If NOERROR is non-nil, do not signal an error, and return nil.
Also see undelete-frame.
Probably introduced at or before Emacs version 31.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun undelete-frame-by-id (id &optional noerror)
"Undelete the frame with the matching ID.
Return the undeleted frame if the ID is that of an undeletable frame,
otherwise, signal an error.
If NOERROR is non-nil, do not signal an error, and return nil.
Also see `undelete-frame'."
(interactive
(let* ((candidates
(mapcar (lambda (elt)
(number-to-string (nth 3 elt)))
undelete-frame--deleted-frames))
(default (car candidates))
(input (completing-read
(format-prompt "Undelete Frame by ID" default)
candidates nil t)))
(list (string-to-number
(if (zerop (length input)) default input)))))
(if-let* ((index (undelete-frame-id-index id)))
(undelete-frame index)
(unless noerror
(error "There is no frame with identifier `%S'" id))))