# HG changeset patch # User Andreas Schwab # Date 1012750527 0 # Node ID 5b046c8a20a6b6960a86474eea8665b4cf7477c6 # Parent 958188ec5dc684b7fedeaae3ab93203ab83a8788 (save-selected-window): Move macro before first use. diff -r 958188ec5dc6 -r 5b046c8a20a6 lisp/window.el --- 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.