When you use the command C-x o (
other-window) to select
some other window, it moves through the windows on the screen in a
specific order. For any given configuration of windows, this order
never varies. It is called the cyclic ordering of windows.
For a particular frame, this ordering generally goes from top to bottom, and from left to right. But it may go down first or go right first, depending on the order in which windows were split.
If the first split was vertical (into windows one above each other), and then the subwindows were split horizontally, then the ordering is left to right in the top of the frame, and then left to right in the next lower part of the frame, and so on. If the first split was horizontal, the ordering is top to bottom in the left part, and so on. In general, within each set of siblings at any level in the window tree (see Window Tree), the order is left to right, or top to bottom.
The value of the optional argument minibuf specifies whether the minibuffer is included in the window order. Normally, when minibuf is
nil, the minibuffer is included only if it is currently “active”; this matches the behavior of C-x o. (The minibuffer window is active while the minibuffer is in use; see Minibuffers.)
If minibuf is
t, the cyclic ordering includes the minibuffer window even if it is not active. If minibuf is neither
nil, the minibuffer window is not included even if it is active.
The optional argument all-frames specifies which frames to consider. Here are the possible values and their meanings:
- Consider all the windows in window's frame, plus the minibuffer used by that frame even if it lies in some other frame. If the minibuffer counts (as determined by minibuf), then all windows on all frames that share that minibuffer count too.
- Consider all windows in all existing frames.
- Consider all windows in all visible frames. (To get useful results, you must ensure window is in a visible frame.)
- Consider all windows in all visible or iconified frames.
- a frame
- Consider all windows on that frame.
- anything else
- Consider precisely the windows in window's frame, and no others.
This example assumes there are two windows, both displaying the buffer ‘windows.texi’:(selected-window) ⇒ #<window 56 on windows.texi> (next-window (selected-window)) ⇒ #<window 52 on windows.texi> (next-window (next-window (selected-window))) ⇒ #<window 56 on windows.texi>
This function returns the window preceding window in the cyclic ordering of windows. The other arguments specify which windows to include in the cycle, as in
This function selects another window in the cyclic ordering of windows. count specifies the number of windows to skip in the ordering, starting with the selected window, before making the selection. If count is a positive number, it skips count windows forwards. count negative means skip −count windows backwards. If count is zero, it does not skip any window, thus re-selecting the selected window. In an interactive call, count is the numeric prefix argument.
The optional argument all-frames has the same meaning as in
next-window, but the minibuf argument of
next-windowis always effectively
nil. This function returns
This function cycles through all windows. It calls the function
proconce for each window, with the window as its sole argument.
The optional arguments minibuf and all-frames specify the set of windows to include in the walk. See
next-window, above, for details.
This function returns a list of all windows on frame, starting with window. The default for frame is the selected frame; the default for window is the selected window.
The value of minibuf specifies if the minibuffer window shall be included in the result list. If minibuf is
t, the result always includes the minibuffer window. If minibuf is
nilor omitted, that includes the minibuffer window if it is active. If minibuf is neither
t, the result never includes the minibuffer window.