summaryrefslogtreecommitdiff
path: root/devdocs/elisp/cyclic-window-ordering.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/cyclic-window-ordering.html
new repository
Diffstat (limited to 'devdocs/elisp/cyclic-window-ordering.html')
-rw-r--r--devdocs/elisp/cyclic-window-ordering.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/devdocs/elisp/cyclic-window-ordering.html b/devdocs/elisp/cyclic-window-ordering.html
new file mode 100644
index 00000000..97815ff0
--- /dev/null
+++ b/devdocs/elisp/cyclic-window-ordering.html
@@ -0,0 +1,44 @@
+ <h3 class="section">Cyclic Ordering of Windows</h3> <p>When you use the command <kbd><span class="nolinebreak">C-x</span> o</kbd> (<code>other-window</code>) to select some other window, it moves through live windows in a specific order. For any given configuration of windows, this order never varies. It is called the <em>cyclic ordering of windows</em>. </p> <p>The ordering is determined by a depth-first traversal of each frame’s window tree, retrieving the live windows which are the leaf nodes of the tree (see <a href="windows-and-frames">Windows and Frames</a>). If the minibuffer is active, the minibuffer window is included too. The ordering is cyclic, so the last window in the sequence is followed by the first one. </p> <dl> <dt id="next-window">Function: <strong>next-window</strong> <em>&amp;optional window minibuf all-frames</em>
+</dt> <dd>
+ <p>This function returns a live window, the one following <var>window</var> in the cyclic ordering of windows. <var>window</var> should be a live window; if omitted or <code>nil</code>, it defaults to the selected window. </p> <p>The optional argument <var>minibuf</var> specifies whether minibuffer windows should be included in the cyclic ordering. Normally, when <var>minibuf</var> is <code>nil</code>, a minibuffer window is included only if it is currently active; this matches the behavior of <kbd><span class="nolinebreak">C-x</span> o</kbd>. (Note that a minibuffer window is active as long as its minibuffer is in use; see <a href="minibuffers">Minibuffers</a>). </p> <p>If <var>minibuf</var> is <code>t</code>, the cyclic ordering includes all minibuffer windows. If <var>minibuf</var> is neither <code>t</code> nor <code>nil</code>, minibuffer windows are not included even if they are active. </p> <p>The optional argument <var>all-frames</var> specifies which frames to consider: </p> <ul> <li> <code>nil</code> means to consider windows on <var>window</var>’s frame. If the minibuffer window is considered (as specified by the <var>minibuf</var> argument), then frames that share the minibuffer window are considered too. </li>
+<li> <code>t</code> means to consider windows on all existing frames. </li>
+<li> <code>visible</code> means to consider windows on all visible frames. </li>
+<li> 0 means to consider windows on all visible or iconified frames. </li>
+<li> A frame means to consider windows on that specific frame. </li>
+<li> Anything else means to consider windows on <var>window</var>’s frame, and no others. </li>
+</ul> <p>If more than one frame is considered, the cyclic ordering is obtained by appending the orderings for those frames, in the same order as the list of all live frames (see <a href="finding-all-frames">Finding All Frames</a>). </p>
+</dd>
+</dl> <dl> <dt id="previous-window">Function: <strong>previous-window</strong> <em>&amp;optional window minibuf all-frames</em>
+</dt> <dd><p>This function returns a live window, the one preceding <var>window</var> in the cyclic ordering of windows. The other arguments are handled like in <code>next-window</code>. </p></dd>
+</dl> <dl> <dt id="other-window">Command: <strong>other-window</strong> <em>count &amp;optional all-frames</em>
+</dt> <dd>
+<p>This function selects a live window, one <var>count</var> places from the selected window in the cyclic ordering of windows. If <var>count</var> is a positive number, it skips <var>count</var> windows forwards; if <var>count</var> is negative, it skips -<var>count</var> windows backwards; if <var>count</var> is zero, that simply re-selects the selected window. When called interactively, <var>count</var> is the numeric prefix argument. </p> <p>The optional argument <var>all-frames</var> has the same meaning as in <code>next-window</code>, like a <code>nil</code> <var>minibuf</var> argument to <code>next-window</code>. </p> <p>This function does not select a window that has a non-<code>nil</code> <code>no-other-window</code> window parameter (see <a href="window-parameters">Window Parameters</a>), provided that <code>ignore-window-parameters</code> is <code>nil</code>. </p> <p>If the <code>other-window</code> parameter of the selected window is a function, and <code>ignore-window-parameters</code> is <code>nil</code>, that function will be called with the arguments <var>count</var> and <var>all-frames</var> instead of the normal operation of this function. </p>
+</dd>
+</dl> <dl> <dt id="walk-windows">Function: <strong>walk-windows</strong> <em>fun &amp;optional minibuf all-frames</em>
+</dt> <dd>
+<p>This function calls the function <var>fun</var> once for each live window, with the window as the argument. </p> <p>It follows the cyclic ordering of windows. The optional arguments <var>minibuf</var> and <var>all-frames</var> specify the set of windows included; these have the same arguments as in <code>next-window</code>. If <var>all-frames</var> specifies a frame, the first window walked is the first window on that frame (the one returned by <code>frame-first-window</code>), not necessarily the selected window. </p> <p>If <var>fun</var> changes the window configuration by splitting or deleting windows, that does not alter the set of windows walked, which is determined prior to calling <var>fun</var> for the first time. </p>
+</dd>
+</dl> <dl> <dt id="one-window-p">Function: <strong>one-window-p</strong> <em>&amp;optional no-mini all-frames</em>
+</dt> <dd>
+<p>This function returns <code>t</code> if the selected window is the only live window, and <code>nil</code> otherwise. </p> <p>If the minibuffer window is active, it is normally considered (so that this function returns <code>nil</code>). However, if the optional argument <var>no-mini</var> is non-<code>nil</code>, the minibuffer window is ignored even if active. The optional argument <var>all-frames</var> has the same meaning as for <code>next-window</code>. </p>
+</dd>
+</dl> <p>The following functions return a window which satisfies some criterion, without selecting it: </p> <dl> <dt id="get-lru-window">Function: <strong>get-lru-window</strong> <em>&amp;optional all-frames dedicated not-selected no-other</em>
+</dt> <dd>
+<p>This function returns a live window which is heuristically the least recently used one. The <em>least recently used window</em> is the least recently selected one—the window whose use time is less than the use time of all other live windows (see <a href="selecting-windows">Selecting Windows</a>). The optional argument <var>all-frames</var> has the same meaning as in <code>next-window</code>. </p> <p>If any full-width windows are present, only those windows are considered. A minibuffer window is never a candidate. A dedicated window (see <a href="dedicated-windows">Dedicated Windows</a>) is never a candidate unless the optional argument <var>dedicated</var> is non-<code>nil</code>. The selected window is never returned, unless it is the only candidate. However, if the optional argument <var>not-selected</var> is non-<code>nil</code>, this function returns <code>nil</code> in that case. The optional argument <var>no-other</var>, if non-<code>nil</code>, means to never return a window whose <code>no-other-window</code> parameter is non-<code>nil</code>. </p>
+</dd>
+</dl> <dl> <dt id="get-mru-window">Function: <strong>get-mru-window</strong> <em>&amp;optional all-frames dedicated not-selected no-other</em>
+</dt> <dd>
+<p>This function is like <code>get-lru-window</code>, but it returns the most recently used window instead. The <em>most recently used window</em> is the most recently selected one—the window whose use time exceeds the use time of all other live windows (see <a href="selecting-windows">Selecting Windows</a>). The meaning of the arguments is the same as for <code>get-lru-window</code>. </p> <p>Since in practice the most recently used window is always the selected one, it usually makes sense to call this function with a non-<code>nil</code> <var>not-selected</var> argument only. </p>
+</dd>
+</dl> <dl> <dt id="get-largest-window">Function: <strong>get-largest-window</strong> <em>&amp;optional all-frames dedicated not-selected no-other</em>
+</dt> <dd><p>This function returns the window with the largest area (height times width). If there are two candidate windows of the same size, it prefers the one that comes first in the cyclic ordering of windows, starting from the selected window. The meaning of the arguments is the same as for <code>get-lru-window</code>. </p></dd>
+</dl> <dl> <dt id="get-window-with-predicate">Function: <strong>get-window-with-predicate</strong> <em>predicate &amp;optional minibuf all-frames default</em>
+</dt> <dd>
+<p>This function calls the function <var>predicate</var> for each of the windows in the cyclic order of windows in turn, passing it the window as an argument. If the predicate returns non-<code>nil</code> for any window, this function stops and returns that window. If no such window is found, the return value is <var>default</var> (which defaults to <code>nil</code>). </p> <p>The optional arguments <var>minibuf</var> and <var>all-frames</var> specify the windows to search, and have the same meanings as in <code>next-window</code>. </p>
+</dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Cyclic-Window-Ordering.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Cyclic-Window-Ordering.html</a>
+ </p>
+</div>