Function: with-minibuffer-selected-window

with-minibuffer-selected-window is a macro defined in minibuffer.el.gz.

Signature

(with-minibuffer-selected-window &rest BODY)

Documentation

Execute the forms in BODY from the minibuffer in its original window.

When used in a minibuffer window, select the window selected just before the minibuffer was activated, and execute the forms.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defmacro with-minibuffer-selected-window (&rest body)
  "Execute the forms in BODY from the minibuffer in its original window.
When used in a minibuffer window, select the window selected just before
the minibuffer was activated, and execute the forms."
  (declare (indent 0) (debug t))
  `(let ((window (minibuffer-selected-window)))
     (when window
       (with-selected-window window
         ,@body))))