From 2cc775f91d7edf763bf4ad81a777040091d1efc3 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 12 Mar 2012 00:10:07 +0800 Subject: [PATCH] Doc fixes for save-window-excursion. * lisp/subr.el (save-window-excursion): Doc fix. * doc/lispref/windows.texi (Window Configurations): save-window-excursion is now a macro. * doc/lispref/display.texi (Temporary Displays): with-output-to-temp-buffer is now a macro. Fixes: debbugs:9979 --- doc/lispref/ChangeLog | 8 ++++++++ doc/lispref/display.texi | 4 ++-- doc/lispref/windows.texi | 4 ++-- lisp/ChangeLog | 2 ++ lisp/subr.el | 11 +++++------ 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 201128b975..4b4521c432 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2012-03-11 Chong Yidong + + * windows.texi (Window Configurations): save-window-excursion is + now a macro. + + * display.texi (Temporary Displays): with-output-to-temp-buffer is + now a macro. + 2012-03-10 Eli Zaretskii * strings.texi (String Basics): diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 281ddda9ce..c70418be52 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1031,7 +1031,7 @@ You can use a display table to substitute other text for the ellipsis buffer and then present it to the user for perusal rather than for editing. Many help commands use this feature. -@defspec with-output-to-temp-buffer buffer-name forms@dots{} +@defmac with-output-to-temp-buffer buffer-name forms@dots{} This function executes @var{forms} while arranging to insert any output they print into the buffer named @var{buffer-name}, which is first created if necessary, and put into Help mode. Finally, the buffer is @@ -1083,7 +1083,7 @@ The value of the last form in @var{forms} is returned. ---------- Buffer: foo ---------- @end group @end example -@end defspec +@end defmac @defopt temp-buffer-show-function If this variable is non-@code{nil}, @code{with-output-to-temp-buffer} diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 07be7fa907..b541b2419c 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3142,7 +3142,7 @@ as @code{save-window-excursion}: @end example @end defun -@defspec save-window-excursion forms@dots{} +@defmac save-window-excursion forms@dots{} This special form records the window configuration, executes @var{forms} in sequence, then restores the earlier window configuration. The window configuration includes, for each window, the value of point and the @@ -3179,7 +3179,7 @@ For example: ;; @r{The screen is now split again.} @end group @end example -@end defspec +@end defmac @defun window-configuration-p object This function returns @code{t} if @var{object} is a window configuration. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49d6738492..b1afb03340 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-03-11 Chong Yidong + * subr.el (save-window-excursion): Doc fix (Bug#9979). + * dabbrev.el (dabbrev--find-expansion): Update progress reporter when finished (Bug#10963). diff --git a/lisp/subr.el b/lisp/subr.el index 00a030c744..866535ce88 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3026,13 +3026,12 @@ the buffer list." (set-buffer ,old-buffer)))))) (defmacro save-window-excursion (&rest body) - "Execute BODY, preserving window sizes and contents. + "Execute BODY, then restore previous window configuration. Return the value of the last form in BODY. -Restore which buffer appears in which window, where display starts, -and the value of point and mark for each window. -Also restore the choice of selected window. -Also restore which buffer is current. -Does not restore the value of point in current buffer. +Restore which buffer appears in which window, where display +starts, and the value of point and mark for each window, as well +as the choice of selected window, and which buffer is current. +The value of point in the current buffer is not restored. BEWARE: Most uses of this macro introduce bugs. E.g. it should not be used to try and prevent some code from opening -- 2.20.1