diff options
Diffstat (limited to 'devdocs/elisp/indirect-buffers.html')
| -rw-r--r-- | devdocs/elisp/indirect-buffers.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/devdocs/elisp/indirect-buffers.html b/devdocs/elisp/indirect-buffers.html new file mode 100644 index 00000000..32e343e0 --- /dev/null +++ b/devdocs/elisp/indirect-buffers.html @@ -0,0 +1,16 @@ + <h3 class="section">Indirect Buffers</h3> <p>An <em>indirect buffer</em> shares the text of some other buffer, which is called the <em>base buffer</em> of the indirect buffer. In some ways it is the analogue, for buffers, of a symbolic link among files. The base buffer may not itself be an indirect buffer. </p> <p>The text of the indirect buffer is always identical to the text of its base buffer; changes made by editing either one are visible immediately in the other. This includes the text properties as well as the characters themselves. </p> <p>In all other respects, the indirect buffer and its base buffer are completely separate. They have different names, independent values of point, independent narrowing, independent markers and overlays (though inserting or deleting text in either buffer relocates the markers and overlays for both), independent major modes, and independent buffer-local variable bindings. </p> <p>An indirect buffer cannot visit a file, but its base buffer can. If you try to save the indirect buffer, that actually saves the base buffer. </p> <p>Killing an indirect buffer has no effect on its base buffer. Killing the base buffer effectively kills the indirect buffer in that it cannot ever again be the current buffer. </p> <dl> <dt id="make-indirect-buffer">Command: <strong>make-indirect-buffer</strong> <em>base-buffer name &optional clone inhibit-buffer-hooks</em> +</dt> <dd> +<p>This creates and returns an indirect buffer named <var>name</var> whose base buffer is <var>base-buffer</var>. The argument <var>base-buffer</var> may be a live buffer or the name (a string) of an existing buffer. If <var>name</var> is the name of an existing buffer, an error is signaled. </p> <p>If <var>clone</var> is non-<code>nil</code>, then the indirect buffer originally shares the state of <var>base-buffer</var> such as major mode, minor modes, buffer local variables and so on. If <var>clone</var> is omitted or <code>nil</code> the indirect buffer’s state is set to the default state for new buffers. </p> <p>If <var>base-buffer</var> is an indirect buffer, its base buffer is used as the base for the new buffer. If, in addition, <var>clone</var> is non-<code>nil</code>, the initial state is copied from the actual base buffer, not from <var>base-buffer</var>. </p> <p>See <a href="creating-buffers">Creating Buffers</a>, for the meaning of <var>inhibit-buffer-hooks</var>. </p> +</dd> +</dl> <dl> <dt id="clone-indirect-buffer">Command: <strong>clone-indirect-buffer</strong> <em>newname display-flag &optional norecord</em> +</dt> <dd> +<p>This function creates and returns a new indirect buffer that shares the current buffer’s base buffer and copies the rest of the current buffer’s attributes. (If the current buffer is not indirect, it is used as the base buffer.) </p> <p>If <var>display-flag</var> is non-<code>nil</code>, as it always is in interactive calls, that means to display the new buffer by calling <code>pop-to-buffer</code>. If <var>norecord</var> is non-<code>nil</code>, that means not to put the new buffer to the front of the buffer list. </p> +</dd> +</dl> <dl> <dt id="buffer-base-buffer">Function: <strong>buffer-base-buffer</strong> <em>&optional buffer</em> +</dt> <dd><p>This function returns the base buffer of <var>buffer</var>, which defaults to the current buffer. If <var>buffer</var> is not indirect, the value is <code>nil</code>. Otherwise, the value is another buffer, which is never an indirect buffer. </p></dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 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/Indirect-Buffers.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Indirect-Buffers.html</a> + </p> +</div> |
