mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
(save-selected-window): No error if saved window is dead.
This commit is contained in:
parent
240cbfca03
commit
f9fa0e8aea
1 changed files with 5 additions and 2 deletions
|
|
@ -127,11 +127,14 @@ Anything else means restrict to the selected frame."
|
|||
(eq window (active-minibuffer-window)))
|
||||
|
||||
(defmacro save-selected-window (&rest body)
|
||||
"Execute BODY, then select the window that was selected before BODY."
|
||||
"Execute BODY, then select the window that was selected before BODY.
|
||||
However, if that window has become dead, don't get an error,
|
||||
just refrain from switching to it."
|
||||
`(let ((save-selected-window-window (selected-window)))
|
||||
(unwind-protect
|
||||
(progn ,@body)
|
||||
(select-window save-selected-window-window))))
|
||||
(if (window-live-p save-selected-window-window)
|
||||
(select-window save-selected-window-window)))))
|
||||
|
||||
(defun count-windows (&optional minibuf)
|
||||
"Return the number of visible windows.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue