Function: get-mru-frame

get-mru-frame is a byte-compiled function defined in frame.el.gz.

Signature

(get-mru-frame &optional ALL-FRAMES EXCLUDE-CHILD-FRAMES EXCLUDE-FRAME)

Documentation

Return the most recently used frame among frames specified by ALL-FRAMES.

Compute the result using frame-use-time, which see. Tooltip, and minibuffer only frames are never candidates. If optional argument EXCLUDE-CHILD-FRAMES is non-nil, eliminate child frames as candidates. If EXCLUDE-FRAME is non-nil, it is a frame to exclude, for example, the selected frame.

The following non-nil values of the optional argument ALL-FRAMES have special meanings:

- visible means consider all visible frames on the current terminal
  or EXCLUDE-FRAME's terminal if EXCLUDE-FRAME is non-nil.

- 0 (the number zero) means consider all visible and iconified frames on
  the current terminal or EXCLUDE-FRAME's terminal if EXCLUDE-FRAME is
  non-nil.

Any other value means consider all frames.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun get-mru-frame (&optional all-frames exclude-child-frames exclude-frame)
  "Return the most recently used frame among frames specified by ALL-FRAMES.
Compute the result using `frame-use-time', which see.  Tooltip, and
minibuffer only frames are never candidates.  If optional argument
EXCLUDE-CHILD-FRAMES is non-nil, eliminate child frames as candidates.
If EXCLUDE-FRAME is non-nil, it is a frame to exclude, for example, the
selected frame.

The following non-nil values of the optional argument ALL-FRAMES
have special meanings:

- `visible' means consider all visible frames on the current terminal
  or EXCLUDE-FRAME's terminal if EXCLUDE-FRAME is non-nil.

- 0 (the number zero) means consider all visible and iconified frames on
  the current terminal or EXCLUDE-FRAME's terminal if EXCLUDE-FRAME is
  non-nil.

Any other value means consider all frames."
  (car (get-mru-frames all-frames exclude-child-frames exclude-frame)))