]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/windows.texi
Manual updates for window changes.
[gnu-emacs] / doc / emacs / windows.texi
index 600d0b0781838b6eaffa8cebd38d6c250823f043..ad2040c9047d6adeab03fa1a8f7f6a26fd0b5506 100644 (file)
@@ -34,24 +34,22 @@ has its own value of point.
 
 @cindex selected window
   At any time, one Emacs window is the @dfn{selected window}; the
-buffer this window is displaying is the current buffer.  The terminal's
-cursor shows the location of point in this window.  Each other window
-has a location of point as well.  On text-only terminals, there is no
-way to show where those locations are, since the terminal has only one
-cursor.  On a graphical display, the location of point in a
-non-selected window is indicated by a hollow box; the cursor in the
-selected window is blinking or solid.
-
-  Commands to move point affect the value of point for the selected Emacs
-window only.  They do not change the value of point in other Emacs
-windows, even those showing the same buffer.  The same is true for commands
-such as @kbd{C-x b} to switch buffers in the selected window;
-they do not affect other windows at all.  However, there are other commands
-such as @kbd{C-x 4 b} that select a different window and switch buffers in
-it.  Also, all commands that display information in a window, including
+buffer this window is displaying is the current buffer.  Each window
+has its own value of point.  On graphical displays, the point is
+indicated by a solid blinking cursor in the selected window, and by a
+hollow box in non-selected windows.  On text-only terminals, the
+cursor is drawn only in the selected window.  @xref{Cursor Display}.
+
+  Commands to move point affect the value of point for the selected
+Emacs window only.  They do not change the value of point in other
+Emacs windows, even those showing the same buffer.  The same is true
+for buffer-switching commands such as @kbd{C-x b}; they do not affect
+other windows at all.  However, there are other commands such as
+@kbd{C-x 4 b} that select a different window and switch buffers in it.
+Also, all commands that display information in a window, including
 (for example) @kbd{C-h f} (@code{describe-function}) and @kbd{C-x C-b}
-(@code{list-buffers}), work by switching buffers in a nonselected window
-without affecting the selected window.
+(@code{list-buffers}), work by switching buffers in a nonselected
+window without affecting the selected window.
 
   When multiple windows show the same buffer, they can have different
 regions, because they can have different values of point.  However,
@@ -61,7 +59,7 @@ only one mark position.
   Each window has its own mode line, which displays the buffer name,
 modification status and major and minor modes of the buffer that is
 displayed in the window.  The selected window's mode line appears in a
-different color.  @xref{Mode Line}, for full details on the mode line.
+different color.  @xref{Mode Line}, for details.
 
 @node Split Window
 @section Splitting Windows
@@ -69,91 +67,87 @@ different color.  @xref{Mode Line}, for full details on the mode line.
 @table @kbd
 @item C-x 2
 Split the selected window into two windows, one above the other
-(@code{split-window-vertically}).
+(@code{split-window-below}).
 @item C-x 3
-Split the selected window into two windows positioned side by side
-(@code{split-window-horizontally}).
+Split the selected window into two windows, positioned side by side
+(@code{split-window-right}).
 @item C-Mouse-2
 In the mode line or scroll bar of a window, split that window.
 @end table
 
 @kindex C-x 2
-@findex split-window-vertically
-  The command @kbd{C-x 2} (@code{split-window-vertically}) breaks the
-selected window into two windows, one above the other.  Both windows start
-out displaying the same buffer, with the same value of point.  By default
-the two windows each get half the height of the window that was split; a
-numeric argument specifies how many lines to give to the top window.
+@findex split-window-below
+  @kbd{C-x 2} (@code{split-window-below}) splits the selected window
+into two windows, one above the other.  After splitting, the selected
+window is the upper one, and the newly split-off window is below.
+Both windows have the same value of point as before, and display the
+same portion of the buffer (or as close to it as possible).  If
+necessary, the windows are scrolled to keep point on-screen.  By
+default, the two windows each get half the height of the original
+window.  A positive numeric argument specifies how many lines to give
+to the top window; a negative numeric argument specifies how many
+lines to give to the bottom window.
 
