When a window is selected, the buffer in the window becomes the current buffer, and the cursor will appear in it.
This function returns the selected window. This is the window in which the cursor appears and to which many commands apply.
This function makes window the selected window. The cursor then appears in window (after redisplay). Unless window was already selected,
select-windowmakes window's buffer the current buffer. The return value is window.
Normally, window's selected buffer is moved to the front of the buffer list (see The Buffer List) and window becomes the most recently selected window. But if norecord is non-
nil, the buffer list remains unchanged and window does not become the most recently selected one.(setq w (next-window)) (select-window w) ⇒ #<window 65 on windows.texi>
This macro records the selected frame, as well as the selected window of each frame, executes forms in sequence, then restores the earlier selected frame and windows. It also saves and restores the current buffer. It returns the value of the last form in forms.
This macro does not save or restore anything about the sizes, arrangement or contents of windows; therefore, if forms change them, the change persists. If the previously selected window of some frame is no longer live at the time of exit from forms, that frame's selected window is left alone. If the previously selected window is no longer live, then whatever window is selected at the end of forms remains selected. The current buffer is restored if and only if it is still live when exiting forms.
This macro changes neither the ordering of recently selected windows nor the buffer list.
This macro selects window, executes forms in sequence, then restores the previously selected window and current buffer. The ordering of recently selected windows and the buffer list remain unchanged unless you deliberately change them within forms, for example, by calling
select-windowwith argument norecord
The following functions choose one of the windows on the screen, offering various criteria for the choice.
This function returns the window least recently “used” (that is, selected) among a set of candidate windows. If any full-width windows are present, it only considers these.
The selected window is returned if it is the only candidate. A minibuffer window is never a candidate. A dedicated window (see Dedicated Windows) is never a candidate unless the optional argument dedicated is non-
The optional argument frame specifies which windows are considered.
- If it is
nil, consider windows on the selected frame.
- If it is
t, consider windows on all frames.
- If it is
visible, consider windows on all visible frames.
- If it is 0, consider windows on all visible or iconified frames.
- If it is a frame, consider windows on that frame.
This function returns the window with the largest area (height times width). If there are no side-by-side windows, then this is the window with the most lines. A minibuffer window is never a candidate. A dedicated window (see Dedicated Windows) is never a candidate unless the optional argument dedicated is non-
If there are two candidate windows of the same size, this function prefers the one that comes first in the cyclic ordering of windows, starting from the selected window (see Cyclic Window Ordering).
The optional argument frame specifies which set of windows to consider, see
This function returns a window satisfying predicate. It cycles through all visible windows using
walk-windows(see Cyclic Window Ordering), calling predicate on each one of them with that window as its argument. The function returns the first window for which predicate returns a non-
nilvalue; if that never happens, it returns default (which defaults to
The optional arguments minibuf and all-frames specify the set of windows to include in the scan. See the description of
next-windowin Cyclic Window Ordering, for details.