Mercurial > emacs
diff lisp/window.el @ 43093:5b046c8a20a6
(save-selected-window): Move macro before first use.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Sun, 03 Feb 2002 15:35:27 +0000 |
parents | 869e78e96e2a |
children | 917bf04536ab |
line wrap: on
line diff
--- a/lisp/window.el Sun Feb 03 13:45:59 2002 +0000 +++ b/lisp/window.el Sun Feb 03 15:35:27 2002 +0000 @@ -29,6 +29,16 @@ ;;; Code: +(defmacro save-selected-window (&rest 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) + (if (window-live-p save-selected-window-window) + (select-window save-selected-window-window))))) + (defun window-body-height (&optional window) "Return number of lines in window WINDOW for actual buffer text. This does not include the mode line (if any) or the header line (if any)." @@ -136,16 +146,6 @@ (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. -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) - (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.