diff options
| author | Martin Rudalics | 2014-12-30 10:56:43 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-12-30 10:56:43 +0100 |
| commit | 01827de4518c8da974821da0439f2ad4984d49da (patch) | |
| tree | 2dfebc60105cba258340bfd0b2ec5e4a8de0a093 | |
| parent | ec98420dbc5babb783b784ca3eb31667fb376739 (diff) | |
| download | emacs-01827de4518c8da974821da0439f2ad4984d49da.tar.gz emacs-01827de4518c8da974821da0439f2ad4984d49da.zip | |
Update documentation of Temporary Displays.
* display.texi (Temporary Displays): Amend description of
`with-temp-buffer-window'. Add descriptions for
`with-current-buffer-window', `with-displayed-buffer-window' and
`temp-buffer-resize-mode', `temp-buffer-max-height' and
`temp-buffer-max-width'.
* frame.c (frame_inhibit_implied_resize): Escape left paren in
doc-string.
| -rw-r--r-- | doc/lispref/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 64 | ||||
| -rw-r--r-- | src/frame.c | 2 |
3 files changed, 63 insertions, 11 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ad9af13488e..c9f576af5e6 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-12-30 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * display.texi (Temporary Displays): Amend description of | ||
| 4 | `with-temp-buffer-window'. Add descriptions for | ||
| 5 | `with-current-buffer-window', `with-displayed-buffer-window' and | ||
| 6 | `temp-buffer-resize-mode', `temp-buffer-max-height' and | ||
| 7 | `temp-buffer-max-width'. | ||
| 8 | |||
| 1 | 2014-12-27 Glenn Morris <rgm@gnu.org> | 9 | 2014-12-27 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * control.texi (Pattern matching case statement): | 11 | * control.texi (Pattern matching case statement): |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e26d6491850..14a98f32ffb 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -1194,12 +1194,6 @@ it prints into the buffer named @var{buffer-or-name} and displays that | |||
| 1194 | buffer in some window. Unlike @code{with-output-to-temp-buffer}, | 1194 | buffer in some window. Unlike @code{with-output-to-temp-buffer}, |
| 1195 | however, it does not automatically switch that buffer to Help mode. | 1195 | however, it does not automatically switch that buffer to Help mode. |
| 1196 | 1196 | ||
| 1197 | Like @code{with-output-to-temp-buffer} it neither makes the buffer | ||
| 1198 | specified by @var{buffer-or-name} current when executing @var{body}. | ||
| 1199 | @findex with-current-buffer-window | ||
| 1200 | The otherwise identical macro @code{with-current-buffer-window} can be | ||
| 1201 | used to execute @var{body} with that buffer current. | ||
| 1202 | |||
| 1203 | The argument @var{buffer-or-name} specifies the temporary buffer. It | 1197 | The argument @var{buffer-or-name} specifies the temporary buffer. It |
| 1204 | can be either a buffer, which must already exist, or a string, in which | 1198 | can be either a buffer, which must already exist, or a string, in which |
| 1205 | case a buffer of that name is created, if necessary. The buffer is | 1199 | case a buffer of that name is created, if necessary. The buffer is |
| @@ -1207,14 +1201,14 @@ marked as unmodified and read-only when @code{with-temp-buffer-window} | |||
| 1207 | exits. | 1201 | exits. |
| 1208 | 1202 | ||
| 1209 | This macro does not call @code{temp-buffer-show-function}. Rather, it | 1203 | This macro does not call @code{temp-buffer-show-function}. Rather, it |
| 1210 | passes the @var{action} argument to @code{display-buffer} in order to | 1204 | passes the @var{action} argument to @code{display-buffer} |
| 1211 | display the buffer. | 1205 | (@pxref{Choosing Window}) in order to display the buffer. |
| 1212 | 1206 | ||
| 1213 | The value of the last form in @var{body} is returned, unless the | 1207 | The value of the last form in @var{body} is returned, unless the |
| 1214 | argument @var{quit-function} is specified. In that case, it is called | 1208 | argument @var{quit-function} is specified. In that case, it is called |
| 1215 | with two arguments: the window showing the buffer and the result of | 1209 | with two arguments: the window showing the buffer and the result of |
| 1216 | @var{body}. The final return value is then whatever | 1210 | @var{body}. The final return value is then whatever @var{quit-function} |
| 1217 | @var{quit-function} returns. | 1211 | returns. |
| 1218 | 1212 | ||
| 1219 | @vindex temp-buffer-window-setup-hook | 1213 | @vindex temp-buffer-window-setup-hook |
| 1220 | @vindex temp-buffer-window-show-hook | 1214 | @vindex temp-buffer-window-show-hook |
| @@ -1223,6 +1217,56 @@ and @code{temp-buffer-window-show-hook} in place of the analogous hooks | |||
| 1223 | run by @code{with-output-to-temp-buffer}. | 1217 | run by @code{with-output-to-temp-buffer}. |
| 1224 | @end defmac | 1218 | @end defmac |
| 1225 | 1219 | ||
| 1220 | The two constructs described next are mostly identical to | ||
| 1221 | @code{with-temp-buffer-window} but differ from it as specified: | ||
| 1222 | |||
| 1223 | @defmac with-current-buffer-window buffer-or-name action quit-function &rest body | ||
| 1224 | This macro is like @code{with-temp-buffer-window} but unlike that makes | ||
| 1225 | the buffer specified by @var{buffer-or-name} current for running | ||
| 1226 | @var{body}. | ||
| 1227 | @end defmac | ||
| 1228 | |||
| 1229 | @defmac with-displayed-buffer-window buffer-or-name action quit-function &rest body | ||
| 1230 | This macro is like @code{with-current-buffer-window} but unlike that | ||
| 1231 | displays the buffer specified by @var{buffer-or-name} @emph{before} | ||
| 1232 | running @var{body}. | ||
| 1233 | @end defmac | ||
| 1234 | |||
| 1235 | A window showing a temporary buffer can be fit to the size of that | ||
| 1236 | buffer using the following mode: | ||
| 1237 | |||
| 1238 | @defopt temp-buffer-resize-mode | ||
| 1239 | When this minor mode is enabled, windows showing a temporary buffer are | ||
| 1240 | automatically resized to fit their buffer's contents. | ||
| 1241 | |||
| 1242 | A window is resized if and only if it has been specially created for the | ||
| 1243 | buffer. In particular, windows that have shown another buffer before | ||
| 1244 | are not resized. By default, this mode uses @code{fit-window-to-buffer} | ||
| 1245 | (@pxref{Resizing Windows}) for resizing. You can specify a different | ||
| 1246 | function by customizing the options @code{temp-buffer-max-height} and | ||
| 1247 | @code{temp-buffer-max-width} below. | ||
| 1248 | @end defopt | ||
| 1249 | |||
| 1250 | @defopt temp-buffer-max-height | ||
| 1251 | This option specifies the maximum height (in lines) of a window | ||
| 1252 | displaying a temporary buffer when @code{temp-buffer-resize-mode} is | ||
| 1253 | enabled. It can also be a function to be called to choose the height | ||
| 1254 | for such a buffer. It gets one argument, the buffer, and should return | ||
| 1255 | a positive integer. At the time the function is called, the window to | ||
| 1256 | be resized is selected. | ||
| 1257 | @end defopt | ||
| 1258 | |||
| 1259 | @defopt temp-buffer-max-width | ||
| 1260 | This option specifies the maximum width of a window (in columns) | ||
| 1261 | displaying a temporary buffer when @code{temp-buffer-resize-mode} is | ||
| 1262 | enabled. It can also be a function to be called to choose the width for | ||
| 1263 | such a buffer. It gets one argument, the buffer, and should return a | ||
| 1264 | positive integer. At the time the function is called, the window to be | ||
| 1265 | resized is selected. | ||
| 1266 | @end defopt | ||
| 1267 | |||
| 1268 | The following function uses the current buffer for temporal display: | ||
| 1269 | |||
| 1226 | @defun momentary-string-display string position &optional char message | 1270 | @defun momentary-string-display string position &optional char message |
| 1227 | This function momentarily displays @var{string} in the current buffer at | 1271 | This function momentarily displays @var{string} in the current buffer at |
| 1228 | @var{position}. It has no effect on the undo list or on the buffer's | 1272 | @var{position}. It has no effect on the undo list or on the buffer's |
diff --git a/src/frame.c b/src/frame.c index 2ad1c1b52b7..82a85bc48e6 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -5057,7 +5057,7 @@ keep it unchanged if this option is either `t' or a list containing | |||
| 5057 | `vertical-scroll-bars'. | 5057 | `vertical-scroll-bars'. |
| 5058 | 5058 | ||
| 5059 | The default value is '(tool-bar-lines) on Lucid, Motif and Windows | 5059 | The default value is '(tool-bar-lines) on Lucid, Motif and Windows |
| 5060 | (which means that adding/removing a tool bar does not change the frame | 5060 | \(which means that adding/removing a tool bar does not change the frame |
| 5061 | height), nil on all other window systems including GTK+ (which means | 5061 | height), nil on all other window systems including GTK+ (which means |
| 5062 | that changing any of the parameters listed above may change the size of | 5062 | that changing any of the parameters listed above may change the size of |
| 5063 | the frame), and `t' otherwise (which means the frame size never changes | 5063 | the frame), and `t' otherwise (which means the frame size never changes |