[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20. Multiple Windows

Af can split the screen into two or many windows. Multiple windows can display parts of different buffers, or different parts of one buffer.

20.1 Concepts of Af Windows  Introduction to af windows.
20.2 Creating and Using Windows  How to create and use windows.
20.3 Deleting and Rearranging Windows  Deleting windows and changing their sizes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.1 Concepts of Af Windows

Each Af window displays one Af buffer at any time. A single buffer may appear in more than one window; if it does, any changes in its text are displayed in all the windows where it appears. But the windows showing the same buffer can show different parts of it, because each window has its own value of point.

At any time, one of the windows is the selected window; the buffer this window is displaying is the current buffer. The arrow cursor shows the location of point in this window, but is not visible in any other window.

Commands to move point affect the value of point for the selected af window only. They do not change the value of point in any other af window, even one showing the same buffer. The same is true for commands such as C-x b to change the selected buffer in the selected window; they do not affect other windows at all. However, there are other commands such as C-x 4 b that select a different window and switch buffers in it.

When multiple windows show the same buffer, they can have different regions, because they can have different values of point and mark.

Each window has its own mode line, which displays the buffer name, modification status, size in messages, and major and minor modes of the buffer that is displayed in the window. See section 2.4 The Mode Line, for full details on the mode line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.2 Creating and Using Windows

C-x 2
Split the current window vertically, creating a new window (split-window-vertically).
C-x o
Select the "other" window (other-window). That is o, not zero.
M-x previous-window RET
Select the previous window.
C-M-v
Scroll the next window (scroll-other-window).

The command C-x 2 (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.

To select a different window, type C-x o (other-window). That is an o, for `other', not a zero. When there are more than two windows, this command moves through all the windows from top to bottom. After the bottommost window, it goes back to the one at the top. A numeric argument means to move several steps in the cyclic order of windows. A negative argument moves around the cycle in the opposite order.

You can also select a different window with M-x previous window. When there are more than two windows, this command moves through all the windows from bottom to top. After the topmost window, it goes back to the one at the bottom. A numeric argument means to move several steps in the cyclic order of windows. A negative argument moves around the cycle in the opposite order.

The usual scrolling commands (see section 5.3 Scrolling) apply to the selected window only, but there is one command to scroll the next window. C-M-v (scroll-other-window) scrolls the window that C-x o would select. It takes arguments, positive and negative, like C-v.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.3 Deleting and Rearranging Windows

C-x 0
Delete the selected window (delete-window). That is a zero.
C-x 1
Delete all windows except the selected window (delete-other-windows).
C-x ^
Make the selected window taller (enlarge-window).
M-x shrink-window
Make the selected window smaller.

To delete a window, type C-x 0 (delete-window). (That is a zero.) The space occupied by the deleted window is given to an adjacent window. Once a window is deleted, its attributes are forgotten; only restoring a window configuration can bring it back. 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 C-x b.

C-x 1 (delete-other-windows) is more powerful than C-x 0; it deletes all the windows except the selected one; the selected window expands to use the whole screen except for the echo area.

To readjust the division of space among vertically adjacent windows, use C-x ^ (enlarge-window). It makes the currently selected window get one line bigger, or as many lines as is specified with a numeric argument. With a negative argument, it makes the selected window smaller. The extra screen space given to a window comes from one of its neighbors. You cannot enlarge the window if it would make a neighbouring window less than two lines tall.

You can also readjust the size of the selected window with M-x shrink-window. It makes the currently selected window get one line smaller, or as many lines as is specified with a numeric argument. With a negative argument, it makes the selected window bigger. The extra screen space released by a window is given to of its neighbors. You cannot shrink the window if it would make the window less than two lines tall.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Malc Arnold on August, 22 2002 using texi2html