GNU Info

Info Node: (elisp)Indirect Buffers

(elisp)Indirect Buffers


Next: Buffer Gap Prev: Killing Buffers Up: Buffers
Enter node , (file) or (file)node

Indirect Buffers
================

   An "indirect buffer" shares the text of some other buffer, which is
called the "base buffer" 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.

   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.

   In all other respects, the indirect buffer and its base buffer are
completely separate.  They have different names, different values of
point, different narrowing, different markers and overlays (though
inserting or deleting text in either buffer relocates the markers and
overlays for both), different major modes, and different buffer-local
variables.

   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.

   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.

 - Command: make-indirect-buffer base-buffer name
     This creates an indirect buffer named NAME whose base buffer is
     BASE-BUFFER.  The argument BASE-BUFFER may be a buffer or a string.

     If BASE-BUFFER is an indirect buffer, its base buffer is used as
     the base for the new buffer.

 - Function: buffer-base-buffer buffer
     This function returns the base buffer of BUFFER.  If BUFFER is not
     indirect, the value is `nil'.  Otherwise, the value is another
     buffer, which is never an indirect buffer.


automatically generated by info2www version 1.2.2.9