Mercurial > emacs
comparison lispref/buffers.texi @ 12098:a6eb5f12b0f3
*** empty log message ***
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 06 Jun 1995 19:21:15 +0000 |
parents | 73dc8205d259 |
children | 909eb45b146d |
comparison
equal
deleted
inserted
replaced
12097:d8c035332be8 | 12098:a6eb5f12b0f3 |
---|---|
43 buffer} at any time. Most editing commands act on the contents of the | 43 buffer} at any time. Most editing commands act on the contents of the |
44 current buffer. Each buffer, including the current buffer, may or may | 44 current buffer. Each buffer, including the current buffer, may or may |
45 not be displayed in any windows. | 45 not be displayed in any windows. |
46 @end ifinfo | 46 @end ifinfo |
47 | 47 |
48 Buffers in Emacs editing are objects that have distinct names and | 48 Buffers in Emacs editing are objects that have distinct names and hold |
49 hold text that can be edited. Buffers appear to Lisp programs as a | 49 text that can be edited. Buffers appear to Lisp programs as a special |
50 special data type. The contents of a buffer may be viewed as an | 50 data type. You can think of the contents of a buffer as an extendable |
51 extendable string; insertions and deletions may occur in any part of the | 51 string; insertions and deletions may occur in any part of the buffer. |
52 buffer. @xref{Text}. | 52 @xref{Text}. |
53 | 53 |
54 A Lisp buffer object contains numerous pieces of information. Some of | 54 A Lisp buffer object contains numerous pieces of information. Some of |
55 this information is directly accessible to the programmer through | 55 this information is directly accessible to the programmer through |
56 variables, while other information is accessible only through | 56 variables, while other information is accessible only through |
57 special-purpose functions. For example, the visited file name is | 57 special-purpose functions. For example, the visited file name is |
210 sort, and an error is signaled if it is neither a string nor a buffer. | 210 sort, and an error is signaled if it is neither a string nor a buffer. |
211 Any argument called @var{buffer} must be an actual buffer | 211 Any argument called @var{buffer} must be an actual buffer |
212 object, not a name. | 212 object, not a name. |
213 | 213 |
214 Buffers that are ephemeral and generally uninteresting to the user | 214 Buffers that are ephemeral and generally uninteresting to the user |
215 have names starting with a space, so that the @code{list-buffers} or | 215 have names starting with a space, so that the @code{list-buffers} and |
216 @code{buffer-menu} commands don't mention them. A name starting with | 216 @code{buffer-menu} commands don't mention them. A name starting with |
217 space also initially disables recording undo information; see | 217 space also initially disables recording undo information; see |
218 @ref{Undo}. | 218 @ref{Undo}. |
219 | 219 |
220 @defun buffer-name &optional buffer | 220 @defun buffer-name &optional buffer |
565 A buffer visiting a write-protected file is normally read-only. | 565 A buffer visiting a write-protected file is normally read-only. |
566 | 566 |
567 Here, the purpose is to show the user that editing the buffer with the | 567 Here, the purpose is to show the user that editing the buffer with the |
568 aim of saving it in the file may be futile or undesirable. The user who | 568 aim of saving it in the file may be futile or undesirable. The user who |
569 wants to change the buffer text despite this can do so after clearing | 569 wants to change the buffer text despite this can do so after clearing |
570 the read-only flag with @kbd{C-M-q}. | 570 the read-only flag with @kbd{C-x C-q}. |
571 | 571 |
572 @item | 572 @item |
573 Modes such as Dired and Rmail make buffers read-only when altering the | 573 Modes such as Dired and Rmail make buffers read-only when altering the |
574 contents with the usual editing commands is probably a mistake. | 574 contents with the usual editing commands is probably a mistake. |
575 | 575 |
776 automatically selects or displays some other buffer instead. This means | 776 automatically selects or displays some other buffer instead. This means |
777 that killing a buffer can in general change the current buffer. | 777 that killing a buffer can in general change the current buffer. |
778 Therefore, when you kill a buffer, you should also take the precautions | 778 Therefore, when you kill a buffer, you should also take the precautions |
779 associated with changing the current buffer (unless you happen to know | 779 associated with changing the current buffer (unless you happen to know |
780 that the buffer being killed isn't current). @xref{Current Buffer}. | 780 that the buffer being killed isn't current). @xref{Current Buffer}. |
781 | |
782 If you kill a buffer that is the base buffer of one or more indirect | |
783 buffers, the indirect buffers are automatically killed as well. | |
781 | 784 |
782 The @code{buffer-name} of a killed buffer is @code{nil}. You can use | 785 The @code{buffer-name} of a killed buffer is @code{nil}. You can use |
783 this feature to test whether a buffer has been killed: | 786 this feature to test whether a buffer has been killed: |
784 | 787 |
785 @example | 788 @example |
851 @cindex indirect buffers | 854 @cindex indirect buffers |
852 @cindex base buffer | 855 @cindex base buffer |
853 | 856 |
854 An @dfn{indirect buffer} shares the text of some other buffer, which | 857 An @dfn{indirect buffer} shares the text of some other buffer, which |
855 is called the @dfn{base buffer} of the indirect buffer. In some ways it | 858 is called the @dfn{base buffer} of the indirect buffer. In some ways it |
856 is the equivalent, for buffers, of a symbolic link among files. The base | 859 is the analogue, for buffers, of a symbolic link among files. The base |
857 buffer may not itself be an indirect buffer. | 860 buffer may not itself be an indirect buffer. |
858 | 861 |
859 The text of the indirect buffer is always identical to the text of its | 862 The text of the indirect buffer is always identical to the text of its |
860 base buffer; changes made by editing either one are visible immediately | 863 base buffer; changes made by editing either one are visible immediately |
861 in the other. This includes the text properties as well as the characters | 864 in the other. This includes the text properties as well as the characters |