aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2009-05-09 07:19:47 +0000
committerMartin Rudalics2009-05-09 07:19:47 +0000
commitd3c0c321ba17daed18379c988eed3c9cfb6941b9 (patch)
tree112003bf284c0f5d1aaa3a15539b8275a791a321 /doc
parentabe8f3060bc9127546acbcdc0c9be3de4471b52d (diff)
downloademacs-d3c0c321ba17daed18379c988eed3c9cfb6941b9.tar.gz
emacs-d3c0c321ba17daed18379c988eed3c9cfb6941b9.zip
(Choosing Window): Describe split-window-sensibly
and rewrite section on window splitting accordingly. (Textual Scrolling): Replace `...' by @code{...}.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/windows.texi115
2 files changed, 74 insertions, 47 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 4dd866ec99b..aa16c5d180b 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12009-05-09 Martin Rudalics <rudalics@gmx.at>
2
3 * windows.texi (Choosing Window): Describe split-window-sensibly
4 and rewrite section on window splitting accordingly.
5 (Textual Scrolling): Replace `...' by @code{...}.
6
12009-05-04 Chong Yidong <cyd@stupidchicken.com> 72009-05-04 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * hooks.texi (Standard Hooks): Add abbrev-expand-functions. 9 * hooks.texi (Standard Hooks): Add abbrev-expand-functions.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 0be4032fed6..4d4d466f5af 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -956,63 +956,84 @@ window. If the buffer is not already displayed, or
956 956
957@defopt pop-up-windows 957@defopt pop-up-windows
958This variable specifies whether @code{display-buffer} is allowed to 958This variable specifies whether @code{display-buffer} is allowed to
959split (@pxref{Splitting Windows}) an existing window . If it is 959split (@pxref{Splitting Windows}) an existing window. If this variable
960non-@code{nil}, @code{display-buffer} tries to split the largest 960is non-@code{nil}, @code{display-buffer} tries to split the largest or
961or least recently used window on the selected frame. (If the selected 961least recently used window on the selected frame. (If the selected
962frame is a minibuffer-only frame, it tries to split a window on 962frame is a minibuffer-only frame, @code{display-buffer} tries to split a
963another frame instead.) If @code{pop-up-windows} is @code{nil} or the 963window on another frame instead.) If this variable is @code{nil} or the
964variable @code{pop-up-frames} (see below) is non-@code{nil}, 964variable @code{pop-up-frames} (see below) is non-@code{nil},
965@code{display-buffer} does not split any window. 965@code{display-buffer} does not split any window.
966@end defopt 966@end defopt
967 967
968@defvar split-window-preferred-function 968@defvar split-window-preferred-function
969This variable specifies how to split a window. Its value, if 969This variable must specify a function with one argument, which is a
970non-@code{nil}, should be a function of one argument, which is a 970window. The @code{display-buffer} routines will call this function with
971window. If this variable specifies a function, @code{display-buffer} 971one or more candidate windows when they look for a window to split. The
972will call it with one or more candidate windows when it looks for a 972function is expected to split that window and return the new window. If
973window to split. If the argument window fits, the function is 973the function returns @code{nil}, this means that the argument window
974expected to split it and return a new window. If the function returns 974cannot (or shall not) be split.
975@code{nil}, the argument window will not be split. 975
976 976The default value of @code{split-window-preferred-function} is the
977If the value of this variable is @code{nil}, @code{display-buffer} 977function @code{split-window-sensibly} described below. When you
978uses the two variables described next to decide whether and which 978customize this option, bear in mind that the @code{display-buffer}
979window to split. 979routines may call your function up to two times when trying to split a
980window. The argument of the first call is the largest window on the
981chosen frame (as returned by @code{get-largest-window}). If that call
982fails to return a live window, your function is called a second time
983with the least recently used window on that frame (as returned by
984@code{get-lru-window}).
985
986The function assigned to this option may also try to split any other
987window instead of the argument window. Note that the window selected at
988the time @code{display-buffer} was invoked is still selected when your
989function is called. Hence, you can split the selected window (instead
990of the largest or least recently used one) by simply ignoring the window
991argument in the body of your function. You can even choose to not split
992any window as long as the return value of your function specifies a live
993window or nil, but you are not encouraged to do so unconditionally. If
994you want @code{display-buffer} to never split any windows, set
995@code{pop-up-windows} to @code{nil}.
980@end defvar 996@end defvar
981 997
998@defun split-window-sensibly
999This function takes a window as argument and tries to split that window
1000in a suitable way. The two variables described next are useful for
1001tuning the behavior of this function.
1002@end defun
1003
982@defopt split-height-threshold 1004@defopt split-height-threshold
983This variable specifies whether @code{display-buffer} may split a window 1005This variable specifies whether @code{split-window-sensibly} may split
984vertically, provided there are multiple windows. If the value is a 1006its argument window vertically. If this variable is set to an integer,
985number, @code{display-buffer} splits a window only if it has at least 1007@code{split-window-sensibly} splits the window only if it has at least
986this many lines. If no window is tall enough, or if the value of this 1008this many lines. If the value of this variable is @code{nil},
987variable is @code{nil}, @code{display-buffer} tries to split some window 1009@code{split-window-sensibly} tries to split the window horizontally,
988horizontally, subject to restrictions of @code{split-width-threshold} 1010subject to restrictions of @code{split-width-threshold} (see below). If
989(see below). If splitting horizontally is impossible too, 1011splitting horizontally fails too, @code{split-window-sensibly} will try
990@code{display-buffer} splits a window vertically only if it's the only 1012to split the window vertically disregarding the value of this variable.
991window on its frame and not the minibuffer window, and only if 1013
992@code{pop-up-windows} is non-@code{nil}. 1014@code{split-window-sensibly} does not split a window vertically whose
993 1015height is fixed (@pxref{Resizing Windows}). Moreover, it splits a
994A window whose height is fixed (@pxref{Resizing Windows}) cannot be 1016window vertically only if the space taken up by that window can
995split vertically by @code{display-buffer}. Also, @code{display-buffer} 1017accommodate two windows one above the other that are both at least
996splits a window vertically only if it can accommodate two windows that 1018@code{window-min-height} lines tall. Finally, if the window that shall
997are both at least `window-min-height' lines tall. Moreover, if the 1019be split has a mode line, @code{split-window-sensibly} makes sure that
998window that shall be split has a mode line, the window must be at least 1020the new window can accomodate a mode line as well.
999four lines tall in order to make sure that the new window can have a
1000mode line as well. If the original window doesn't have a mode line, a
1001height of two lines suffices.
1002@end defopt 1021@end defopt
1003 1022
1004@defopt split-width-threshold 1023@defopt split-width-threshold
1005This variable specifies whether @code{display-buffer} may split a window 1024This variable specifies whether @code{split-window-sensibly} may split
1006horizontally. If the value is a number, @code{display-buffer} may split 1025its argument window horizontally. If this variable is set to an
1007a window if it has at least this many columns. If the value of this 1026integer, @code{split-window-sensibly} splits the window only if it has
1008variable is @code{nil}, @code{display-buffer} will not split any windows 1027at least this many columns. If the value of this variable is
1009horizontally. (It still might split some window vertically, though, see 1028@code{nil}, @code{split-window-sensibly} will not split the window
1029horizontally. (It still might split the window vertically, though, see
1010above.) 1030above.)
1011 1031
1012A window whose width is fixed (@pxref{Resizing Windows}) cannot be split 1032@code{split-window-sensibly} does not split a window horizontally if
1013horizontally by @code{display-buffer}. Also, @code{display-buffer} 1033that window's width is fixed (@pxref{Resizing Windows}). Also, it
1014splits a window horizontally only if it can accommodate two windows that 1034splits a window horizontally only if the space that window takes up can
1015are both at least `window-min-width' columns wide. 1035accommodate two windows side by side that are both at least
1036@code{window-min-width} columns wide.
1016@end defopt 1037@end defopt
1017 1038
1018@defopt even-window-heights 1039@defopt even-window-heights
@@ -1535,9 +1556,9 @@ window. @xref{Current Buffer}.
1535 1556
1536 If the window contains a row which is taller than the height of the 1557 If the window contains a row which is taller than the height of the
1537window (for example in the presence of a large image), the scroll 1558window (for example in the presence of a large image), the scroll
1538functions will adjust the window vscroll to scroll the partially 1559functions will adjust the window vscroll to scroll the partially visible
1539visible row. To disable this feature, Lisp code may bind the variable 1560row. To disable this feature, Lisp code may bind the variable
1540`auto-window-vscroll' to @code{nil} (@pxref{Vertical Scrolling}). 1561@code{auto-window-vscroll} to @code{nil} (@pxref{Vertical Scrolling}).
1541 1562
1542@deffn Command scroll-up &optional count 1563@deffn Command scroll-up &optional count
1543This function scrolls the text in the selected window upward 1564This function scrolls the text in the selected window upward