diff options
| author | Glenn Morris | 2012-11-16 21:29:58 -0500 |
|---|---|---|
| committer | Glenn Morris | 2012-11-16 21:29:58 -0500 |
| commit | 7fe37cfcce719480da3bafd2e7f1346c2f44b22e (patch) | |
| tree | 5404bce4dcd94792cd883d63d513b8d603ccbd32 | |
| parent | 95f0501e74d997dab47ae043e78c9d147d0c7e89 (diff) | |
| download | emacs-7fe37cfcce719480da3bafd2e7f1346c2f44b22e.tar.gz emacs-7fe37cfcce719480da3bafd2e7f1346c2f44b22e.zip | |
* display.texi (Temporary Displays): Document with-temp-buffer-window.
* etc/NEWS: Related edit.
| -rw-r--r-- | doc/lispref/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 34 | ||||
| -rw-r--r-- | etc/NEWS | 4 |
3 files changed, 38 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b7baac9c2fe..6726c6d2ad0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-11-17 Glenn Morris <rgm@gnu.org> | 1 | 2012-11-17 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * display.texi (Temporary Displays): Document with-temp-buffer-window. | ||
| 4 | |||
| 3 | * frames.texi (Size and Position): Add fit-frame-to-buffer command. | 5 | * frames.texi (Size and Position): Add fit-frame-to-buffer command. |
| 4 | * windows.texi (Resizing Windows): Add fit-frame-to-buffer option. | 6 | * windows.texi (Resizing Windows): Add fit-frame-to-buffer option. |
| 5 | (Window Sizes): Add vindex for window-min-height, window-min-width. | 7 | (Window Sizes): Add vindex for window-min-height, window-min-width. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9fedd162da6..475a9550f99 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -1078,7 +1078,8 @@ editing. Many help commands use this feature. | |||
| 1078 | This function executes @var{forms} while arranging to insert any output | 1078 | This function executes @var{forms} while arranging to insert any output |
| 1079 | they print into the buffer named @var{buffer-name}, which is first | 1079 | they print into the buffer named @var{buffer-name}, which is first |
| 1080 | created if necessary, and put into Help mode. Finally, the buffer is | 1080 | created if necessary, and put into Help mode. Finally, the buffer is |
| 1081 | displayed in some window, but not selected. | 1081 | displayed in some window, but not selected. (See the similar |
| 1082 | form @code{with-temp-buffer-window} below.) | ||
| 1082 | 1083 | ||
| 1083 | If the @var{forms} do not change the major mode in the output buffer, | 1084 | If the @var{forms} do not change the major mode in the output buffer, |
| 1084 | so that it is still Help mode at the end of their execution, then | 1085 | so that it is still Help mode at the end of their execution, then |
| @@ -1152,6 +1153,37 @@ displaying the temporary buffer. When the hook runs, the temporary buffer | |||
| 1152 | is current, and the window it was displayed in is selected. | 1153 | is current, and the window it was displayed in is selected. |
| 1153 | @end defvar | 1154 | @end defvar |
| 1154 | 1155 | ||
| 1156 | @defmac with-temp-buffer-window buffer-or-name action quit-function forms@dots{} | ||
| 1157 | This macro is similar to @code{with-output-to-temp-buffer}. | ||
| 1158 | Like that construct, it executes @var{forms} while arranging to insert | ||
| 1159 | any output they print into the buffer named @var{buffer-or-name}. | ||
| 1160 | Finally, the buffer is displayed in some window, but not selected. | ||
| 1161 | Unlike @code{with-output-to-temp-buffer}, this does not switch to Help | ||
| 1162 | mode. | ||
| 1163 | |||
| 1164 | The argument @var{buffer-or-name} specifies the temporary buffer. | ||
| 1165 | It can be either a buffer, which must already exist, or a string, | ||
| 1166 | in which case a buffer of that name is created if necessary. | ||
| 1167 | The buffer is marked as unmodified and read-only when | ||
| 1168 | @code{with-temp-buffer-window} exits. | ||
| 1169 | |||
| 1170 | This macro does not call @code{temp-buffer-show-function}. Rather, it | ||
| 1171 | passes the @var{action} argument to @code{display-buffer} in order to | ||
| 1172 | display the buffer. | ||
| 1173 | |||
| 1174 | The value of the last form in @var{forms} is returned, unless the | ||
| 1175 | argument @var{quit-function} is specified. In that case, | ||
| 1176 | it is called with two arguments: the window showing the buffer | ||
| 1177 | and the result of @var{forms}. The final return value is then | ||
| 1178 | whatever @var{quit-function} returns. | ||
| 1179 | |||
| 1180 | @vindex temp-buffer-window-setup-hook | ||
| 1181 | @vindex temp-buffer-window-show-hook | ||
| 1182 | This macro uses the normal hooks @code{temp-buffer-window-setup-hook} | ||
| 1183 | and @code{temp-buffer-window-show-hook} in place of the analogous hooks | ||
| 1184 | run by @code{with-output-to-temp-buffer}. | ||
| 1185 | @end defmac | ||
| 1186 | |||
| 1155 | @defun momentary-string-display string position &optional char message | 1187 | @defun momentary-string-display string position &optional char message |
| 1156 | This function momentarily displays @var{string} in the current buffer at | 1188 | This function momentarily displays @var{string} in the current buffer at |
| 1157 | @var{position}. It has no effect on the undo list or on the buffer's | 1189 | @var{position}. It has no effect on the undo list or on the buffer's |
| @@ -846,7 +846,9 @@ now accept a third argument to avoid choosing the selected window. | |||
| 846 | +++ | 846 | +++ |
| 847 | *** Additional values recognized for option `window-combination-limit'. | 847 | *** Additional values recognized for option `window-combination-limit'. |
| 848 | 848 | ||
| 849 | *** New macro `with-temp-buffer-window'. | 849 | +++ |
| 850 | *** New macro `with-temp-buffer-window', similar to | ||
| 851 | `with-output-to-temp-buffer'. | ||
| 850 | 852 | ||
| 851 | --- | 853 | --- |
| 852 | *** `temp-buffer-resize-mode' no longer resizes windows that have been | 854 | *** `temp-buffer-resize-mode' no longer resizes windows that have been |