Mercurial > emacs
changeset 12184:629806145d36
(save-selected-window): New macro.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 11 Jun 1995 19:27:57 +0000 |
parents | 47685fb0fbd1 |
children | 7a18efea682a |
files | lisp/window.el |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/window.el Sat Jun 10 21:45:43 1995 +0000 +++ b/lisp/window.el Sun Jun 11 19:27:57 1995 +0000 @@ -76,6 +76,14 @@ (defun minibuffer-window-active-p (window) "Return t if WINDOW (a minibuffer window) is now active." (eq window (active-minibuffer-window))) + +(defmacro save-selected-window (&rest body) + "Execute BODY, then select the window that was selected before BODY." + (list 'let + '((save-selected-window-window (selected-window))) + (list 'unwind-protect + (cons 'progn body) + (list 'select-window 'save-selected-window-window)))) (defun count-windows (&optional minibuf) "Returns the number of visible windows.