diff options
| author | Martin Rudalics | 2014-03-16 10:26:58 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-03-16 10:26:58 +0100 |
| commit | b92631bf71bb029af7a5b4bcf3acd6b4484a4afa (patch) | |
| tree | 3c9770441c520b285461935751643fcc8aa5e43c /doc | |
| parent | d939cbea79c40740333cf779296d94ee265eceb5 (diff) | |
| download | emacs-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/ChangeLog | 9 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 74 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 17 |
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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-03-15 Dmitry Gutov <dgutov@yandex.ru> | 8 | 2014-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 @@ | |||
| 6 | 2014-03-14 Martin Rudalics <rudalics@gmx.at> | 13 | 2014-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 | |||
| 1094 | buffer and then present it to the user for perusal rather than for | 1094 | buffer and then present it to the user for perusal rather than for |
| 1095 | editing. Many help commands use this feature. | 1095 | editing. 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{} |
| 1098 | This function executes @var{forms} while arranging to insert any output | 1098 | This function executes the forms in @var{body} while arranging to insert |
| 1099 | they print into the buffer named @var{buffer-name}, which is first | 1099 | any output they print into the buffer named @var{buffer-name}, which is |
| 1100 | created if necessary, and put into Help mode. Finally, the buffer is | 1100 | first created if necessary, and put into Help mode. (See the similar |
| 1101 | displayed in some window, but not selected. (See the similar | 1101 | form @code{with-temp-buffer-window} below.) Finally, the buffer is |
| 1102 | form @code{with-temp-buffer-window} below.) | 1102 | displayed in some window, but that window is not selected. |
| 1103 | 1103 | ||
| 1104 | If the @var{forms} do not change the major mode in the output buffer, | 1104 | If the forms in @var{body} do not change the major mode in the output |
| 1105 | so that it is still Help mode at the end of their execution, then | 1105 | buffer, 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 | 1106 | then @code{with-output-to-temp-buffer} makes this buffer read-only at |
| 1107 | end, and also scans it for function and variable names to make them | 1107 | the end, and also scans it for function and variable names to make them |
| 1108 | into clickable cross-references. @xref{Docstring hyperlinks, , Tips | 1108 | into clickable cross-references. @xref{Docstring hyperlinks, , Tips for |
| 1109 | for Documentation Strings}, in particular the item on hyperlinks in | 1109 | Documentation Strings}, in particular the item on hyperlinks in |
| 1110 | documentation strings, for more details. | 1110 | documentation strings, for more details. |
| 1111 | 1111 | ||
| 1112 | The string @var{buffer-name} specifies the temporary buffer, which | 1112 | The string @var{buffer-name} specifies the temporary buffer, which need |
| 1113 | need not already exist. The argument must be a string, not a buffer. | 1113 | not already exist. The argument must be a string, not a buffer. The |
| 1114 | The buffer is erased initially (with no questions asked), and it is | 1114 | buffer is erased initially (with no questions asked), and it is marked |
| 1115 | marked as unmodified after @code{with-output-to-temp-buffer} exits. | 1115 | as 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 |
| 1118 | temporary buffer, then it evaluates the forms in @var{forms}. Output | 1118 | temporary buffer, then it evaluates the forms in @var{body}. Output |
| 1119 | using the Lisp output functions within @var{forms} goes by default to | 1119 | using the Lisp output functions within @var{body} goes by default to |
| 1120 | that buffer (but screen display and messages in the echo area, although | 1120 | that buffer (but screen display and messages in the echo area, although |
| 1121 | they are ``output'' in the general sense of the word, are not affected). | 1121 | they 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). | |||
| 1124 | Several hooks are available for customizing the behavior | 1124 | Several hooks are available for customizing the behavior |
| 1125 | of this construct; they are listed below. | 1125 | of this construct; they are listed below. |
| 1126 | 1126 | ||
| 1127 | The value of the last form in @var{forms} is returned. | 1127 | The 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 | |||
| 1174 | is current, and the window it was displayed in is selected. | 1174 | is 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{} |
| 1178 | This macro is similar to @code{with-output-to-temp-buffer}. Like that | 1178 | This macro is similar to @code{with-output-to-temp-buffer}. Like that |
| 1179 | construct, it executes @var{forms} while arranging to insert any output | 1179 | construct, it executes @var{body} while arranging to insert any output |
| 1180 | they print into the buffer named @var{buffer-or-name} and displays the | 1180 | it prints into the buffer named @var{buffer-or-name} and displays that |
| 1181 | buffer in some window. Unlike @code{with-output-to-temp-buffer}, | 1181 | buffer in some window. Unlike @code{with-output-to-temp-buffer}, |
| 1182 | however, this makes the buffer current and does not switch to Help mode. | 1182 | however, it does not automatically switch that buffer to Help mode. |
| 1183 | 1183 | ||
| 1184 | The argument @var{buffer-or-name} specifies the temporary buffer. | 1184 | Like @code{with-output-to-temp-buffer} it neither makes the buffer |
| 1185 | It can be either a buffer, which must already exist, or a string, | 1185 | specified by @var{buffer-or-name} current when executing @var{body}. |
| 1186 | in which case a buffer of that name is created if necessary. | 1186 | @findex with-current-buffer-window |
| 1187 | The buffer is marked as unmodified and read-only when | 1187 | The otherwise identical macro @code{with-current-buffer-window} can be |
| 1188 | @code{with-temp-buffer-window} exits. | 1188 | used to execute @var{body} with that buffer current. |
| 1189 | |||
| 1190 | The argument @var{buffer-or-name} specifies the temporary buffer. It | ||
| 1191 | can be either a buffer, which must already exist, or a string, in which | ||
| 1192 | case a buffer of that name is created, if necessary. The buffer is | ||
| 1193 | marked as unmodified and read-only when @code{with-temp-buffer-window} | ||
| 1194 | exits. | ||
| 1189 | 1195 | ||
| 1190 | This macro does not call @code{temp-buffer-show-function}. Rather, it | 1196 | This macro does not call @code{temp-buffer-show-function}. Rather, it |
| 1191 | passes the @var{action} argument to @code{display-buffer} in order to | 1197 | passes the @var{action} argument to @code{display-buffer} in order to |
| 1192 | display the buffer. | 1198 | display the buffer. |
| 1193 | 1199 | ||
| 1194 | The value of the last form in @var{forms} is returned, unless the | 1200 | The value of the last form in @var{body} is returned, unless the |
| 1195 | argument @var{quit-function} is specified. In that case, | 1201 | argument @var{quit-function} is specified. In that case, it is called |
| 1196 | it is called with two arguments: the window showing the buffer | 1202 | with two arguments: the window showing the buffer and the result of |
| 1197 | and the result of @var{forms}. The final return value is then | 1203 | @var{body}. The final return value is then whatever |
| 1198 | whatever @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{} |
| 653 | This macro evaluates the @var{body} forms, inserting any output they | 654 | This macro evaluates @var{body} like @code{with-output-to-temp-buffer} |
| 654 | produce 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}). | 656 | into a buffer named @var{buffer-name}. (Usually, @var{buffer-name} |
| 656 | (Usually, @var{buffer-name} should be the value returned by the | 657 | should be the value returned by the function @code{help-buffer}.) It |
| 657 | function @code{help-buffer}.) It also puts the specified buffer into | 658 | also puts the specified buffer into Help mode and displays a message |
| 658 | Help mode and displays a message telling the user how to quit and | 659 | telling the user how to quit and scroll the help window. It selects the |
| 659 | scroll the help window. | 660 | help window if the current value of the user option |
| 661 | @code{help-window-select} has been set accordingly. It returns the last | ||
| 662 | value 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 |