aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2008-10-22 13:04:16 +0000
committerMartin Rudalics2008-10-22 13:04:16 +0000
commit52a94b8577ea3d5d3211aca60dae84541e3abffa (patch)
tree6f8a01cb3b7f47db20d41b8ce3ee0a9943c09ba3
parentcb83c00bd13b63c0d0752698e4ad441968bc04ac (diff)
downloademacs-52a94b8577ea3d5d3211aca60dae84541e3abffa.tar.gz
emacs-52a94b8577ea3d5d3211aca60dae84541e3abffa.zip
(Displaying Buffers): Reword documentation of pop-to-buffer.
(Choosing Window): Rewrite documentation of display-buffer and its options.
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/windows.texi177
2 files changed, 111 insertions, 73 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index cb9363638af..ff744560092 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12008-10-22 Martin Rudalics <rudalics@gmx.at>
2
3 * windows.texi (Displaying Buffers): Reword documentation of
4 pop-to-buffer.
5 (Choosing Window): Rewrite documentation of display-buffer and
6 its options.
7
12008-10-21 Eli Zaretskii <eliz@gnu.org> 82008-10-21 Eli Zaretskii <eliz@gnu.org>
2 9
3 * processes.texi (Serial Ports): Fix wording and improve markup. 10 * processes.texi (Serial Ports): Fix wording and improve markup.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 4ca2d754365..8cd8d07db57 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -852,12 +852,13 @@ unless @var{norecord} is non-@code{nil}.
852@end deffn 852@end deffn
853 853
854@defun pop-to-buffer buffer-or-name &optional other-window norecord 854@defun pop-to-buffer buffer-or-name &optional other-window norecord
855This function makes @var{buffer-or-name} the current buffer and 855This function makes @var{buffer-or-name} the current buffer and switches
856switches to it in some window, preferably not the window previously 856to it in some window, preferably not the window previously selected.
857selected. The ``popped-to'' window becomes the selected window within 857The ``popped-to'' window becomes the selected window. Its frame is
858its frame. The return value is the buffer that was switched to. 858given the X server's focus if possible, see @ref{Input Focus}. The
859If @var{buffer-or-name} is @code{nil}, that means to choose some 859return value is the buffer that was switched to. If
860other buffer, but you don't specify which. 860@var{buffer-or-name} is @code{nil}, that means to choose some other
861buffer, but you don't specify which.
861 862
862If the variable @code{pop-up-frames} is non-@code{nil}, 863If the variable @code{pop-up-frames} is non-@code{nil},
863@code{pop-to-buffer} looks for a window in any visible frame already 864@code{pop-to-buffer} looks for a window in any visible frame already
@@ -919,9 +920,9 @@ functions and commands use this subroutine. Here we describe how to use
919@code{display-buffer} and how to customize it. 920@code{display-buffer} and how to customize it.
920 921
921@deffn Command display-buffer buffer-or-name &optional not-this-window frame 922@deffn Command display-buffer buffer-or-name &optional not-this-window frame
922This command makes @var{buffer-or-name} appear in some window, like 923This command makes @var{buffer-or-name} appear in some window, but it
923@code{pop-to-buffer}, but it does not select that window and does not 924does not select that window and does not make the buffer specified by
924make the buffer current. The identity of the selected window is 925@var{buffer-or-name} current. The identity of the selected window is
925unaltered by this function. @var{buffer-or-name} must be a buffer, or 926unaltered by this function. @var{buffer-or-name} must be a buffer, or
926the name of an existing buffer. 927the name of an existing buffer.
927 928
@@ -959,6 +960,27 @@ Precisely how @code{display-buffer} finds or creates a window depends on
959the variables described below. 960the variables described below.
960@end deffn 961@end deffn
961 962
963@defopt display-buffer-reuse-frames
964If this variable is non-@code{nil}, @code{display-buffer} searches
965existing frames for a window displaying @var{buffer-or-name}. If the
966buffer is already displayed in a window in some frame,
967@code{display-buffer} makes the frame visible and raises it, to use that
968window. If the buffer is not already displayed, or
969@code{display-buffer-reuse-frames} is @code{nil}, the behavior of
970@code{display-buffer} is determined by the variables described next.
971@end defopt
972
973@defopt pop-up-windows
974This variable specifies whether @code{display-buffer} is allowed to
975split (@pxref{Splitting Windows}) an existing window . If it is
976non-@code{nil}, @code{display-buffer} tries to the split the largest or
977least recently used window on the selected frame. (If the selected
978frame is a minibuffer-only frame, it tries to split a window on another
979frame instead.) If @code{pop-up-windows} is nil or the variable
980@code{pop-up-frames} (see below) is non-@code{nil},
981@code{display-buffer} does not split any window.
982@end defopt
983
962@defvar split-window-preferred-function 984@defvar split-window-preferred-function
963This variable specifies how to split a window. Its value, if 985This variable specifies how to split a window. Its value, if
964non-@code{nil}, should be a function of one argument, which is a 986non-@code{nil}, should be a function of one argument, which is a
@@ -966,72 +988,68 @@ window. If this variable specifies a function, @code{display-buffer}
966will call it with one or more candidate windows when it looks for a 988will call it with one or more candidate windows when it looks for a
967window to split. If the argument window fits, the function is 989window to split. If the argument window fits, the function is
968expected to split it and return a new window. If the function returns 990expected to split it and return a new window. If the function returns
969@code{nil}, then this window will not be split. 991@code{nil}, the argument window will not be split.
970 992
971If the value of this variable is @code{nil}, @code{display-buffer} 993If the value of this variable is @code{nil}, @code{display-buffer}
972uses the other variables described below to decide whether and which 994uses the two variables described next to decide whether and which
973window to split. 995window to split.
974@end defvar 996@end defvar
975 997
976@defopt display-buffer-reuse-frames
977If this variable is non-@code{nil}, @code{display-buffer} searches
978existing frames for a window displaying the buffer. If the buffer is
979already displayed in a window in some frame, @code{display-buffer} makes
980the frame visible and raises it, to use that window. If the buffer is
981not already displayed, or if @code{display-buffer-reuse-frames} is
982@code{nil}, @code{display-buffer}'s behavior is determined by other
983variables, described below.
984@end defopt
985
986@defopt pop-up-windows
987This variable specifies whether @code{display-buffer} makes new windows.
988If it is non-@code{nil} and there is only one window, then that window
989is split vertically. If it is @code{nil}, then @code{display-buffer}
990does not split the single window, but uses it whole.
991@end defopt
992
993@defopt split-height-threshold 998@defopt split-height-threshold
994This variable specifies when @code{display-buffer} may split a window 999This variable specifies whether @code{display-buffer} may split a window
995vertically, if there are multiple windows. If the value is a number, 1000vertically, provided there are multiple windows. If the value is a
996@code{display-buffer} splits the largest window if it has at least 1001number, @code{display-buffer} splits a window only if it has at least
997this many lines. If the largest window is not this tall, or if the 1002this many lines. If no window is tall enough, or if the value of this
998value of this variable is @code{nil}, @code{display-buffer} tries to 1003variable is @code{nil}, @code{display-buffer} tries to split some window
999split some window horizontally, subject to restrictions of 1004horizontally, subject to restrictions of @code{split-width-threshold}
1000@code{split-width-threshold} (see below). If splitting horizontally 1005(see below). If splitting horizontally is impossible too,
1001is impossible, @code{display-buffer} splits a window vertically 1006@code{display-buffer} splits a window vertically only if it's the only
1002only if it's the only window on its frame and not the minibuffer 1007window on its frame and not the minibuffer window, and only if
1003window, and only if @code{pop-up-windows} is non-@code{nil}. 1008@code{pop-up-windows} is non-@code{nil}.
1004Otherwise, @code{display-buffer} uses one of the existing windows. 1009
1010A window whose height is fixed (@pxref{Resizing Windows}) cannot be
1011split vertically by @code{display-buffer}. Also, @code{display-buffer}
1012splits a window vertically only if it can accommodate two windows that
1013are both at least `window-min-height' lines tall. Moreover, if the
1014window that shall be split has a mode-line, the window must be at least
1015four lines tall in order to make sure that the new window can have a
1016mode-line as well. If the original window doesn't have a mode-line, a
1017height of two lines suffices.
1005@end defopt 1018@end defopt
1006 1019
1007@defopt split-width-threshold 1020@defopt split-width-threshold
1008This variable specifies when @code{display-buffer} may split a window 1021This variable specifies whether @code{display-buffer} may split a window
1009horizontally. If the value is a number, @code{display-buffer} may 1022horizontally. If the value is a number, @code{display-buffer} may split
1010split a window if it has at least this many columns. If the value of 1023a window if it has at least this many columns. If the value of this
1011this variable is @code{nil}, @code{display-buffer} will not split any 1024variable is @code{nil}, @code{display-buffer} will not split any windows
1012windows horizontally. (It still might split some window vertically, 1025horizontally. (It still might split some window vertically, though, see
1013though, see above.) 1026above.)
1027
1028A window whose width is fixed (@pxref{Resizing Windows}) cannot be split
1029horizontally by @code{display-buffer}. Also, @code{display-buffer}
1030splits a window horizontally only if it can accommodate two windows that
1031are both at least `window-min-width' columns wide.
1014@end defopt 1032@end defopt
1015 1033
1016@defopt even-window-heights 1034@defopt even-window-heights
1017This variable specifies whether @code{display-buffer} should even out 1035This variable specifies whether @code{display-buffer} should even out
1018window heights if the buffer gets displayed in an existing window, 1036window heights if the buffer gets displayed in an existing window, above
1019above or beneath another existing window. If 1037or beneath another window. If @code{even-window-heights} is
1020@code{even-window-heights} is @code{t}, the default, window heights 1038non-@code{nil}, the default, window heights will be evened out. If
1021will be evened out. If @code{even-window-heights} is @code{nil}, the 1039either of the involved window has fixed height (@pxref{Resizing
1022original window heights will be left alone. 1040Windows}) or @code{even-window-heights} is @code{nil}, the original
1041window heights will be left alone.
1023@end defopt 1042@end defopt
1024 1043
1025@c Emacs 19 feature 1044@c Emacs 19 feature
1026@defopt pop-up-frames 1045@defopt pop-up-frames
1027This variable specifies whether @code{display-buffer} makes new frames. 1046This variable specifies whether @code{display-buffer} makes new frames.
1028If it is non-@code{nil}, @code{display-buffer} looks for an existing 1047If it is non-@code{nil}, @code{display-buffer} looks for an existing
1029window already displaying the desired buffer, on any visible frame. 1048window already displaying the desired buffer, on any visible frame. If
1030If it finds one, it returns that window. Otherwise it makes a new 1049it finds one, it returns that window. Otherwise it makes a new frame,
1031frame, unless the variable's value is @code{graphic-only} and the 1050unless the variable's value is @code{graphic-only} and the selected
1032selected frame is not on a graphic display. The variables 1051frame is not on a graphic display. Note that the value of
1033@code{pop-up-windows}, @code{split-height-threshold}, and 1052@code{pop-up-windows} does not matter if @code{pop-up-frames} is
1034@code{split-width-threshold} do not matter if @code{pop-up-frames} is
1035non-@code{nil}. 1053non-@code{nil}.
1036 1054
1037If @code{pop-up-frames} is @code{nil}, then @code{display-buffer} either 1055If @code{pop-up-frames} is @code{nil}, then @code{display-buffer} either
@@ -1060,15 +1078,15 @@ more information about frame parameters.
1060 1078
1061@defopt special-display-buffer-names 1079@defopt special-display-buffer-names
1062A list of buffer names for buffers that should be displayed specially. 1080A list of buffer names for buffers that should be displayed specially.
1063If the buffer's name is in this list, @code{display-buffer} handles the 1081If the name of @var{buffer-or-name} is in this list,
1064buffer specially. 1082@code{display-buffer} handles the buffer specially.
1065 1083
1066By default, special display means to give the buffer a dedicated frame. 1084By default, special display means to give the buffer a dedicated frame.
1067 1085
1068If an element is a list, instead of a string, then the @sc{car} of the 1086If an element is a list, instead of a string, then the @sc{car} of that
1069list is the buffer name, and the rest of the list says how to create 1087list is the buffer name, and the rest of that list says how to create
1070the frame. There are two possibilities for the rest of the list (its 1088the frame. There are two possibilities for the rest of that list (its
1071@sc{cdr}). It can be an alist, specifying frame parameters, or it can 1089@sc{cdr}): It can be an alist, specifying frame parameters, or it can
1072contain a function and arguments to give to it. (The function's first 1090contain a function and arguments to give to it. (The function's first
1073argument is always the buffer to be displayed; the arguments from the 1091argument is always the buffer to be displayed; the arguments from the
1074list come after that.) 1092list come after that.)
@@ -1178,16 +1196,19 @@ accept two arguments, the first two arguments that @code{display-buffer}
1178received. It should choose or create a window, display the specified 1196received. It should choose or create a window, display the specified
1179buffer in it, and then return the window. 1197buffer in it, and then return the window.
1180 1198
1181This hook takes precedence over all the other options and hooks 1199This variable takes precedence over all the other options described
1182described above. 1200above.
1183@end defvar 1201@end defvar
1184 1202
1185@c Emacs 19 feature 1203@c Emacs 19 feature
1186@cindex dedicated window 1204@cindex dedicated window
1187A window can be marked as @dfn{dedicated} to its buffer. Then 1205If all options described above fail to produce a suitable window,
1188@code{display-buffer} will not try to use that window to display any 1206@code{display-buffer} will try to use an existing window. You can avoid
1189other buffer. @code{set-window-buffer} will signal an error when asked 1207that @code{display-buffer} uses a specific window by marking that window
1190to display another buffer in it. Both @code{get-lru-window} and 1208as @dfn{dedicated} to its buffer. Then @code{display-buffer} will not
1209try to use that window to display any other buffer. Moreover,
1210@code{set-window-buffer} will signal an error when asked to display
1211another buffer in it. Both @code{get-lru-window} and
1191@code{get-largest-window} do not consider dedicated windows as 1212@code{get-largest-window} do not consider dedicated windows as
1192candidates when their @var{dedicated} argument is non-@code{nil}. 1213candidates when their @var{dedicated} argument is non-@code{nil}.
1193 1214
@@ -1196,18 +1217,27 @@ is the only window on its frame, it will delete that frame as well if
1196there are other frames left. @code{replace-buffer-in-windows} deletes 1217there are other frames left. @code{replace-buffer-in-windows} deletes
1197any dedicated window showing its buffer argument. When such a window is 1218any dedicated window showing its buffer argument. When such a window is
1198the only window on its frame, that frame is deleted if there are other 1219the only window on its frame, that frame is deleted if there are other
1199frames left. 1220frames left. If there are no more frames left, some other buffer is
1221displayed in the window and the window is marked as non-dedicated.
1200 1222
1201@defun window-dedicated-p &optional window 1223@defun window-dedicated-p &optional window
1202This function returns non-@code{nil} if @var{window} is marked as 1224This function returns non-@code{nil} if @var{window} is dedicated to its
1203dedicated; otherwise @code{nil}. 1225buffer and @code{nil} otherwise. More precisely, the return value is
1226the value assigned by the last call of @code{set-window-dedicated-p} for
1227@var{window} or @code{nil} if that function was never called with
1228@var{WINDOW} as its argument.
1204@end defun 1229@end defun
1205 1230
1206@defun set-window-dedicated-p window flag 1231@defun set-window-dedicated-p window flag
1207This function marks @var{window} as dedicated if @var{flag} is 1232This function marks @var{window} as dedicated to its buffer if
1208non-@code{nil}, and nondedicated otherwise. 1233@var{flag} is non-@code{nil}, and non-dedicated otherwise.
1209@end defun 1234@end defun
1210 1235
1236As a last resort, @code{display-buffer} tries to display
1237@var{buffer-or-name} on a new frame. In this case, the value of
1238@code{pop-up-frames} is disregarded.
1239
1240
1211@node Window Point 1241@node Window Point
1212@section Windows and Point 1242@section Windows and Point
1213@cindex window position 1243@cindex window position
@@ -2161,6 +2191,7 @@ This command returns non-@code{nil} if it actually shrank the window
2161and @code{nil} otherwise. 2191and @code{nil} otherwise.
2162@end deffn 2192@end deffn
2163 2193
2194@cindex fixed-size window
2164@defvar window-size-fixed 2195@defvar window-size-fixed
2165If this variable is non-@code{nil}, in any given buffer, 2196If this variable is non-@code{nil}, in any given buffer,
2166then the size of any window displaying the buffer remains fixed 2197then the size of any window displaying the buffer remains fixed