diff options
| author | Chong Yidong | 2011-09-24 14:19:20 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-09-24 14:19:20 -0400 |
| commit | 0a2132baa8e795b72d35833209132d23a1553bc2 (patch) | |
| tree | de54a62be203b5bdf25a824bce36d454de778030 | |
| parent | 25b4bfa0d11557a8041362ead77b8b1aff0f330d (diff) | |
| download | emacs-0a2132baa8e795b72d35833209132d23a1553bc2.tar.gz emacs-0a2132baa8e795b72d35833209132d23a1553bc2.zip | |
Window-related updates to NEWS and Emacs manual.
* etc/NEWS: Reorganize, placing user options in Changes section.
* doc/emacs/buffers.texi (Select Buffer): Clarify description of
buffer-switching commands. Add xref to Window Display node.
Don't repeat confirm-nonexistent-file-or-buffer description from
Visiting node. Remove even-window-heights.
* doc/emacs/frames.texi (Special Buffer Frames): Add xref to Window Choice.
* doc/emacs/windows.texi (Pop Up Window): Defer discussion of window
splitting to the Window Choice node. Add index entries.
(Force Same Window): Node deleted.
(Displaying Buffers, Window Choice): New nodes.
| -rw-r--r-- | doc/emacs/ChangeLog | 14 | ||||
| -rw-r--r-- | doc/emacs/buffers.texi | 42 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 3 | ||||
| -rw-r--r-- | doc/emacs/frames.texi | 18 | ||||
| -rw-r--r-- | doc/emacs/windows.texi | 205 | ||||
| -rw-r--r-- | etc/NEWS | 88 |
6 files changed, 229 insertions, 141 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 163eabed2a6..ac913fc3264 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2011-09-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * windows.texi (Pop Up Window): Defer discussion of window | ||
| 4 | splitting to the Window Choice node. Add index entries. | ||
| 5 | (Force Same Window): Node deleted. | ||
| 6 | (Displaying Buffers, Window Choice): New nodes. | ||
| 7 | |||
| 8 | * buffers.texi (Select Buffer): Clarify description of | ||
| 9 | buffer-switching commands. Add xref to Window Display node. | ||
| 10 | Don't repeat confirm-nonexistent-file-or-buffer description from | ||
| 11 | Visiting node. Remove even-window-heights. | ||
| 12 | |||
| 13 | * frames.texi (Special Buffer Frames): Add xref to Window Choice. | ||
| 14 | |||
| 1 | 2011-09-18 Chong Yidong <cyd@stupidchicken.com> | 15 | 2011-09-18 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 16 | ||
| 3 | * cmdargs.texi (Icons X): Fix description of Emacs icon. | 17 | * cmdargs.texi (Icons X): Fix description of Emacs icon. |
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index c4880af2b5d..b82f3fac7d4 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi | |||
| @@ -91,9 +91,9 @@ selected buffer other than the current buffer. | |||
| 91 | @var{bufname} @key{RET}}. This runs the command | 91 | @var{bufname} @key{RET}}. This runs the command |
| 92 | @code{switch-to-buffer} with argument @var{bufname}. While entering | 92 | @code{switch-to-buffer} with argument @var{bufname}. While entering |
| 93 | the buffer name, you can use the usual minibuffer completion and | 93 | the buffer name, you can use the usual minibuffer completion and |
| 94 | history commands (@pxref{Minibuffer}). An empty argument to @kbd{C-x | 94 | history commands (@pxref{Minibuffer}). An empty input specifies the |
| 95 | b} specifies the buffer that was current most recently among those not | 95 | buffer that was current most recently among those not now displayed in |
| 96 | now displayed in any window. | 96 | any window. |
| 97 | 97 | ||
| 98 | @cindex minibuffer confirmation | 98 | @cindex minibuffer confirmation |
| 99 | @cindex confirming in the minibuffer | 99 | @cindex confirming in the minibuffer |
| @@ -107,16 +107,8 @@ catches a common mistake, in which one types @key{RET} before | |||
| 107 | realizing that @key{TAB} did not complete far enough to yield the | 107 | realizing that @key{TAB} did not complete far enough to yield the |
| 108 | desired buffer name (@pxref{Completion}). Emacs asks for confirmation | 108 | desired buffer name (@pxref{Completion}). Emacs asks for confirmation |
| 109 | by putting the message @samp{[Confirm]} in the minibuffer; type | 109 | by putting the message @samp{[Confirm]} in the minibuffer; type |
| 110 | @key{RET} again to confirm and visit the buffer. | 110 | @key{RET} again to confirm and visit the buffer. @xref{Visiting}, for |
| 111 | 111 | information about modifying this behavior. | |
| 112 | @vindex confirm-nonexistent-file-or-buffer | ||
| 113 | The variable @code{confirm-nonexistent-file-or-buffer} controls | ||
| 114 | whether Emacs asks for confirmation before visiting a buffer that did | ||
| 115 | not previously exist. The default value, @code{after-completion}, | ||
| 116 | gives the behavior we have just described. If the value is | ||
| 117 | @code{nil}, Emacs never asks for confirmation; for any other | ||
| 118 | non-@code{nil} value, Emacs always asks for confirmation. This | ||
| 119 | variable also affects the @code{find-file} command (@pxref{Visiting}). | ||
| 120 | 112 | ||
| 121 | One reason to create a new buffer is to use it for making temporary | 113 | One reason to create a new buffer is to use it for making temporary |
| 122 | notes. If you try to save it, Emacs asks for the file name to use. | 114 | notes. If you try to save it, Emacs asks for the file name to use. |
| @@ -136,36 +128,26 @@ of most recent selection in the current frame), while @kbd{C-x @key{LEFT}} | |||
| 136 | 128 | ||
| 137 | @kindex C-x 4 b | 129 | @kindex C-x 4 b |
| 138 | @findex switch-to-buffer-other-window | 130 | @findex switch-to-buffer-other-window |
| 139 | @vindex even-window-heights | ||
| 140 | To select a buffer in a window other than the current one, type | 131 | To select a buffer in a window other than the current one, type |
| 141 | @kbd{C-x 4 b} (@code{switch-to-buffer-other-window}). This prompts | 132 | @kbd{C-x 4 b} (@code{switch-to-buffer-other-window}). This prompts |
| 142 | for a buffer name using the minibuffer, displays that buffer in | 133 | for a buffer name using the minibuffer, displays that buffer in |
| 143 | another window, and selects that window. By default, if displaying | 134 | another window, and selects that window. |
| 144 | the buffer causes two vertically adjacent windows to be displayed, the | ||
| 145 | heights of those windows are evened out; to countermand that and | ||
| 146 | preserve the window configuration, set the variable | ||
| 147 | @code{even-window-heights} to @code{nil}. | ||
| 148 | 135 | ||
| 149 | @kindex C-x 5 b | 136 | @kindex C-x 5 b |
| 150 | @findex switch-to-buffer-other-frame | 137 | @findex switch-to-buffer-other-frame |
| 151 | Similarly, @kbd{C-x 5 b} (@code{switch-to-buffer-other-frame}) | 138 | Similarly, @kbd{C-x 5 b} (@code{switch-to-buffer-other-frame}) |
| 152 | prompts for a buffer name, displays that buffer in another frame, and | 139 | prompts for a buffer name, displays that buffer in another frame, and |
| 153 | selects that frame. | 140 | selects that frame. If the buffer is already being shown in a window |
| 141 | on another frame, Emacs selects that window and frame instead of | ||
| 142 | creating a new frame. | ||
| 143 | |||
| 144 | @xref{Displaying Buffers}, for how the @kbd{C-x 4 b} and @kbd{C-x 5 | ||
| 145 | b} commands get the window and/or frame to display in. | ||
| 154 | 146 | ||
| 155 | In addition, @kbd{C-x C-f}, and any other command for visiting a | 147 | In addition, @kbd{C-x C-f}, and any other command for visiting a |
| 156 | file, can also be used to switch to an existing file-visiting buffer. | 148 | file, can also be used to switch to an existing file-visiting buffer. |
| 157 | @xref{Visiting}. | 149 | @xref{Visiting}. |
| 158 | 150 | ||
| 159 | @vindex display-buffer-reuse-frames | ||
| 160 | You can control how certain buffers are handled by these commands by | ||
| 161 | customizing the variables @code{special-display-buffer-names}, | ||
| 162 | @code{special-display-regexps}, @code{same-window-buffer-names}, and | ||
| 163 | @code{same-window-regexps}. See @ref{Force Same Window}, and | ||
| 164 | @ref{Special Buffer Frames}, for more about these variables. In | ||
| 165 | addition, if the value of @code{display-buffer-reuse-frames} is | ||
| 166 | non-@code{nil}, and the buffer you want to switch to is already | ||
| 167 | displayed in some frame, Emacs will just raise that frame. | ||
| 168 | |||
| 169 | @findex goto-line | 151 | @findex goto-line |
| 170 | @kbd{C-u M-g M-g}, that is @code{goto-line} with a plain prefix | 152 | @kbd{C-u M-g M-g}, that is @code{goto-line} with a plain prefix |
| 171 | argument, reads a number @var{n} using the minibuffer, selects the | 153 | argument, reads a number @var{n} using the minibuffer, selects the |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 2ba4af712af..bb675b61cff 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -488,9 +488,8 @@ Multiple Windows | |||
| 488 | * Split Window:: New windows are made by splitting existing windows. | 488 | * Split Window:: New windows are made by splitting existing windows. |
| 489 | * Other Window:: Moving to another window or doing something to it. | 489 | * Other Window:: Moving to another window or doing something to it. |
| 490 | * Pop Up Window:: Finding a file or buffer in another window. | 490 | * Pop Up Window:: Finding a file or buffer in another window. |
| 491 | * Force Same Window:: Forcing certain buffers to appear in the selected | ||
| 492 | window rather than in another window. | ||
| 493 | * Change Window:: Deleting windows and changing their sizes. | 491 | * Change Window:: Deleting windows and changing their sizes. |
| 492 | * Displaying Buffers:: How Emacs picks a window for displaying a buffer. | ||
| 494 | * Window Convenience:: Convenience functions for window handling. | 493 | * Window Convenience:: Convenience functions for window handling. |
| 495 | 494 | ||
| 496 | Frames and Graphical Displays | 495 | Frames and Graphical Displays |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 8ca598c3348..619252503a9 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -850,11 +850,12 @@ each others' edits if they are not careful. | |||
| 850 | 850 | ||
| 851 | @vindex special-display-buffer-names | 851 | @vindex special-display-buffer-names |
| 852 | You can make certain chosen buffers, which Emacs normally displays | 852 | You can make certain chosen buffers, which Emacs normally displays |
| 853 | in ``another window,'' appear in special frames of their own. To do | 853 | in ``some other window'' (@pxref{Displaying Buffers}), appear in |
| 854 | this, set the variable @code{special-display-buffer-names} to a list | 854 | special frames of their own. To do this, set the variable |
| 855 | of buffer names; any buffer whose name is in that list automatically | 855 | @code{special-display-buffer-names} to a list of buffer names; any |
| 856 | gets a special frame, when an Emacs command wants to display it ``in | 856 | buffer whose name is in that list automatically gets a special frame. |
| 857 | another window.'' | 857 | @xref{Window Choice}, for how this fits in with the other ways for |
| 858 | Emacs to choose a window to display in. | ||
| 858 | 859 | ||
| 859 | For example, if you set the variable this way, | 860 | For example, if you set the variable this way, |
| 860 | 861 | ||
| @@ -906,13 +907,6 @@ where @var{function} is a symbol. Then the frame is constructed by | |||
| 906 | calling @var{function}; its first argument is the buffer, and its | 907 | calling @var{function}; its first argument is the buffer, and its |
| 907 | remaining arguments are @var{args}. | 908 | remaining arguments are @var{args}. |
| 908 | 909 | ||
| 909 | An analogous feature lets you specify buffers which should be | ||
| 910 | displayed in the selected window. @xref{Force Same Window}. The | ||
| 911 | same-window feature takes precedence over the special-frame feature; | ||
| 912 | therefore, if you add a buffer name to | ||
| 913 | @code{special-display-buffer-names} and it has no effect, check to see | ||
| 914 | whether that feature is also in use for the same buffer name. | ||
| 915 | |||
| 916 | @node Frame Parameters | 910 | @node Frame Parameters |
| 917 | @section Setting Frame Parameters | 911 | @section Setting Frame Parameters |
| 918 | @cindex Auto-Raise mode | 912 | @cindex Auto-Raise mode |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 6aa8a06778b..dc92e4a519c 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -18,9 +18,8 @@ one frame. | |||
| 18 | * Split Window:: New windows are made by splitting existing windows. | 18 | * Split Window:: New windows are made by splitting existing windows. |
| 19 | * Other Window:: Moving to another window or doing something to it. | 19 | * Other Window:: Moving to another window or doing something to it. |
| 20 | * Pop Up Window:: Finding a file or buffer in another window. | 20 | * Pop Up Window:: Finding a file or buffer in another window. |
| 21 | * Force Same Window:: Forcing certain buffers to appear in the selected | ||
| 22 | window rather than in another window. | ||
| 23 | * Change Window:: Deleting windows and changing their sizes. | 21 | * Change Window:: Deleting windows and changing their sizes. |
| 22 | * Displaying Buffers:: How Emacs picks a window for displaying a buffer. | ||
| 24 | * Window Convenience:: Convenience functions for window handling. | 23 | * Window Convenience:: Convenience functions for window handling. |
| 25 | @end menu | 24 | @end menu |
| 26 | 25 | ||
| @@ -191,84 +190,47 @@ feature is off by default. | |||
| 191 | 190 | ||
| 192 | @cindex selecting buffers in other windows | 191 | @cindex selecting buffers in other windows |
| 193 | @kindex C-x 4 | 192 | @kindex C-x 4 |
| 194 | @kbd{C-x 4} is a prefix key for commands that select another window | 193 | @kbd{C-x 4} is a prefix key for a variety of commands that switch to |
| 195 | (splitting the window if there is only one) and select a buffer in that | 194 | a buffer in a different window---either another existing window, or a |
| 196 | window. Different @kbd{C-x 4} commands have different ways of finding the | 195 | new window created by splitting the selected window. @xref{Window |
| 197 | buffer to select. | 196 | Choice}, for how Emacs picks or creates the window to use. |
| 198 | 197 | ||
| 199 | @table @kbd | 198 | @table @kbd |
| 199 | @findex switch-to-buffer-other-window | ||
| 200 | @item C-x 4 b @var{bufname} @key{RET} | 200 | @item C-x 4 b @var{bufname} @key{RET} |
| 201 | Select buffer @var{bufname} in another window. This runs | 201 | Select buffer @var{bufname} in another window |
| 202 | @code{switch-to-buffer-other-window}. | 202 | (@code{switch-to-buffer-other-window}). |
| 203 | |||
| 204 | @findex display-buffer | ||
| 203 | @item C-x 4 C-o @var{bufname} @key{RET} | 205 | @item C-x 4 C-o @var{bufname} @key{RET} |
| 204 | Display buffer @var{bufname} in another window, but | 206 | Display buffer @var{bufname} in some window, without trying to select |
| 205 | don't select that buffer or that window. This runs | 207 | it (@code{display-buffer}). @xref{Displaying Buffers}, for details |
| 206 | @code{display-buffer}. | 208 | about how the window is chosen. |
| 209 | |||
| 210 | @findex find-file-other-window | ||
| 207 | @item C-x 4 f @var{filename} @key{RET} | 211 | @item C-x 4 f @var{filename} @key{RET} |
| 208 | Visit file @var{filename} and select its buffer in another window. This | 212 | Visit file @var{filename} and select its buffer in another window |
| 209 | runs @code{find-file-other-window}. @xref{Visiting}. | 213 | (@code{find-file-other-window}). @xref{Visiting}. |
| 214 | |||
| 215 | @findex dired-other-window | ||
| 210 | @item C-x 4 d @var{directory} @key{RET} | 216 | @item C-x 4 d @var{directory} @key{RET} |
| 211 | Select a Dired buffer for directory @var{directory} in another window. | 217 | Select a Dired buffer for directory @var{directory} in another window |
| 212 | This runs @code{dired-other-window}. @xref{Dired}. | 218 | (@code{dired-other-window}). @xref{Dired}. |
| 219 | |||
| 220 | @findex mail-other-window | ||
| 213 | @item C-x 4 m | 221 | @item C-x 4 m |
| 214 | Start composing a mail message in another window. This runs | 222 | Start composing a mail message, similar to @kbd{C-x m} (@pxref{Sending |
| 215 | @code{mail-other-window}; its same-window analogue is @kbd{C-x m} | 223 | Mail}), but in another window (@code{mail-other-window}). |
| 216 | (@pxref{Sending Mail}). | 224 | |
| 225 | @findex find-tag-other-window | ||
| 217 | @item C-x 4 . | 226 | @item C-x 4 . |
| 218 | Find a tag in the current tags table, in another window. This runs | 227 | Find a tag in the current tags table, similar to @kbd{M-.} |
| 219 | @code{find-tag-other-window}, the multiple-window variant of @kbd{M-.} | 228 | (@pxref{Tags}), but in another window (@code{find-tag-other-window}). |
| 220 | (@pxref{Tags}). | ||
| 221 | @item C-x 4 r @var{filename} @key{RET} | 229 | @item C-x 4 r @var{filename} @key{RET} |
| 222 | Visit file @var{filename} read-only, and select its buffer in another | 230 | Visit file @var{filename} read-only, and select its buffer in another |
| 223 | window. This runs @code{find-file-read-only-other-window}. | 231 | window (@code{find-file-read-only-other-window}). @xref{Visiting}. |
| 224 | @xref{Visiting}. | ||
| 225 | @end table | 232 | @end table |
| 226 | 233 | ||
| 227 | @vindex split-height-threshold | ||
| 228 | @vindex split-width-threshold | ||
| 229 | By default, these commands split the window vertically when there is | ||
| 230 | only one. You can customize the variables @code{split-height-threshold} | ||
| 231 | and @code{split-width-threshold} to split the window horizontally | ||
| 232 | instead. | ||
| 233 | |||
| 234 | |||
| 235 | @node Force Same Window | ||
| 236 | @section Forcing Display in the Same Window | ||
| 237 | |||
| 238 | Certain Emacs commands switch to a specific buffer with special | ||
| 239 | contents. For example, @kbd{M-x shell} switches to a buffer named | ||
| 240 | @samp{*shell*}. By convention, all these commands are written to pop up | ||
| 241 | the buffer in a separate window. But you can specify that certain of | ||
| 242 | these buffers should appear in the selected window. | ||
| 243 | |||
| 244 | @vindex same-window-buffer-names | ||
| 245 | If you add a buffer name to the list @code{same-window-buffer-names}, | ||
| 246 | the effect is that such commands display that particular buffer by | ||
| 247 | switching to it in the selected window. For example, if you add the | ||
| 248 | element @code{"*grep*"} to the list, the @code{grep} command will | ||
| 249 | display its output buffer in the selected window. | ||
| 250 | |||
| 251 | The default value of @code{same-window-buffer-names} is not | ||
| 252 | @code{nil}: it specifies buffer names @samp{*info*}, @samp{*mail*} and | ||
| 253 | @samp{*shell*} (as well as others used by more obscure Emacs packages). | ||
| 254 | This is why @kbd{M-x shell} normally switches to the @samp{*shell*} | ||
| 255 | buffer in the selected window. If you delete this element from the | ||
| 256 | value of @code{same-window-buffer-names}, the behavior of @kbd{M-x | ||
| 257 | shell} will change---it will pop up the buffer in another window | ||
| 258 | instead. | ||
| 259 | |||
| 260 | @vindex same-window-regexps | ||
| 261 | You can specify these buffers more generally with the variable | ||
| 262 | @code{same-window-regexps}. Set it to a list of regular expressions; | ||
| 263 | then any buffer whose name matches one of those regular expressions is | ||
| 264 | displayed by switching to it in the selected window. (Once again, this | ||
| 265 | applies only to buffers that normally get displayed for you in a | ||
| 266 | separate window.) The default value of this variable specifies Telnet | ||
| 267 | and rlogin buffers. | ||
| 268 | |||
| 269 | An analogous feature lets you specify buffers which should be | ||
| 270 | displayed in their own individual frames. @xref{Special Buffer Frames}. | ||
| 271 | |||
| 272 | @node Change Window | 234 | @node Change Window |
| 273 | @section Deleting and Rearranging Windows | 235 | @section Deleting and Rearranging Windows |
| 274 | 236 | ||
| @@ -356,6 +318,113 @@ heights of all the windows in the selected frame. | |||
| 356 | Mouse clicks on the mode line provide another way to change window | 318 | Mouse clicks on the mode line provide another way to change window |
| 357 | heights and to delete windows. @xref{Mode Line Mouse}. | 319 | heights and to delete windows. @xref{Mode Line Mouse}. |
| 358 | 320 | ||
| 321 | @node Displaying Buffers | ||
| 322 | @section Displaying a Buffer in a Window | ||
| 323 | |||
| 324 | It is a common Emacs operation to display or ``pop up'' some buffer | ||
| 325 | in response to a user command. There are several different ways by | ||
| 326 | which commands do this. | ||
| 327 | |||
| 328 | Many commands, like @kbd{C-x C-f} (@code{find-file}), display the | ||
| 329 | buffer by ``taking over'' the selected window, expecting that the | ||
| 330 | user's attention will be diverted to that buffer. These commands | ||
| 331 | usually work by calling @code{switch-to-buffer} internally | ||
| 332 | (@pxref{Select Buffer}). | ||
| 333 | |||
| 334 | @findex display-buffer | ||
| 335 | Some commands try to display ``intelligently'', trying not to take | ||
| 336 | over the selected window, e.g. by splitting the selected window and | ||
| 337 | displaying the desired buffer in the child window. Such commands, | ||
| 338 | which include the various help commands (@pxref{Help}), work by | ||
| 339 | calling @code{display-buffer} internally. @xref{Window Choice}, for | ||
| 340 | details. | ||
| 341 | |||
| 342 | Other commands do the same as @code{display-buffer}, and | ||
| 343 | additionally select the displaying window so that you can begin | ||
| 344 | editing its buffer. The command @kbd{C-x `} (@code{next-error}) is | ||
| 345 | one example (@pxref{Compilation Mode}). Such commands work by calling | ||
| 346 | @code{pop-to-buffer} internally. @xref{Displaying Buffers,,Displaying | ||
| 347 | Buffers in Windows, elisp, The Emacs Lisp Reference Manual}. | ||
| 348 | |||
| 349 | Commands with names ending in @code{-other-window} behave like | ||
| 350 | @code{display-buffer}, except that they never display in the selected | ||
| 351 | window. Several of these commands are bound in the @kbd{C-x 4} prefix | ||
| 352 | key (@pxref{Pop Up Window}). | ||
| 353 | |||
| 354 | Commands with names ending in @code{-other-frame} behave like | ||
| 355 | @code{display-buffer}, except that they (i) never display in the | ||
| 356 | selected window and (ii) prefer to create a new frame to display the | ||
| 357 | desired buffer instead of splitting a window---as though the variable | ||
| 358 | @code{pop-up-frames} is set to @code{t} (@pxref{Window Choice}). | ||
| 359 | Several of these commands are bound in the @kbd{C-x 5} prefix key. | ||
| 360 | |||
| 361 | @menu | ||
| 362 | * Window Choice:: How @code{display-buffer} works. | ||
| 363 | @end menu | ||
| 364 | |||
| 365 | @node Window Choice | ||
| 366 | @subsection How @code{display-buffer} works | ||
| 367 | @findex display-buffer | ||
| 368 | |||
| 369 | The @code{display-buffer} command (as well as commands that call it | ||
| 370 | internally) chooses a window to display using the following steps: | ||
| 371 | |||
| 372 | @itemize | ||
| 373 | @vindex same-window-buffer-names | ||
| 374 | @vindex same-window-regexps | ||
| 375 | @item | ||
| 376 | First, check if the buffer should be displayed in the selected window | ||
| 377 | regardless of other considerations. You can tell Emacs to do this by | ||
| 378 | adding the desired buffer's name to the list | ||
| 379 | @code{same-window-buffer-names}, or adding a matching regular | ||
| 380 | expression to the list @code{same-window-regexps}. By default, these | ||
| 381 | variables are @code{nil}, so this step is skipped. | ||
| 382 | |||
| 383 | @vindex display-buffer-reuse-frames | ||
| 384 | @item | ||
| 385 | Otherwise, if the buffer is already displayed in an existing window, | ||
| 386 | ``reuse'' that window. Normally, only windows on the selected frame | ||
| 387 | are considered, but windows on other frames are also reusable if you | ||
| 388 | change @code{display-buffer-reuse-frames} to @code{t}, or if you | ||
| 389 | change @code{pop-up-frames} (see below) to @code{t}. | ||
| 390 | |||
| 391 | @item | ||
| 392 | Otherwise, if you specified that the buffer should be displayed in a | ||
| 393 | special frame by customizing @code{special-display-buffer-names} or | ||
| 394 | @code{special-display-regexps}, do so. @xref{Special Buffer Frames}. | ||
| 395 | |||
| 396 | @vindex pop-up-frames | ||
| 397 | @item | ||
| 398 | Otherwise, optionally create a new frame and display the buffer there. | ||
| 399 | By default, this step is skipped. To enable it, change the variable | ||
| 400 | @code{pop-up-frames} to a non-@code{nil} value. The special value | ||
| 401 | @code{graphic-only} means to do this only on graphical displays. | ||
| 402 | |||
| 403 | @item | ||
| 404 | Otherwise, try to create a new window by splitting the selected | ||
| 405 | window, and display the buffer in that new window. | ||
| 406 | |||
| 407 | @vindex split-height-threshold | ||
| 408 | @vindex split-width-threshold | ||
| 409 | The split can be either vertical or horizontal, depending on the | ||
| 410 | variables @code{split-height-threshold} and | ||
| 411 | @code{split-width-threshold}. These variables should have integer | ||
| 412 | values. If @code{split-height-threshold} is smaller than the selected | ||
| 413 | window's height, the split puts the new window below. Otherwise, if | ||
| 414 | @code{split-width-threshold} is smaller than the window's width, the | ||
| 415 | split puts the new window on the right. If neither condition holds, | ||
| 416 | Emacs tries to split so that the new window is below---but only if the | ||
| 417 | window was not split before (to avoid excessive splitting). | ||
| 418 | |||
| 419 | @item | ||
| 420 | Otherwise, display the buffer in an existing window on the selected | ||
| 421 | frame. | ||
| 422 | |||
| 423 | @item | ||
| 424 | If all the above methods fail for whatever reason, create a new frame | ||
| 425 | and display the buffer there. | ||
| 426 | @end itemize | ||
| 427 | |||
| 359 | @node Window Convenience | 428 | @node Window Convenience |
| 360 | @section Window Handling Convenience Features and Customization | 429 | @section Window Handling Convenience Features and Customization |
| 361 | 430 | ||
| @@ -386,6 +386,45 @@ by default. | |||
| 386 | *** `menu-bar-select-buffer-function' lets you choose another operation | 386 | *** `menu-bar-select-buffer-function' lets you choose another operation |
| 387 | instead of `switch-to-buffer' when selecting an item in the Buffers menu. | 387 | instead of `switch-to-buffer' when selecting an item in the Buffers menu. |
| 388 | 388 | ||
| 389 | ** Window changes | ||
| 390 | |||
| 391 | +++ | ||
| 392 | *** Resizing an Emacs frame now preserves proportional window sizes, | ||
| 393 | modulo restrictions like window minimum sizes and fixed-size windows. | ||
| 394 | |||
| 395 | *** The behavior of `display-buffer' is now customizable in detail. | ||
| 396 | |||
| 397 | **** New option `display-buffer-base-action' specifies a list of | ||
| 398 | user-determined display "actions" (functions and optional arguments | ||
| 399 | for choosing the displaying window). | ||
| 400 | |||
| 401 | This takes precedence over the default display action, which is | ||
| 402 | specified by `display-buffer-fallback-action'. | ||
| 403 | |||
| 404 | **** New option `display-buffer-alist' maps buffer name regexps to | ||
| 405 | display actions, taking precedence over `display-buffer-base-action'. | ||
| 406 | |||
| 407 | +++ | ||
| 408 | *** New option `window-nest'. | ||
| 409 | The new option `window-nest' allows to return the space obtained for | ||
| 410 | resizing or creating a window more reliably to the window from which | ||
| 411 | such space was obtained. | ||
| 412 | |||
| 413 | +++ | ||
| 414 | *** New option `window-splits'. | ||
| 415 | The new option `window-splits' allows to split a window that otherwise | ||
| 416 | cannot be split because it's too small by stealing space from other | ||
| 417 | windows in the same combination. | ||
| 418 | |||
| 419 | +++ | ||
| 420 | *** New commands `maximize-window' and `minimize-window'. | ||
| 421 | These maximize and minize the size of a window within its frame. | ||
| 422 | |||
| 423 | +++ | ||
| 424 | *** New commands `switch-to-prev-buffer' and `switch-to-next-buffer'. | ||
| 425 | These functions allow to navigate through the live buffers that have | ||
| 426 | been shown in a specific window. | ||
| 427 | |||
| 389 | ** The inactive minibuffer has its own major mode `minibuffer-inactive-mode'. | 428 | ** The inactive minibuffer has its own major mode `minibuffer-inactive-mode'. |
| 390 | This is handy for minibuffer-only frames, and is also used for the "mouse-1 | 429 | This is handy for minibuffer-only frames, and is also used for the "mouse-1 |
| 391 | pops up *Messages*" feature, which can now easily be changed. | 430 | pops up *Messages*" feature, which can now easily be changed. |
| @@ -1003,18 +1042,6 @@ split. Any other value of SIDE will cause `split-window' to split the | |||
| 1003 | window into two side-by-side windows as before. | 1042 | window into two side-by-side windows as before. |
| 1004 | 1043 | ||
| 1005 | +++ | 1044 | +++ |
| 1006 | *** New option `window-nest'. | ||
| 1007 | The new option `window-nest' allows to return the space obtained for | ||
| 1008 | resizing or creating a window more reliably to the window from which | ||
| 1009 | such space was obtained. | ||
| 1010 | |||
| 1011 | +++ | ||
| 1012 | *** New option `window-splits'. | ||
| 1013 | The new option `window-splits' allows to split a window that otherwise | ||
| 1014 | cannot be split because it's too small by stealing space from other | ||
| 1015 | windows in the same combination. | ||
| 1016 | |||
| 1017 | +++ | ||
| 1018 | *** `split-window-above-each-other' and `split-window-side-by-side'. | 1045 | *** `split-window-above-each-other' and `split-window-side-by-side'. |
| 1019 | The commands `split-window-vertically' and `split-window-horizontally' | 1046 | The commands `split-window-vertically' and `split-window-horizontally' |
| 1020 | have been renamed to `split-window-above-each-other' and | 1047 | have been renamed to `split-window-above-each-other' and |
| @@ -1028,12 +1055,6 @@ been introduced. This and all other functions for resizing windows no | |||
| 1028 | longer delete any windows when they become too small. | 1055 | longer delete any windows when they become too small. |
| 1029 | 1056 | ||
| 1030 | +++ | 1057 | +++ |
| 1031 | *** Frame/window resizing. | ||
| 1032 | Resizing an Emacs frame now preserves the proportional sizes of | ||
| 1033 | subwindows modulo restrictions imposed by window minimum sizes and | ||
| 1034 | fixed-size windows. | ||
| 1035 | |||
| 1036 | +++ | ||
| 1037 | *** `adjust-window-trailing-edge' adjustments. | 1058 | *** `adjust-window-trailing-edge' adjustments. |
| 1038 | `adjust-window-trailing-edge' can now deal with fixed-size windows and | 1059 | `adjust-window-trailing-edge' can now deal with fixed-size windows and |
| 1039 | is able to resize other windows if a window adjacent to the trailing | 1060 | is able to resize other windows if a window adjacent to the trailing |
| @@ -1042,11 +1063,6 @@ that of Emacs 21 without compromising, however, its inability to delete | |||
| 1042 | windows which was introduced in Emacs 22. | 1063 | windows which was introduced in Emacs 22. |
| 1043 | 1064 | ||
| 1044 | +++ | 1065 | +++ |
| 1045 | *** Commands for maximizing and minimizing windows. | ||
| 1046 | New functions to maximize and minimize a window within its frame are | ||
| 1047 | provided, namely `maximize-window' and `minimize-window'. | ||
| 1048 | |||
| 1049 | +++ | ||
| 1050 | *** Window-local buffer lists. | 1066 | *** Window-local buffer lists. |
| 1051 | Windows now have local buffer lists. This means that removing a buffer | 1067 | Windows now have local buffer lists. This means that removing a buffer |
| 1052 | from display in a window will preferably show the buffer previously | 1068 | from display in a window will preferably show the buffer previously |
| @@ -1054,17 +1070,31 @@ shown in that window with its previous window-start and window-point | |||
| 1054 | positions. This also means that the same buffer may be automatically | 1070 | positions. This also means that the same buffer may be automatically |
| 1055 | shown twice even if it already appears in another window. | 1071 | shown twice even if it already appears in another window. |
| 1056 | 1072 | ||
| 1057 | +++ | ||
| 1058 | *** New commands `switch-to-prev-buffer' and `switch-to-next-buffer'. | ||
| 1059 | These functions allow to navigate through the live buffers that have | ||
| 1060 | been shown in a specific window. | ||
| 1061 | |||
| 1062 | *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, | 1073 | *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, |
| 1063 | which if non-nil requires the buffer to be displayed in the currently | 1074 | which if non-nil requires the buffer to be displayed in the currently |
| 1064 | selected window, signaling an error otherwise. If nil, another window | 1075 | selected window, signaling an error otherwise. If nil, another window |
| 1065 | can be used, e.g. if the selected one is strongly dedicated. | 1076 | can be used, e.g. if the selected one is strongly dedicated. |
| 1066 | 1077 | ||
| 1067 | *** FIXME: buffer-display-alist changes | 1078 | *** `split-window-vertically' and `split-window-horizontally' renamed |
| 1079 | to `split-window-above-each-other' and `split-window-side-by-side' | ||
| 1080 | respectively. The old names are kept as aliases. | ||
| 1081 | |||
| 1082 | *** Display actions | ||
| 1083 | |||
| 1084 | **** The second arg to `display-buffer' and `pop-to-buffer' is now | ||
| 1085 | named ACTION, and takes a display action of the same form as | ||
| 1086 | `display-buffer-base-action' (see Changes, above). A non-nil, | ||
| 1087 | non-list value is treated specially, as the old meaning. | ||
| 1088 | |||
| 1089 | **** New variable `display-buffer-overriding-action'. | ||
| 1090 | |||
| 1091 | **** The procedure of `display-buffer' etc. to choose a window is | ||
| 1092 | determined by combining `display-buffer-overriding-action', | ||
| 1093 | `display-buffer-alist', the ACTION arg, `display-buffer-base-action', | ||
| 1094 | and `display-buffer-fallback-action'. The second and fourth of these | ||
| 1095 | are user-customizable variables. | ||
| 1096 | |||
| 1097 | See the docstring of `display-buffer' for details. | ||
| 1068 | 1098 | ||
| 1069 | ** Completion | 1099 | ** Completion |
| 1070 | 1100 | ||