blob: c6cf12c01e69c2ad24a2a01669e844540578f294 (
plain)
1
2
3
4
5
6
7
8
|
<h3 class="section">Buffer Basics</h3> <p>A <em>buffer</em> is a Lisp object containing text to be edited. Buffers are used to hold the contents of files that are being visited; there may also be buffers that are not visiting files. Although several buffers normally exist, only one buffer is designated the <em>current buffer</em> at any time. Most editing commands act on the contents of the current buffer. Each buffer, including the current buffer, may or may not be displayed in any windows. </p> <p>Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer. See <a href="text">Text</a>. </p> <p>A Lisp buffer object contains numerous pieces of information. Some of this information is directly accessible to the programmer through variables, while other information is accessible only through special-purpose functions. For example, the visited file name is directly accessible through a variable, while the value of point is accessible only through a primitive function. </p> <p>Buffer-specific information that is directly accessible is stored in <em>buffer-local</em> variable bindings, which are variable values that are effective only in a particular buffer. This feature allows each buffer to override the values of certain variables. Most major modes override variables such as <code>fill-column</code> or <code>comment-column</code> in this way. For more information about buffer-local variables and functions related to them, see <a href="buffer_002dlocal-variables">Buffer-Local Variables</a>. </p> <p>For functions and variables related to visiting files in buffers, see <a href="visiting-files">Visiting Files</a> and <a href="saving-buffers">Saving Buffers</a>. For functions and variables related to the display of buffers in windows, see <a href="buffers-and-windows">Buffers and Windows</a>. </p> <dl> <dt id="bufferp">Function: <strong>bufferp</strong> <em>object</em>
</dt> <dd><p>This function returns <code>t</code> if <var>object</var> is a buffer, <code>nil</code> otherwise. </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/Buffer-Basics.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Basics.html</a>
</p>
</div>
|