aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2014-03-16 10:26:58 +0100
committerMartin Rudalics2014-03-16 10:26:58 +0100
commitb92631bf71bb029af7a5b4bcf3acd6b4484a4afa (patch)
tree3c9770441c520b285461935751643fcc8aa5e43c /doc
parentd939cbea79c40740333cf779296d94ee265eceb5 (diff)
downloademacs-b92631bf71bb029af7a5b4bcf3acd6b4484a4afa.tar.gz
emacs-b92631bf71bb029af7a5b4bcf3acd6b4484a4afa.zip
Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007).
* window.el (with-temp-buffer-window): Don't make BUFFER-OR-NAME current (Bug#16816, Bug#17007). (with-current-buffer-window): New macro doing the same as `with-temp-buffer-window' but with BUFFER-OR-NAME current. * help.el (help-print-return-message): Warn in doc-string to not use this in `with-help-window'. (describe-bindings-internal): Call `describe-buffer-bindings' from within help buffer. See Juanma's scenario in (Bug#16816). (with-help-window): Update doc-string. * dired.el (dired-mark-pop-up): * files.el (save-buffers-kill-emacs): * register.el (register-preview): Use `with-current-buffer-window' instead of `with-temp-buffer-window'. * display.texi (Temporary Displays): Rewrite descriptions of `with-output-to-temp-buffer' and `with-temp-buffer-window'. * help.texi (Help Functions): Rewrite description of `with-help-window'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog9
-rw-r--r--doc/lispref/display.texi74
-rw-r--r--doc/lispref/help.texi17
3 files changed, 58 insertions, 42 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 13b96b4ba5e..6e89c0d489b 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12014-03-16 Martin Rudalics <rudalics@gmx.at>
2
3 * display.texi (Temporary Displays): Rewrite descriptions of
4 `with-output-to-temp-buffer' and `with-temp-buffer-window'.
5 * help.texi (Help Functions): Rewrite description of
6 `with-help-window'.
7
12014-03-15 Dmitry Gutov <dgutov@yandex.ru> 82014-03-15 Dmitry Gutov <dgutov@yandex.ru>
2 9
3 * display.texi (Blinking): Update WRT to the new 10 * display.texi (Blinking): Update WRT to the new
@@ -6,7 +13,7 @@
62014-03-14 Martin Rudalics <rudalics@gmx.at> 132014-03-14 Martin Rudalics <rudalics@gmx.at>
7 14
8 * display.texi (Temporary Displays): Say that 15 * display.texi (Temporary Displays): Say that
9 with-temp-buffer-window makes its buffer current. 16 `with-temp-buffer-window' makes its buffer current.
10 * frames.texi (Size and Position): Describe new option 17 * frames.texi (Size and Position): Describe new option
11 `frame-resize-pixelwise'. Rewrite descriptions of 18 `frame-resize-pixelwise'. Rewrite descriptions of
12 `set-frame-size', `set-frame-height' and `set-frame-width'. 19 `set-frame-size', `set-frame-height' and `set-frame-width'.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 27f002fe5fe..8bd657b5a9b 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1094,29 +1094,29 @@ You can use a display table to substitute other text for the ellipsis
1094buffer and then present it to the user for perusal rather than for 1094buffer and then present it to the user for perusal rather than for
1095editing. Many help commands use this feature. 1095editing. Many help commands use this feature.
1096 1096
1097@defmac with-output-to-temp-buffer buffer-name forms@dots{} 1097@defmac with-output-to-temp-buffer buffer-name body@dots{}
1098This function executes @var{forms} while arranging to insert any output 1098This function executes the forms in @var{body} while arranging to insert
1099they print into the buffer named @var{buffer-name}, which is first 1099any output they print into the buffer named @var{buffer-name}, which is
1100created if necessary, and put into Help mode. Finally, the buffer is 1100first created if necessary, and put into Help mode. (See the similar
1101displayed in some window, but not selected. (See the similar 1101form @code{with-temp-buffer-window} below.) Finally, the buffer is
1102form @code{with-temp-buffer-window} below.) 1102displayed in some window, but that window is not selected.
1103 1103
1104If the @var{forms} do not change the major mode in the output buffer, 1104If the forms in @var{body} do not change the major mode in the output
1105so that it is still Help mode at the end of their execution, then 1105buffer, so that it is still Help mode at the end of their execution,
1106@code{with-output-to-temp-buffer} makes this buffer read-only at the 1106then @code{with-output-to-temp-buffer} makes this buffer read-only at
1107end, and also scans it for function and variable names to make them 1107the end, and also scans it for function and variable names to make them
1108into clickable cross-references. @xref{Docstring hyperlinks, , Tips 1108into clickable cross-references. @xref{Docstring hyperlinks, , Tips for
1109for Documentation Strings}, in particular the item on hyperlinks in 1109Documentation Strings}, in particular the item on hyperlinks in
1110documentation strings, for more details. 1110documentation strings, for more details.
1111 1111
1112The string @var{buffer-name} specifies the temporary buffer, which 1112The string @var{buffer-name} specifies the temporary buffer, which need
1113need not already exist. The argument must be a string, not a buffer. 1113not already exist. The argument must be a string, not a buffer. The
1114The buffer is erased initially (with no questions asked), and it is 1114buffer is erased initially (with no questions asked), and it is marked
1115marked as unmodified after @code{with-output-to-temp-buffer} exits. 1115as unmodified after @code{with-output-to-temp-buffer} exits.
1116 1116
1117@code{with-output-to-temp-buffer} binds @code{standard-output} to the 1117@code{with-output-to-temp-buffer} binds @code{standard-output} to the
1118temporary buffer, then it evaluates the forms in @var{forms}. Output 1118temporary buffer, then it evaluates the forms in @var{body}. Output
1119using the Lisp output functions within @var{forms} goes by default to 1119using the Lisp output functions within @var{body} goes by default to
1120that buffer (but screen display and messages in the echo area, although 1120that buffer (but screen display and messages in the echo area, although
1121they are ``output'' in the general sense of the word, are not affected). 1121they are ``output'' in the general sense of the word, are not affected).
1122@xref{Output Functions}. 1122@xref{Output Functions}.
@@ -1124,7 +1124,7 @@ they are ``output'' in the general sense of the word, are not affected).
1124Several hooks are available for customizing the behavior 1124Several hooks are available for customizing the behavior
1125of this construct; they are listed below. 1125of this construct; they are listed below.
1126 1126
1127The value of the last form in @var{forms} is returned. 1127The value of the last form in @var{body} is returned.
1128 1128
1129@example 1129@example
1130@group 1130@group
@@ -1174,28 +1174,34 @@ displaying the temporary buffer. When the hook runs, the temporary buffer
1174is current, and the window it was displayed in is selected. 1174is current, and the window it was displayed in is selected.
1175@end defvar 1175@end defvar
1176 1176
1177@defmac with-temp-buffer-window buffer-or-name action quit-function forms@dots{} 1177@defmac with-temp-buffer-window buffer-or-name action quit-function body@dots{}
1178This macro is similar to @code{with-output-to-temp-buffer}. Like that 1178This macro is similar to @code{with-output-to-temp-buffer}. Like that
1179construct, it executes @var{forms} while arranging to insert any output 1179construct, it executes @var{body} while arranging to insert any output
1180they print into the buffer named @var{buffer-or-name} and displays the 1180it prints into the buffer named @var{buffer-or-name} and displays that
1181buffer in some window. Unlike @code{with-output-to-temp-buffer}, 1181buffer in some window. Unlike @code{with-output-to-temp-buffer},
1182however, this makes the buffer current and does not switch to Help mode. 1182however, it does not automatically switch that buffer to Help mode.
1183 1183
1184The argument @var{buffer-or-name} specifies the temporary buffer. 1184Like @code{with-output-to-temp-buffer} it neither makes the buffer
1185It can be either a buffer, which must already exist, or a string, 1185specified by @var{buffer-or-name} current when executing @var{body}.
1186in which case a buffer of that name is created if necessary. 1186@findex with-current-buffer-window
1187The buffer is marked as unmodified and read-only when 1187The otherwise identical macro @code{with-current-buffer-window} can be
1188@code{with-temp-buffer-window} exits. 1188used to execute @var{body} with that buffer current.
1189
1190The argument @var{buffer-or-name} specifies the temporary buffer. It
1191can be either a buffer, which must already exist, or a string, in which
1192case a buffer of that name is created, if necessary. The buffer is
1193marked as unmodified and read-only when @code{with-temp-buffer-window}
1194exits.
1189 1195
1190This macro does not call @code{temp-buffer-show-function}. Rather, it 1196This macro does not call @code{temp-buffer-show-function}. Rather, it
1191passes the @var{action} argument to @code{display-buffer} in order to 1197passes the @var{action} argument to @code{display-buffer} in order to
1192display the buffer. 1198display the buffer.
1193 1199
1194The value of the last form in @var{forms} is returned, unless the 1200The value of the last form in @var{body} is returned, unless the
1195argument @var{quit-function} is specified. In that case, 1201argument @var{quit-function} is specified. In that case, it is called
1196it is called with two arguments: the window showing the buffer 1202with two arguments: the window showing the buffer and the result of
1197and the result of @var{forms}. The final return value is then 1203@var{body}. The final return value is then whatever
1198whatever @var{quit-function} returns. 1204@var{quit-function} returns.
1199 1205
1200@vindex temp-buffer-window-setup-hook 1206@vindex temp-buffer-window-setup-hook
1201@vindex temp-buffer-window-show-hook 1207@vindex temp-buffer-window-show-hook
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 50103d3a8b3..9a763b60938 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -649,14 +649,17 @@ This function returns the name of the help buffer, which is normally
649@file{*Help*}; if such a buffer does not exist, it is first created. 649@file{*Help*}; if such a buffer does not exist, it is first created.
650@end defun 650@end defun
651 651
652@vindex help-window-select
652@defmac with-help-window buffer-name body@dots{} 653@defmac with-help-window buffer-name body@dots{}
653This macro evaluates the @var{body} forms, inserting any output they 654This macro evaluates @var{body} like @code{with-output-to-temp-buffer}
654produce into a buffer named @var{buffer-name} like 655(@pxref{Temporary Displays}), inserting any output produced by its forms
655@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}). 656into a buffer named @var{buffer-name}. (Usually, @var{buffer-name}
656(Usually, @var{buffer-name} should be the value returned by the 657should be the value returned by the function @code{help-buffer}.) It
657function @code{help-buffer}.) It also puts the specified buffer into 658also puts the specified buffer into Help mode and displays a message
658Help mode and displays a message telling the user how to quit and 659telling the user how to quit and scroll the help window. It selects the
659scroll the help window. 660help window if the current value of the user option
661@code{help-window-select} has been set accordingly. It returns the last
662value in @var{body}.
660@end defmac 663@end defmac
661 664
662@defun help-setup-xref item interactive-p 665@defun help-setup-xref item interactive-p