aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2014-12-30 10:56:43 +0100
committerMartin Rudalics2014-12-30 10:56:43 +0100
commit01827de4518c8da974821da0439f2ad4984d49da (patch)
tree2dfebc60105cba258340bfd0b2ec5e4a8de0a093
parentec98420dbc5babb783b784ca3eb31667fb376739 (diff)
downloademacs-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/ChangeLog8
-rw-r--r--doc/lispref/display.texi64
-rw-r--r--src/frame.c2
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 @@
12014-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
12014-12-27 Glenn Morris <rgm@gnu.org> 92014-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
1194buffer in some window. Unlike @code{with-output-to-temp-buffer}, 1194buffer in some window. Unlike @code{with-output-to-temp-buffer},
1195however, it does not automatically switch that buffer to Help mode. 1195however, it does not automatically switch that buffer to Help mode.
1196 1196
1197Like @code{with-output-to-temp-buffer} it neither makes the buffer
1198specified by @var{buffer-or-name} current when executing @var{body}.
1199@findex with-current-buffer-window
1200The otherwise identical macro @code{with-current-buffer-window} can be
1201used to execute @var{body} with that buffer current.
1202
1203The argument @var{buffer-or-name} specifies the temporary buffer. It 1197The argument @var{buffer-or-name} specifies the temporary buffer. It
1204can be either a buffer, which must already exist, or a string, in which 1198can be either a buffer, which must already exist, or a string, in which
1205case a buffer of that name is created, if necessary. The buffer is 1199case 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}
1207exits. 1201exits.
1208 1202
1209This macro does not call @code{temp-buffer-show-function}. Rather, it 1203This macro does not call @code{temp-buffer-show-function}. Rather, it
1210passes the @var{action} argument to @code{display-buffer} in order to 1204passes the @var{action} argument to @code{display-buffer}
1211display the buffer. 1205(@pxref{Choosing Window}) in order to display the buffer.
1212 1206
1213The value of the last form in @var{body} is returned, unless the 1207The value of the last form in @var{body} is returned, unless the
1214argument @var{quit-function} is specified. In that case, it is called 1208argument @var{quit-function} is specified. In that case, it is called
1215with two arguments: the window showing the buffer and the result of 1209with 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. 1211returns.
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
1223run by @code{with-output-to-temp-buffer}. 1217run by @code{with-output-to-temp-buffer}.
1224@end defmac 1218@end defmac
1225 1219
1220The 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
1224This macro is like @code{with-temp-buffer-window} but unlike that makes
1225the 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
1230This macro is like @code{with-current-buffer-window} but unlike that
1231displays the buffer specified by @var{buffer-or-name} @emph{before}
1232running @var{body}.
1233@end defmac
1234
1235A window showing a temporary buffer can be fit to the size of that
1236buffer using the following mode:
1237
1238@defopt temp-buffer-resize-mode
1239When this minor mode is enabled, windows showing a temporary buffer are
1240automatically resized to fit their buffer's contents.
1241
1242A window is resized if and only if it has been specially created for the
1243buffer. In particular, windows that have shown another buffer before
1244are not resized. By default, this mode uses @code{fit-window-to-buffer}
1245(@pxref{Resizing Windows}) for resizing. You can specify a different
1246function 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
1251This option specifies the maximum height (in lines) of a window
1252displaying a temporary buffer when @code{temp-buffer-resize-mode} is
1253enabled. It can also be a function to be called to choose the height
1254for such a buffer. It gets one argument, the buffer, and should return
1255a positive integer. At the time the function is called, the window to
1256be resized is selected.
1257@end defopt
1258
1259@defopt temp-buffer-max-width
1260This option specifies the maximum width of a window (in columns)
1261displaying a temporary buffer when @code{temp-buffer-resize-mode} is
1262enabled. It can also be a function to be called to choose the width for
1263such a buffer. It gets one argument, the buffer, and should return a
1264positive integer. At the time the function is called, the window to be
1265resized is selected.
1266@end defopt
1267
1268The 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
1227This function momentarily displays @var{string} in the current buffer at 1271This 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
5059The default value is '(tool-bar-lines) on Lucid, Motif and Windows 5059The 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
5061height), nil on all other window systems including GTK+ (which means 5061height), nil on all other window systems including GTK+ (which means
5062that changing any of the parameters listed above may change the size of 5062that changing any of the parameters listed above may change the size of
5063the frame), and `t' otherwise (which means the frame size never changes 5063the frame), and `t' otherwise (which means the frame size never changes