[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

N. Using Multiple Buffers

The text you are editing in Emacs resides in an object called a buffer. Each time you visit a file, a buffer is created to hold the file's text. Each time you invoke Dired, a buffer is created to hold the directory listing. If you send a message with C-x m, a buffer named `*mail*' is used to hold the text of the message. When you ask for a command's documentation, that appears in a buffer called `*Help*'.

At any time, one and only one buffer is current. It is also called the selected buffer. Often we say that a command operates on "the buffer" as if there were only one; but really this means that the command operates on the current buffer (most commands do).

When Emacs has multiple windows, each window has its own chosen buffer and displays it; at any time, only one of the windows is selected, and its chosen buffer is the current buffer. Each window's mode line normally displays the name of the window's chosen buffer (see section O. Multiple Windows).

Each buffer has a name, which can be of any length, and you can select any buffer by giving its name. Most buffers are made by visiting files, and their names are derived from the files' names. But you can also create an empty buffer with any name you want. A newly started Emacs has a buffer named `*scratch*' which can be used for evaluating Lisp expressions in Emacs. The distinction between upper and lower case matters in buffer names.

Each buffer records individually what file it is visiting, whether it is modified, and what major mode and minor modes are in effect in it (see section R. Major Modes). Any Emacs variable can be made local to a particular buffer, meaning its value in that buffer can be different from the value in other buffers. See section AD.2.4 Local Variables.

A buffer's size cannot be larger than some maximum, which is defined by the largest buffer position representable by the Emacs integer data type. This is because Emacs tracks buffer positions using that data type. For 32-bit machines, the largest buffer size is 128 megabytes.

N.1 Creating and Selecting Buffers  Creating a new buffer or reselecting an old one.
N.2 Listing Existing Buffers  Getting a list of buffers that exist.
N.3 Miscellaneous Buffer Operations  Renaming; changing read-onlyness; copying text.
N.4 Killing Buffers  Killing buffers you no longer need.
N.5 Operating on Several Buffers  How to go through the list of all buffers and operate variously on several of them.
N.6 Indirect Buffers  An indirect buffer shares the text of another buffer.
N.7 Convenience Features and Customization of Buffer Handling  Convenience and customization features for buffer handling.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 2, 2002 using texi2html