-@kindex C-x 3
-@findex split-window-horizontally
-  @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected
-window into two side-by-side windows.  A numeric argument specifies how
-many columns to give the one on the left.  If you are not using
-scrollbars, a vertical line separates the two windows.
-You can customize its color with the face @code{vertical-border}.
-Windows that are not the full width of the screen have mode lines, but
-they are truncated.  On terminals where Emacs does not support
-highlighting, truncated mode lines sometimes do not appear in inverse
-video.
+@vindex split-window-keep-point
+  If you change the variable @code{split-window-keep-point} to
+@code{nil}, @kbd{C-x 2} instead adjusts the portion of the buffer
+displayed by the two windows, as well as the value of point in each
+window, in order to keep the text on the screen as close as possible
+to what it was before; furthermore, if point was in the lower half of
+the original window, the bottom window is selected instead of the
+upper one.
 
-@kindex C-Mouse-2 @r{(scroll bar)}
-  You can split a window horizontally or vertically by clicking
-@kbd{C-Mouse-2} in the mode line or the scroll bar.  The line of
-splitting goes through the place where you click: if you click on the
-mode line, the new scroll bar goes above the spot; if you click in the
-scroll bar, the mode line of the split window is side by side with
-your click.
+@kindex C-x 3
+@findex split-window-right
+  @kbd{C-x 3} (@code{split-window-right}) splits the selected window
+into two side-by-side windows.  The left window is the selected one;
+the right window displays the same portion of the same buffer, and has
+the same value of point.  A positive numeric argument specifies how
+many columns to give the left window; a negative numeric argument
+specifies how many columns to give the right window.
 
 @vindex truncate-partial-width-windows
-  When a window occupies less than the full width of the frame, it may
-become too narrow for most of the text lines in its buffer.  If most of
-its lines are continued (@pxref{Continuation Lines}), the buffer may
-become difficult to read.  Therefore, Emacs automatically truncates
-lines if the window width becomes narrower than 50 columns.  This
-truncation occurs regardless of the value of the variable
-@code{truncate-lines} (@pxref{Line Truncation}); it is instead
-controlled by the variable @code{truncate-partial-width-windows}.  If
-the value of @code{truncate-partial-width-windows} is a positive integer
-(the default is 50), that specifies the minimum width for a
-partial-width window before automatic line truncation occurs; if the
-value is @code{nil}, automatic line truncation is disabled; and for any
-other non-@code{nil} value, Emacs truncates lines in every partial-width
-window regardless of its width.
-
-  Horizontal scrolling is often used in side-by-side windows.
-@xref{Horizontal Scrolling}.
+  When you split a window with @kbd{C-x 3}, each resulting window
+occupies less than the full width of the frame.  If it becomes too
+narrow, the buffer may be difficult to read if continuation lines are
+in use (@pxref{Continuation Lines}).  Therefore, Emacs automatically
+switches to line truncation if the window width becomes narrower than
+50 columns.  This truncation occurs regardless of the value of the
+variable @code{truncate-lines} (@pxref{Line Truncation}); it is
+instead controlled by the variable
+@code{truncate-partial-width-windows}.  If the value of this variable
+is a positive integer (the default is 50), that specifies the minimum
+width for a partial-width window before automatic line truncation
+occurs; if the value is @code{nil}, automatic line truncation is
+disabled; and for any other non-@code{nil} value, Emacs truncates
+lines in every partial-width window regardless of its width.
+
+  On text terminals, side-by-side windows are separated by a vertical
+divider which is drawn using the @code{vertical-border} face.
 
