diff options
| author | Martin Rudalics | 2009-05-09 07:19:47 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2009-05-09 07:19:47 +0000 |
| commit | d3c0c321ba17daed18379c988eed3c9cfb6941b9 (patch) | |
| tree | 112003bf284c0f5d1aaa3a15539b8275a791a321 /doc | |
| parent | abe8f3060bc9127546acbcdc0c9be3de4471b52d (diff) | |
| download | emacs-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/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 115 |
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 @@ | |||
| 1 | 2009-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 | |||
| 1 | 2009-05-04 Chong Yidong <cyd@stupidchicken.com> | 7 | 2009-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 |
| 958 | This variable specifies whether @code{display-buffer} is allowed to | 958 | This variable specifies whether @code{display-buffer} is allowed to |
| 959 | split (@pxref{Splitting Windows}) an existing window . If it is | 959 | split (@pxref{Splitting Windows}) an existing window. If this variable |
| 960 | non-@code{nil}, @code{display-buffer} tries to split the largest | 960 | is non-@code{nil}, @code{display-buffer} tries to split the largest or |
| 961 | or least recently used window on the selected frame. (If the selected | 961 | least recently used window on the selected frame. (If the selected |
| 962 | frame is a minibuffer-only frame, it tries to split a window on | 962 | frame is a minibuffer-only frame, @code{display-buffer} tries to split a |
| 963 | another frame instead.) If @code{pop-up-windows} is @code{nil} or the | 963 | window on another frame instead.) If this variable is @code{nil} or the |
| 964 | variable @code{pop-up-frames} (see below) is non-@code{nil}, | 964 | variable @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 |
| 969 | This variable specifies how to split a window. Its value, if | 969 | This variable must specify a function with one argument, which is a |
| 970 | non-@code{nil}, should be a function of one argument, which is a | 970 | window. The @code{display-buffer} routines will call this function with |
| 971 | window. If this variable specifies a function, @code{display-buffer} | 971 | one or more candidate windows when they look for a window to split. The |
| 972 | will call it with one or more candidate windows when it looks for a | 972 | function is expected to split that window and return the new window. If |
| 973 | window to split. If the argument window fits, the function is | 973 | the function returns @code{nil}, this means that the argument window |
| 974 | expected to split it and return a new window. If the function returns | 974 | cannot (or shall not) be split. |
| 975 | @code{nil}, the argument window will not be split. | 975 | |
| 976 | 976 | The default value of @code{split-window-preferred-function} is the | |
| 977 | If the value of this variable is @code{nil}, @code{display-buffer} | 977 | function @code{split-window-sensibly} described below. When you |
| 978 | uses the two variables described next to decide whether and which | 978 | customize this option, bear in mind that the @code{display-buffer} |
| 979 | window to split. | 979 | routines may call your function up to two times when trying to split a |
| 980 | window. The argument of the first call is the largest window on the | ||
| 981 | chosen frame (as returned by @code{get-largest-window}). If that call | ||
| 982 | fails to return a live window, your function is called a second time | ||
| 983 | with the least recently used window on that frame (as returned by | ||
| 984 | @code{get-lru-window}). | ||
| 985 | |||
| 986 | The function assigned to this option may also try to split any other | ||
| 987 | window instead of the argument window. Note that the window selected at | ||
| 988 | the time @code{display-buffer} was invoked is still selected when your | ||
| 989 | function is called. Hence, you can split the selected window (instead | ||
| 990 | of the largest or least recently used one) by simply ignoring the window | ||
| 991 | argument in the body of your function. You can even choose to not split | ||
| 992 | any window as long as the return value of your function specifies a live | ||
| 993 | window or nil, but you are not encouraged to do so unconditionally. If | ||
| 994 | you 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 | ||
| 999 | This function takes a window as argument and tries to split that window | ||
| 1000 | in a suitable way. The two variables described next are useful for | ||
| 1001 | tuning the behavior of this function. | ||
| 1002 | @end defun | ||
| 1003 | |||
| 982 | @defopt split-height-threshold | 1004 | @defopt split-height-threshold |
| 983 | This variable specifies whether @code{display-buffer} may split a window | 1005 | This variable specifies whether @code{split-window-sensibly} may split |
| 984 | vertically, provided there are multiple windows. If the value is a | 1006 | its argument window vertically. If this variable is set to an integer, |
| 985 | number, @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 |
| 986 | this many lines. If no window is tall enough, or if the value of this | 1008 | this many lines. If the value of this variable is @code{nil}, |
| 987 | variable is @code{nil}, @code{display-buffer} tries to split some window | 1009 | @code{split-window-sensibly} tries to split the window horizontally, |
| 988 | horizontally, subject to restrictions of @code{split-width-threshold} | 1010 | subject to restrictions of @code{split-width-threshold} (see below). If |
| 989 | (see below). If splitting horizontally is impossible too, | 1011 | splitting horizontally fails too, @code{split-window-sensibly} will try |
| 990 | @code{display-buffer} splits a window vertically only if it's the only | 1012 | to split the window vertically disregarding the value of this variable. |
| 991 | window 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 | 1015 | height is fixed (@pxref{Resizing Windows}). Moreover, it splits a | |
| 994 | A window whose height is fixed (@pxref{Resizing Windows}) cannot be | 1016 | window vertically only if the space taken up by that window can |
| 995 | split vertically by @code{display-buffer}. Also, @code{display-buffer} | 1017 | accommodate two windows one above the other that are both at least |
| 996 | splits a window vertically only if it can accommodate two windows that | 1018 | @code{window-min-height} lines tall. Finally, if the window that shall |
| 997 | are both at least `window-min-height' lines tall. Moreover, if the | 1019 | be split has a mode line, @code{split-window-sensibly} makes sure that |
| 998 | window that shall be split has a mode line, the window must be at least | 1020 | the new window can accomodate a mode line as well. |
| 999 | four lines tall in order to make sure that the new window can have a | ||
| 1000 | mode line as well. If the original window doesn't have a mode line, a | ||
| 1001 | height of two lines suffices. | ||
| 1002 | @end defopt | 1021 | @end defopt |
| 1003 | 1022 | ||
| 1004 | @defopt split-width-threshold | 1023 | @defopt split-width-threshold |
| 1005 | This variable specifies whether @code{display-buffer} may split a window | 1024 | This variable specifies whether @code{split-window-sensibly} may split |
| 1006 | horizontally. If the value is a number, @code{display-buffer} may split | 1025 | its argument window horizontally. If this variable is set to an |
| 1007 | a window if it has at least this many columns. If the value of this | 1026 | integer, @code{split-window-sensibly} splits the window only if it has |
| 1008 | variable is @code{nil}, @code{display-buffer} will not split any windows | 1027 | at least this many columns. If the value of this variable is |
| 1009 | horizontally. (It still might split some window vertically, though, see | 1028 | @code{nil}, @code{split-window-sensibly} will not split the window |
| 1029 | horizontally. (It still might split the window vertically, though, see | ||
| 1010 | above.) | 1030 | above.) |
| 1011 | 1031 | ||
| 1012 | A window whose width is fixed (@pxref{Resizing Windows}) cannot be split | 1032 | @code{split-window-sensibly} does not split a window horizontally if |
| 1013 | horizontally by @code{display-buffer}. Also, @code{display-buffer} | 1033 | that window's width is fixed (@pxref{Resizing Windows}). Also, it |
| 1014 | splits a window horizontally only if it can accommodate two windows that | 1034 | splits a window horizontally only if the space that window takes up can |
| 1015 | are both at least `window-min-width' columns wide. | 1035 | accommodate 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 |
| 1537 | window (for example in the presence of a large image), the scroll | 1558 | window (for example in the presence of a large image), the scroll |
| 1538 | functions will adjust the window vscroll to scroll the partially | 1559 | functions will adjust the window vscroll to scroll the partially visible |
| 1539 | visible row. To disable this feature, Lisp code may bind the variable | 1560 | row. 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 |
| 1543 | This function scrolls the text in the selected window upward | 1564 | This function scrolls the text in the selected window upward |