summaryrefslogtreecommitdiff
path: root/devdocs/elisp/buffers-and-windows.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/buffers-and-windows.html
new repository
Diffstat (limited to 'devdocs/elisp/buffers-and-windows.html')
-rw-r--r--devdocs/elisp/buffers-and-windows.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/devdocs/elisp/buffers-and-windows.html b/devdocs/elisp/buffers-and-windows.html
new file mode 100644
index 00000000..919f34c2
--- /dev/null
+++ b/devdocs/elisp/buffers-and-windows.html
@@ -0,0 +1,33 @@
+ <h3 class="section">Buffers and Windows</h3> <p>This section describes low-level functions for examining and setting the contents of windows. See <a href="switching-buffers">Switching Buffers</a>, for higher-level functions for displaying a specific buffer in a window. </p> <dl> <dt id="window-buffer">Function: <strong>window-buffer</strong> <em>&amp;optional window</em>
+</dt> <dd><p>This function returns the buffer that <var>window</var> is displaying. If <var>window</var> is omitted or <code>nil</code> it defaults to the selected window. If <var>window</var> is an internal window, this function returns <code>nil</code>. </p></dd>
+</dl> <dl> <dt id="set-window-buffer">Function: <strong>set-window-buffer</strong> <em>window buffer-or-name &amp;optional keep-margins</em>
+</dt> <dd>
+<p>This function makes <var>window</var> display <var>buffer-or-name</var>. <var>window</var> should be a live window; if <code>nil</code>, it defaults to the selected window. <var>buffer-or-name</var> should be a buffer, or the name of an existing buffer. This function does not change which window is selected, nor does it directly change which buffer is current (see <a href="current-buffer">Current Buffer</a>). Its return value is <code>nil</code>. </p> <p>If <var>window</var> is <em>strongly dedicated</em> to a buffer and <var>buffer-or-name</var> does not specify that buffer, this function signals an error. See <a href="dedicated-windows">Dedicated Windows</a>. </p> <p>By default, this function resets <var>window</var>’s position, display margins, fringe widths, and scroll bar settings, based on the local variables in the specified buffer. However, if the optional argument <var>keep-margins</var> is non-<code>nil</code>, it leaves <var>window</var>’s display margins, fringes and scroll bar settings alone. </p> <p>When writing an application, you should normally use <code>display-buffer</code> (see <a href="choosing-window">Choosing Window</a>) or the higher-level functions described in <a href="switching-buffers">Switching Buffers</a>, instead of calling <code>set-window-buffer</code> directly. </p> <p>This runs <code>window-scroll-functions</code>, followed by <code>window-configuration-change-hook</code>. See <a href="window-hooks">Window Hooks</a>. </p>
+</dd>
+</dl> <dl> <dt id="buffer-display-count">Variable: <strong>buffer-display-count</strong>
+</dt> <dd><p>This buffer-local variable records the number of times a buffer has been displayed in a window. It is incremented each time <code>set-window-buffer</code> is called for the buffer. </p></dd>
+</dl> <dl> <dt id="buffer-display-time">Variable: <strong>buffer-display-time</strong>
+</dt> <dd><p>This buffer-local variable records the time at which a buffer was last displayed in a window. The value is <code>nil</code> if the buffer has never been displayed. It is updated each time <code>set-window-buffer</code> is called for the buffer, with the value returned by <code>current-time</code> (see <a href="time-of-day">Time of Day</a>). </p></dd>
+</dl> <dl> <dt id="get-buffer-window">Function: <strong>get-buffer-window</strong> <em>&amp;optional buffer-or-name all-frames</em>
+</dt> <dd>
+<p>This function returns the first window displaying <var>buffer-or-name</var> in the cyclic ordering of windows, starting from the selected window (see <a href="cyclic-window-ordering">Cyclic Window Ordering</a>). If no such window exists, the return value is <code>nil</code>. </p> <p><var>buffer-or-name</var> should be a buffer or the name of a buffer; if omitted or <code>nil</code>, it defaults to the current buffer. The optional argument <var>all-frames</var> specifies which windows to consider: </p> <ul> <li> <code>t</code> means consider windows on all existing frames. </li>
+<li> <code>visible</code> means consider windows on all visible frames. </li>
+<li> 0 means consider windows on all visible or iconified frames. </li>
+<li> A frame means consider windows on that frame only. </li>
+<li> Any other value means consider windows on the selected frame. </li>
+</ul> <p>Note that these meanings differ slightly from those of the <var>all-frames</var> argument to <code>next-window</code> (see <a href="cyclic-window-ordering">Cyclic Window Ordering</a>). This function may be changed in a future version of Emacs to eliminate this discrepancy. </p>
+</dd>
+</dl> <dl> <dt id="get-buffer-window-list">Function: <strong>get-buffer-window-list</strong> <em>&amp;optional buffer-or-name minibuf all-frames</em>
+</dt> <dd>
+<p>This function returns a list of all windows currently displaying <var>buffer-or-name</var>. <var>buffer-or-name</var> should be a buffer or the name of an existing buffer. If omitted or <code>nil</code>, it defaults to the current buffer. If the currently selected window displays <var>buffer-or-name</var>, it will be the first in the list returned by this function. </p> <p>The arguments <var>minibuf</var> and <var>all-frames</var> have the same meanings as in the function <code>next-window</code> (see <a href="cyclic-window-ordering">Cyclic Window Ordering</a>). Note that the <var>all-frames</var> argument does <em>not</em> behave exactly like in <code>get-buffer-window</code>. </p>
+</dd>
+</dl> <dl> <dt id="replace-buffer-in-windows">Command: <strong>replace-buffer-in-windows</strong> <em>&amp;optional buffer-or-name</em>
+</dt> <dd>
+<p>This command replaces <var>buffer-or-name</var> with some other buffer, in all windows displaying it. <var>buffer-or-name</var> should be a buffer, or the name of an existing buffer; if omitted or <code>nil</code>, it defaults to the current buffer. </p> <p>The replacement buffer in each window is chosen via <code>switch-to-prev-buffer</code> (see <a href="window-history">Window History</a>). With the exception of side windows (see <a href="side-windows">Side Windows</a>), any dedicated window displaying <var>buffer-or-name</var> is deleted if possible (see <a href="dedicated-windows">Dedicated Windows</a>). If such a window is the only window on its frame and there are other frames on the same terminal, the frame is deleted as well. If the dedicated window is the only window on the only frame on its terminal, the buffer is replaced anyway. </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/Buffers-and-Windows.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffers-and-Windows.html</a>
+ </p>
+</div>