Function: select-frame-by-name

select-frame-by-name is an interactive and byte-compiled function defined in frame.el.gz.

Signature

(select-frame-by-name NAME)

Documentation

Select the frame whose name is NAME and raise it.

Frames on the current terminal are checked first. Raise the frame and give it input focus. On a text terminal, the frame will occupy the entire terminal screen after the next redisplay. If there is no frame by that name, signal an error.

View in manual

Probably introduced at or before Emacs version 20.3.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun select-frame-by-name (name)
  "Select the frame whose name is NAME and raise it.
Frames on the current terminal are checked first.
Raise the frame and give it input focus.  On a text terminal, the frame
will occupy the entire terminal screen after the next redisplay.
If there is no frame by that name, signal an error."
  (interactive
   (let* ((frame-names-alist (make-frame-names-alist))
	   (default (car (car frame-names-alist)))
	   (input (completing-read
		   (format-prompt "Select Frame" default)
		   frame-names-alist nil t nil 'frame-name-history)))
     (list (if (zerop (length input)) default input))))
  (select-frame-set-input-focus
   ;; Prefer frames on the current display.
   (or (cdr (assoc name (make-frame-names-alist)))
       (catch 'done
         (dolist (frame (frame-list))
           (when (equal (frame-parameter frame 'name) name)
             (throw 'done frame))))
       (error "There is no frame named `%s'" name))))