diff options
| author | Martin Rudalics | 2008-10-22 13:04:16 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2008-10-22 13:04:16 +0000 |
| commit | 52a94b8577ea3d5d3211aca60dae84541e3abffa (patch) | |
| tree | 6f8a01cb3b7f47db20d41b8ce3ee0a9943c09ba3 | |
| parent | cb83c00bd13b63c0d0752698e4ad441968bc04ac (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 177 |
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 @@ | |||
| 1 | 2008-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 | |||
| 1 | 2008-10-21 Eli Zaretskii <eliz@gnu.org> | 8 | 2008-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 |
| 855 | This function makes @var{buffer-or-name} the current buffer and | 855 | This function makes @var{buffer-or-name} the current buffer and switches |
| 856 | switches to it in some window, preferably not the window previously | 856 | to it in some window, preferably not the window previously selected. |
| 857 | selected. The ``popped-to'' window becomes the selected window within | 857 | The ``popped-to'' window becomes the selected window. Its frame is |
| 858 | its frame. The return value is the buffer that was switched to. | 858 | given the X server's focus if possible, see @ref{Input Focus}. The |
| 859 | If @var{buffer-or-name} is @code{nil}, that means to choose some | 859 | return value is the buffer that was switched to. If |
| 860 | other buffer, but you don't specify which. | 860 | @var{buffer-or-name} is @code{nil}, that means to choose some other |
| 861 | buffer, but you don't specify which. | ||
| 861 | 862 | ||
| 862 | If the variable @code{pop-up-frames} is non-@code{nil}, | 863 | If 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 |
| 922 | This command makes @var{buffer-or-name} appear in some window, like | 923 | This 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 | 924 | does not select that window and does not make the buffer specified by |
| 924 | make the buffer current. The identity of the selected window is | 925 | @var{buffer-or-name} current. The identity of the selected window is |
| 925 | unaltered by this function. @var{buffer-or-name} must be a buffer, or | 926 | unaltered by this function. @var{buffer-or-name} must be a buffer, or |
| 926 | the name of an existing buffer. | 927 | the name of an existing buffer. |
| 927 | 928 | ||
| @@ -959,6 +960,27 @@ Precisely how @code{display-buffer} finds or creates a window depends on | |||
| 959 | the variables described below. | 960 | the variables described below. |
| 960 | @end deffn | 961 | @end deffn |
| 961 | 962 | ||
| 963 | @defopt display-buffer-reuse-frames | ||
| 964 | If this variable is non-@code{nil}, @code{display-buffer} searches | ||
| 965 | existing frames for a window displaying @var{buffer-or-name}. If the | ||
| 966 | buffer is already displayed in a window in some frame, | ||
| 967 | @code{display-buffer} makes the frame visible and raises it, to use that | ||
| 968 | window. 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 | ||
| 974 | This variable specifies whether @code{display-buffer} is allowed to | ||
| 975 | split (@pxref{Splitting Windows}) an existing window . If it is | ||
| 976 | non-@code{nil}, @code{display-buffer} tries to the split the largest or | ||
| 977 | least recently used window on the selected frame. (If the selected | ||
| 978 | frame is a minibuffer-only frame, it tries to split a window on another | ||
| 979 | frame 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 |
| 963 | This variable specifies how to split a window. Its value, if | 985 | This variable specifies how to split a window. Its value, if |
| 964 | non-@code{nil}, should be a function of one argument, which is a | 986 | non-@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} | |||
| 966 | will call it with one or more candidate windows when it looks for a | 988 | will call it with one or more candidate windows when it looks for a |
| 967 | window to split. If the argument window fits, the function is | 989 | window to split. If the argument window fits, the function is |
| 968 | expected to split it and return a new window. If the function returns | 990 | expected 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 | ||
| 971 | If the value of this variable is @code{nil}, @code{display-buffer} | 993 | If the value of this variable is @code{nil}, @code{display-buffer} |
| 972 | uses the other variables described below to decide whether and which | 994 | uses the two variables described next to decide whether and which |
| 973 | window to split. | 995 | window to split. |
| 974 | @end defvar | 996 | @end defvar |
| 975 | 997 | ||
| 976 | @defopt display-buffer-reuse-frames | ||
| 977 | If this variable is non-@code{nil}, @code{display-buffer} searches | ||
| 978 | existing frames for a window displaying the buffer. If the buffer is | ||
| 979 | already displayed in a window in some frame, @code{display-buffer} makes | ||
| 980 | the frame visible and raises it, to use that window. If the buffer is | ||
| 981 | not already displayed, or if @code{display-buffer-reuse-frames} is | ||
| 982 | @code{nil}, @code{display-buffer}'s behavior is determined by other | ||
| 983 | variables, described below. | ||
| 984 | @end defopt | ||
| 985 | |||
| 986 | @defopt pop-up-windows | ||
| 987 | This variable specifies whether @code{display-buffer} makes new windows. | ||
| 988 | If it is non-@code{nil} and there is only one window, then that window | ||
| 989 | is split vertically. If it is @code{nil}, then @code{display-buffer} | ||
| 990 | does not split the single window, but uses it whole. | ||
| 991 | @end defopt | ||
| 992 | |||
| 993 | @defopt split-height-threshold | 998 | @defopt split-height-threshold |
| 994 | This variable specifies when @code{display-buffer} may split a window | 999 | This variable specifies whether @code{display-buffer} may split a window |
| 995 | vertically, if there are multiple windows. If the value is a number, | 1000 | vertically, provided there are multiple windows. If the value is a |
| 996 | @code{display-buffer} splits the largest window if it has at least | 1001 | number, @code{display-buffer} splits a window only if it has at least |
| 997 | this many lines. If the largest window is not this tall, or if the | 1002 | this many lines. If no window is tall enough, or if the value of this |
| 998 | value of this variable is @code{nil}, @code{display-buffer} tries to | 1003 | variable is @code{nil}, @code{display-buffer} tries to split some window |
| 999 | split some window horizontally, subject to restrictions of | 1004 | horizontally, 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, |
| 1001 | is impossible, @code{display-buffer} splits a window vertically | 1006 | @code{display-buffer} splits a window vertically only if it's the only |
| 1002 | only if it's the only window on its frame and not the minibuffer | 1007 | window on its frame and not the minibuffer window, and only if |
| 1003 | window, and only if @code{pop-up-windows} is non-@code{nil}. | 1008 | @code{pop-up-windows} is non-@code{nil}. |
| 1004 | Otherwise, @code{display-buffer} uses one of the existing windows. | 1009 | |
| 1010 | A window whose height is fixed (@pxref{Resizing Windows}) cannot be | ||
| 1011 | split vertically by @code{display-buffer}. Also, @code{display-buffer} | ||
| 1012 | splits a window vertically only if it can accommodate two windows that | ||
| 1013 | are both at least `window-min-height' lines tall. Moreover, if the | ||
| 1014 | window that shall be split has a mode-line, the window must be at least | ||
| 1015 | four lines tall in order to make sure that the new window can have a | ||
| 1016 | mode-line as well. If the original window doesn't have a mode-line, a | ||
| 1017 | height of two lines suffices. | ||
| 1005 | @end defopt | 1018 | @end defopt |
| 1006 | 1019 | ||
| 1007 | @defopt split-width-threshold | 1020 | @defopt split-width-threshold |
| 1008 | This variable specifies when @code{display-buffer} may split a window | 1021 | This variable specifies whether @code{display-buffer} may split a window |
| 1009 | horizontally. If the value is a number, @code{display-buffer} may | 1022 | horizontally. If the value is a number, @code{display-buffer} may split |
| 1010 | split a window if it has at least this many columns. If the value of | 1023 | a window if it has at least this many columns. If the value of this |
| 1011 | this variable is @code{nil}, @code{display-buffer} will not split any | 1024 | variable is @code{nil}, @code{display-buffer} will not split any windows |
| 1012 | windows horizontally. (It still might split some window vertically, | 1025 | horizontally. (It still might split some window vertically, though, see |
| 1013 | though, see above.) | 1026 | above.) |
| 1027 | |||
| 1028 | A window whose width is fixed (@pxref{Resizing Windows}) cannot be split | ||
| 1029 | horizontally by @code{display-buffer}. Also, @code{display-buffer} | ||
| 1030 | splits a window horizontally only if it can accommodate two windows that | ||
| 1031 | are 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 |
| 1017 | This variable specifies whether @code{display-buffer} should even out | 1035 | This variable specifies whether @code{display-buffer} should even out |
| 1018 | window heights if the buffer gets displayed in an existing window, | 1036 | window heights if the buffer gets displayed in an existing window, above |
| 1019 | above or beneath another existing window. If | 1037 | or beneath another window. If @code{even-window-heights} is |
| 1020 | @code{even-window-heights} is @code{t}, the default, window heights | 1038 | non-@code{nil}, the default, window heights will be evened out. If |
| 1021 | will be evened out. If @code{even-window-heights} is @code{nil}, the | 1039 | either of the involved window has fixed height (@pxref{Resizing |
| 1022 | original window heights will be left alone. | 1040 | Windows}) or @code{even-window-heights} is @code{nil}, the original |
| 1041 | window 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 |
| 1027 | This variable specifies whether @code{display-buffer} makes new frames. | 1046 | This variable specifies whether @code{display-buffer} makes new frames. |
| 1028 | If it is non-@code{nil}, @code{display-buffer} looks for an existing | 1047 | If it is non-@code{nil}, @code{display-buffer} looks for an existing |
| 1029 | window already displaying the desired buffer, on any visible frame. | 1048 | window already displaying the desired buffer, on any visible frame. If |
| 1030 | If it finds one, it returns that window. Otherwise it makes a new | 1049 | it finds one, it returns that window. Otherwise it makes a new frame, |
| 1031 | frame, unless the variable's value is @code{graphic-only} and the | 1050 | unless the variable's value is @code{graphic-only} and the selected |
| 1032 | selected frame is not on a graphic display. The variables | 1051 | frame 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 | ||
| 1035 | non-@code{nil}. | 1053 | non-@code{nil}. |
| 1036 | 1054 | ||
| 1037 | If @code{pop-up-frames} is @code{nil}, then @code{display-buffer} either | 1055 | If @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 |
| 1062 | A list of buffer names for buffers that should be displayed specially. | 1080 | A list of buffer names for buffers that should be displayed specially. |
| 1063 | If the buffer's name is in this list, @code{display-buffer} handles the | 1081 | If the name of @var{buffer-or-name} is in this list, |
| 1064 | buffer specially. | 1082 | @code{display-buffer} handles the buffer specially. |
| 1065 | 1083 | ||
| 1066 | By default, special display means to give the buffer a dedicated frame. | 1084 | By default, special display means to give the buffer a dedicated frame. |
| 1067 | 1085 | ||
| 1068 | If an element is a list, instead of a string, then the @sc{car} of the | 1086 | If an element is a list, instead of a string, then the @sc{car} of that |
| 1069 | list is the buffer name, and the rest of the list says how to create | 1087 | list is the buffer name, and the rest of that list says how to create |
| 1070 | the frame. There are two possibilities for the rest of the list (its | 1088 | the 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 |
| 1072 | contain a function and arguments to give to it. (The function's first | 1090 | contain a function and arguments to give to it. (The function's first |
| 1073 | argument is always the buffer to be displayed; the arguments from the | 1091 | argument is always the buffer to be displayed; the arguments from the |
| 1074 | list come after that.) | 1092 | list come after that.) |
| @@ -1178,16 +1196,19 @@ accept two arguments, the first two arguments that @code{display-buffer} | |||
| 1178 | received. It should choose or create a window, display the specified | 1196 | received. It should choose or create a window, display the specified |
| 1179 | buffer in it, and then return the window. | 1197 | buffer in it, and then return the window. |
| 1180 | 1198 | ||
| 1181 | This hook takes precedence over all the other options and hooks | 1199 | This variable takes precedence over all the other options described |
| 1182 | described above. | 1200 | above. |
| 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 |
| 1187 | A window can be marked as @dfn{dedicated} to its buffer. Then | 1205 | If 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 |
| 1189 | other buffer. @code{set-window-buffer} will signal an error when asked | 1207 | that @code{display-buffer} uses a specific window by marking that window |
| 1190 | to display another buffer in it. Both @code{get-lru-window} and | 1208 | as @dfn{dedicated} to its buffer. Then @code{display-buffer} will not |
| 1209 | try to use that window to display any other buffer. Moreover, | ||
| 1210 | @code{set-window-buffer} will signal an error when asked to display | ||
| 1211 | another 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 |
| 1192 | candidates when their @var{dedicated} argument is non-@code{nil}. | 1213 | candidates 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 | |||
| 1196 | there are other frames left. @code{replace-buffer-in-windows} deletes | 1217 | there are other frames left. @code{replace-buffer-in-windows} deletes |
| 1197 | any dedicated window showing its buffer argument. When such a window is | 1218 | any dedicated window showing its buffer argument. When such a window is |
| 1198 | the only window on its frame, that frame is deleted if there are other | 1219 | the only window on its frame, that frame is deleted if there are other |
| 1199 | frames left. | 1220 | frames left. If there are no more frames left, some other buffer is |
| 1221 | displayed 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 |
| 1202 | This function returns non-@code{nil} if @var{window} is marked as | 1224 | This function returns non-@code{nil} if @var{window} is dedicated to its |
| 1203 | dedicated; otherwise @code{nil}. | 1225 | buffer and @code{nil} otherwise. More precisely, the return value is |
| 1226 | the 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 |
| 1207 | This function marks @var{window} as dedicated if @var{flag} is | 1232 | This function marks @var{window} as dedicated to its buffer if |
| 1208 | non-@code{nil}, and nondedicated otherwise. | 1233 | @var{flag} is non-@code{nil}, and non-dedicated otherwise. |
| 1209 | @end defun | 1234 | @end defun |
| 1210 | 1235 | ||
| 1236 | As 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 | |||
| 2161 | and @code{nil} otherwise. | 2191 | and @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 |
| 2165 | If this variable is non-@code{nil}, in any given buffer, | 2196 | If this variable is non-@code{nil}, in any given buffer, |
| 2166 | then the size of any window displaying the buffer remains fixed | 2197 | then the size of any window displaying the buffer remains fixed |