-@vindex split-window-keep-point
-  If @code{split-window-keep-point} is non-@code{nil}, the default,
-both of the windows resulting from @kbd{C-x 2} inherit the value of
-point from the window that was split.  This means that scrolling is
-inevitable.  If this variable is @code{nil}, then @kbd{C-x 2} tries to
-avoid scrolling the text currently visible on the screen, by putting
-point in each window at a position already visible in the window.  It
-also selects whichever window contains the screen line that the cursor
-was previously on.  Some users prefer that mode on slow terminals.
+@kindex C-Mouse-2 @r{(scroll bar)}
+  You can also split a window horizontally or vertically by clicking
+@kbd{C-Mouse-2} in the mode line or the scroll bar.  If you click on
+the mode line, that puts the vertical divider where you click; if you
+click in the scroll bar, that puts the new mode-line where you click.
 
 @node Other Window
 @section Using Other Windows
 
 @table @kbd
 @item C-x o
-Select another window (@code{other-window}).  That is @kbd{o}, not zero.
+Select another window (@code{other-window}).
 @item C-M-v
 Scroll the next window (@code{scroll-other-window}).
-@item M-x compare-windows
-Find next place where the text in the selected window does not match
-the text in the next window.
 @item Mouse-1
-@kbd{Mouse-1}, in a window's mode line, selects that window
-but does not move point in it (@code{mouse-select-window}).
+@kbd{Mouse-1}, in the text area of a window, selects the window and
+moves point to the position clicked.  Clicking in the mode line
+selects the window without moving point in it.
 @end table
 
 @kindex C-x o
 @findex other-window
-  To select a different window, click with @kbd{Mouse-1} on its mode
-line.  With the keyboard, you can switch windows by typing @kbd{C-x o}
+With the keyboard, you can switch windows by typing @kbd{C-x o}
 (@code{other-window}).  That is an @kbd{o}, for ``other,'' not a zero.
 When there are more than two windows, this command moves through all the
 windows in a cyclic order, generally top to bottom and left to right.
@@ -172,17 +166,13 @@ finish supplying the minibuffer argument that is requested.
 window only, but there is one command to scroll the next window.
 @kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that
 @kbd{C-x o} would select.  It takes arguments, positive and negative,
-like @kbd{C-v}.  (In the minibuffer, @kbd{C-M-v} scrolls the window
-that contains the minibuffer help display, if any, rather than the
-next window in the standard cyclic order.)
-
-  The command @kbd{M-x compare-windows} lets you compare two files or
-buffers visible in two windows, by moving through them to the next
-mismatch.  @xref{Comparing Files}, for details.
+like @kbd{C-v}.  (In the minibuffer, @kbd{C-M-v} scrolls the help
+window associated with the minibuffer, if any, rather than the next
+window in the standard cyclic order; @pxref{Minibuffer Edit}.)
 
 @vindex mouse-autoselect-window
   If you set @code{mouse-autoselect-window} to a non-@code{nil} value,
-moving the mouse into a different window selects that window.  This
+moving the mouse over a different window selects that window.  This
 feature is off by default.
 
 @node Pop Up Window
@@ -236,8 +226,7 @@ window (@code{find-file-read-only-other-window}).  @xref{Visiting}.
 
 @table @kbd
 @item C-x 0
-Delete the selected window (@code{delete-window}).  The last character
-in this key sequence is a zero.
+Delete the selected window (@code{delete-window}).
 @item C-x 1
 Delete all windows in the selected frame except the selected window
 (@code{delete-other-windows}).
@@ -260,14 +249,12 @@ Make all windows the same height (@code{balance-windows}).
 
 @kindex C-x 0
 @findex delete-window
-  To delete a window, type @kbd{C-x 0} (@code{delete-window}).  (That is
-a zero.)  The space occupied by the deleted window is given to an
-adjacent window (but not the minibuffer window, even if that is active
-at the time).  Once a window is deleted, its attributes are forgotten;
-only restoring a window configuration can bring it back.  Deleting the
+  To delete the selected window, type @kbd{C-x 0}
+(@code{delete-window}).  (That is a zero.)  Once a window is deleted,
+the space that it occupied is given to an adjacent window (but not the
+minibuffer window, even if that is active at the time).  Deleting the
 window has no effect on the buffer it used to display; the buffer
-continues to exist, and you can select it in any window with @kbd{C-x
-b}.
+continues to exist, and you can still switch to with @kbd{C-x b}.
 
 @findex kill-buffer-and-window
 @kindex C-x 4 0
