Function: internal--before-with-selected-window

internal--before-with-selected-window is a byte-compiled function defined in subr.el.gz.

Signature

(internal--before-with-selected-window WINDOW)

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun internal--before-with-selected-window (window)
  (let ((other-frame (window-frame window)))
    (list window (selected-window)
          ;; Selecting a window on another frame also changes that
          ;; frame's frame-selected-window.  We must save&restore it.
          (unless (eq (selected-frame) other-frame)
            (frame-selected-window other-frame))
          ;; Also remember the top-frame if on ttys.
          (unless (eq (selected-frame) other-frame)
            (tty-top-frame other-frame)))))