Mercurial > emacs
comparison lisp/window.el @ 12184:629806145d36
(save-selected-window): New macro.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 11 Jun 1995 19:27:57 +0000 |
parents | a9b5c1d727b7 |
children | 75c6a5e1ee7a |
comparison
equal
deleted
inserted
replaced
12183:47685fb0fbd1 | 12184:629806145d36 |
---|---|
74 (not (eq walk-windows-current walk-windows-start)))))) | 74 (not (eq walk-windows-current walk-windows-start)))))) |
75 | 75 |
76 (defun minibuffer-window-active-p (window) | 76 (defun minibuffer-window-active-p (window) |
77 "Return t if WINDOW (a minibuffer window) is now active." | 77 "Return t if WINDOW (a minibuffer window) is now active." |
78 (eq window (active-minibuffer-window))) | 78 (eq window (active-minibuffer-window))) |
79 | |
80 (defmacro save-selected-window (&rest body) | |
81 "Execute BODY, then select the window that was selected before BODY." | |
82 (list 'let | |
83 '((save-selected-window-window (selected-window))) | |
84 (list 'unwind-protect | |
85 (cons 'progn body) | |
86 (list 'select-window 'save-selected-window-window)))) | |
79 | 87 |
80 (defun count-windows (&optional minibuf) | 88 (defun count-windows (&optional minibuf) |
81 "Returns the number of visible windows. | 89 "Returns the number of visible windows. |
82 Optional arg NO-MINI non-nil means don't count the minibuffer | 90 Optional arg NO-MINI non-nil means don't count the minibuffer |
83 even if it is active." | 91 even if it is active." |