@@ -277,31 +264,35 @@ selected window.
 
 @kindex C-x 1
 @findex delete-other-windows
-  @kbd{C-x 1} (@code{delete-other-windows}) is more powerful in a
-different way; it deletes all the windows except the selected one (and
-the minibuffer); the selected window expands to use the whole frame
-except for the echo area.
+  @kbd{C-x 1} (@code{delete-other-windows}) deletes all the windows,
+@emph{except} the selected one; the selected window expands to use the
+whole frame.  (This command cannot be used while the minibuffer window
+is active; attempting to do so signals an error.)
 
 @kindex C-x ^
 @findex enlarge-window
 @kindex C-x @}
-@findex enlarge-window-horizontally
 @vindex window-min-height
+  The command @kbd{C-x ^} (@code{enlarge-window}) makes the selected
+window one line taller, taking space from a vertically adjacent window
+without changing the height of the frame.  With a positive numeric
+argument, this command increases the window height by that many lines;
+with a negative argument, it reduces the height by that many lines.
+If there are no vertically adjacent windows (i.e. the window is at the
+full frame height), that signals an error.  The command also signals
+an error if you attempt to reduce the height of any window below a
+certain minimum number of lines, specified by the variable
+@code{window-min-height} (the default is 4).
+
+@findex enlarge-window-horizontally
+@findex shrink-window-horizontally
 @vindex window-min-width
