Next: , Previous: , Up: Files—Buffers—Windows—Frames—Terminals   [Index]


G.2 Buffers

BUFFER

A “buffer” 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. Only one buffer is designated the “current buffer” at any time. Each buffer, including the current buffer, may or may not be displayed in any windows.

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.

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.

BUFFER-LOCAL VARIABLES

Buffer-specific information that is directly accessible is stored in “buffer-local” 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 ‘fill-column’ or ‘comment-column’ in this way.

Some functions and variables relate to visiting files in buffers, while others relate to the display of buffers in windows.

Function: bufferp object

This function returns ‘t’ if OBJECT is a buffer, ‘nil’ otherwise.