-  To readjust the division of space among vertically adjacent windows,
-use @kbd{C-x ^} (@code{enlarge-window}).  It makes the currently
-selected window one line bigger, or as many lines as is specified
-with a numeric argument.  With a negative argument, it makes the
-selected window smaller.  @kbd{C-x @}}
-(@code{enlarge-window-horizontally}) makes the selected window wider by
-the specified number of columns.  @kbd{C-x @{}
-(@code{shrink-window-horizontally}) makes the selected window narrower
-by the specified number of columns.
-
-  When you make a window bigger, the space comes from its peers.  If
-this makes any window too small, it is deleted and its space is given
-to an adjacent window.  The minimum size is specified by the variables
-@code{window-min-height} and @code{window-min-width}.
+  Similarly, @kbd{C-x @}} (@code{enlarge-window-horizontally}) makes
+the selected window wider, and @kbd{C-x @{}
+(@code{shrink-window-horizontally}) makes it narrower.  These commands
+signal an error if you attempt to reduce the width of any window below
+a certain minimum number of columns, specified by the variable
+@code{window-min-width} (the default is 10).
 
 @kindex C-x -
 @findex shrink-window-if-larger-than-buffer
@@ -322,7 +313,7 @@ heights and to delete windows.  @xref{Mode Line Mouse}.
 @section Displaying a Buffer in a Window
 
   It is a common Emacs operation to display or ``pop up'' some buffer
-in response to a user command.  There are several different ways by
+in response to a user command.  There are several different ways in
 which commands do this.
 
   Many commands, like @kbd{C-x C-f} (@code{find-file}), display the
@@ -333,18 +324,18 @@ usually work by calling @code{switch-to-buffer} internally
 
 @findex display-buffer
   Some commands try to display ``intelligently'', trying not to take
-over the selected window, e.g. by splitting the selected window and
-displaying the desired buffer in the child window.  Such commands,
-which include the various help commands (@pxref{Help}), work by
-calling @code{display-buffer} internally.  @xref{Window Choice}, for
-details.
+over the selected window, e.g. by splitting off a new window and
+displaying the desired buffer there.  Such commands, which include the
+various help commands (@pxref{Help}), work by calling
+@code{display-buffer} internally.  @xref{Window Choice}, for details.
 
   Other commands do the same as @code{display-buffer}, and
 additionally select the displaying window so that you can begin
 editing its buffer.  The command @kbd{C-x `} (@code{next-error}) is
 one example (@pxref{Compilation Mode}).  Such commands work by calling
-@code{pop-to-buffer} internally.  @xref{Switching Buffers,,Switching
-to a Buffer in a Window, elisp, The Emacs Lisp Reference Manual}.
+the function @code{pop-to-buffer} internally.  @xref{Switching
+Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp
+Reference Manual}.
 
   Commands with names ending in @code{-other-window} behave like
 @code{display-buffer}, except that they never display in the selected
@@ -367,7 +358,10 @@ Several of these commands are bound in the @kbd{C-x 5} prefix key.
 @findex display-buffer
 
 The @code{display-buffer} command (as well as commands that call it
-internally) chooses a window to display using the following steps:
+internally) chooses a window to display by following the steps given
+below.  @xref{Choosing Window,,Choosing a Window for Display, elisp,
+The Emacs Lisp Reference Manual}, for details about how to alter this
+sequence of steps.
 
 @itemize
 @vindex same-window-buffer-names
@@ -433,36 +427,38 @@ and display the buffer there.
 @cindex mode, Winner
 @cindex undoing window configuration changes
 @cindex window configuration changes, undoing
-  @kbd{M-x winner-mode} is a global minor mode that records the
-changes in the window configuration (i.e. how the frames are
-partitioned into windows), so that you can ``undo'' them.  To undo,
-use @kbd{C-c left} (@code{winner-undo}).  If you change your mind
-while undoing, you can redo the changes you had undone using @kbd{C-c
-right} (@code{M-x winner-redo}).  Another way to enable Winner mode is
-by customizing the variable @code{winner-mode}.
+  Winner mode is a global minor mode that records the changes in the
+window configuration (i.e. how the frames are partitioned into
+windows), so that you can ``undo'' them.  You can toggle Winner mode
+with @kbd{M-x winner-mode}, or by customizing the variable
+@code{winner-mode}.  When the mode is enabled, @kbd{C-c left}
+(@code{winner-undo}) undoes the last window configuration change.  If
+you change your mind while undoing, you can redo the changes you had
+undone using @kbd{C-c right} (@code{M-x winner-redo}).
+
+  Follow mode (@kbd{M-x follow-mode}) synchronizes several windows on
+the same buffer so that they always display adjacent sections of that
+buffer.  @xref{Follow Mode}.
 
 @cindex Windmove package
 @cindex directional window selection
 @findex windmove-right
 @findex windmove-default-keybindings
-  The Windmove commands move directionally between neighboring windows in
-a frame.  @kbd{M-x windmove-right} selects the window immediately to the
-right of the currently selected one, and similarly for the ``left,'' ``up,''
-and ``down'' counterparts.  @kbd{M-x windmove-default-keybindings} binds
-these commands to @kbd{S-right} etc.  (Not all terminals support shifted
-arrow keys, however.)
+  The Windmove package defines commands for moving directionally
+between neighboring windows in a frame.  @kbd{M-x windmove-right}
+selects the window immediately to the right of the currently selected
+one, and similarly for the ``left,'' ``up,'' and ``down''
+counterparts.  @kbd{M-x windmove-default-keybindings} binds these
+commands to @kbd{S-right} etc.; doing so disables shift selection for
+those keys (@pxref{Shift Selection}).
 
-  Follow minor mode (@kbd{M-x follow-mode}) synchronizes several
-windows on the same buffer so that they always display adjacent
-sections of that buffer.  @xref{Follow Mode}.
+  The command @kbd{M-x compare-windows} lets you compare the text
+shown in different windows.  @xref{Comparing Files}.
 
 @vindex scroll-all-mode
 @cindex scrolling windows together
 @cindex Scroll-all mode
 @cindex mode, Scroll-all
-  @kbd{M-x scroll-all-mode} provides commands to scroll all visible
-windows together.  You can also turn it on by customizing the variable
-@code{scroll-all-mode}.  The commands provided are @kbd{M-x
-scroll-all-scroll-down-all}, @kbd{M-x scroll-all-page-down-all} and
-their corresponding ``up'' equivalents.  To make this mode useful,
-you should bind these commands to appropriate keys.
+  Scroll All mode (@kbd{M-x scroll-all-mode}) is a global minor mode
+that causes scrolling commands and point motion commands to apply to
+every single window.