aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-25 06:00:06 +0000
committerRichard M. Stallman1994-05-25 06:00:06 +0000
commit47ba05ac9ce59f5959f24c82d9ccccaa4e633a30 (patch)
tree3ae2c41708f8745875ca3b92374e22aaee075fec
parente6a9aec70b6f0bdfa7ed2bde048e4c84aee213ca (diff)
downloademacs-47ba05ac9ce59f5959f24c82d9ccccaa4e633a30.tar.gz
emacs-47ba05ac9ce59f5959f24c82d9ccccaa4e633a30.zip
entered into RCS
-rw-r--r--lispref/buffers.texi82
1 files changed, 42 insertions, 40 deletions
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index 4aeb8a5487c..c37b98d3cdc 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -9,7 +9,7 @@
9 9
10 A @dfn{buffer} is a Lisp object containing text to be edited. Buffers 10 A @dfn{buffer} is a Lisp object containing text to be edited. Buffers
11are used to hold the contents of files that are being visited; there may 11are used to hold the contents of files that are being visited; there may
12also be buffers which are not visiting files. While several buffers may 12also be buffers that are not visiting files. While several buffers may
13exist at one time, exactly one buffer is designated the @dfn{current 13exist at one time, exactly one buffer is designated the @dfn{current
14buffer} at any time. Most editing commands act on the contents of the 14buffer} at any time. Most editing commands act on the contents of the
15current buffer. Each buffer, including the current buffer, may or may 15current buffer. Each buffer, including the current buffer, may or may
@@ -37,14 +37,14 @@ not be displayed in any windows.
37@ifinfo 37@ifinfo
38 A @dfn{buffer} is a Lisp object containing text to be edited. Buffers 38 A @dfn{buffer} is a Lisp object containing text to be edited. Buffers
39are used to hold the contents of files that are being visited; there may 39are used to hold the contents of files that are being visited; there may
40also be buffers which are not visiting files. While several buffers may 40also be buffers that are not visiting files. While several buffers may
41exist at one time, exactly one buffer is designated the @dfn{current 41exist at one time, exactly one buffer is designated the @dfn{current
42buffer} at any time. Most editing commands act on the contents of the 42buffer} at any time. Most editing commands act on the contents of the
43current buffer. Each buffer, including the current buffer, may or may 43current buffer. Each buffer, including the current buffer, may or may
44not be displayed in any windows. 44not be displayed in any windows.
45@end ifinfo 45@end ifinfo
46 46
47 Buffers in Emacs editing are objects which have distinct names and 47 Buffers in Emacs editing are objects that have distinct names and
48hold text that can be edited. Buffers appear to Lisp programs as a 48hold text that can be edited. Buffers appear to Lisp programs as a
49special data type. The contents of a buffer may be viewed as an 49special data type. The contents of a buffer may be viewed as an
50extendable string; insertions and deletions may occur in any part of the 50extendable string; insertions and deletions may occur in any part of the
@@ -52,7 +52,7 @@ buffer. @xref{Text}.
52 52
53 A Lisp buffer object contains numerous pieces of information. Some of 53 A Lisp buffer object contains numerous pieces of information. Some of
54this information is directly accessible to the programmer through 54this information is directly accessible to the programmer through
55variables, while other information is only accessible through 55variables, while other information is accessible only through
56special-purpose functions. For example, the visited file name is 56special-purpose functions. For example, the visited file name is
57directly accessible through a variable, while the value of point is 57directly accessible through a variable, while the value of point is
58accessible only through a primitive function. 58accessible only through a primitive function.
@@ -403,24 +403,24 @@ normally, or if the file itself has been changed for some known benign
403reason. 403reason.
404@end defun 404@end defun
405 405
406@defun ask-user-about-supersession-threat fn 406@defun ask-user-about-supersession-threat filename
407@cindex obsolete buffer 407@cindex obsolete buffer
408This function is used to ask a user how to proceed after an attempt to 408This function is used to ask a user how to proceed after an attempt to
409modify an obsolete buffer. An @dfn{obsolete buffer} is an unmodified 409modify an obsolete buffer visiting file @var{filename}. An
410buffer for which the associated file on disk is newer than the last 410@dfn{obsolete buffer} is an unmodified buffer for which the associated
411save-time of the buffer. This means some other program has probably 411file on disk is newer than the last save-time of the buffer. This means
412altered the file. 412some other program has probably altered the file.
413
414This function is called automatically by Emacs on the proper
415occasions. It exists so you can customize Emacs by redefining it.
416See the file @file{userlock.el} for the standard definition.
417 413
418@kindex file-supersession 414@kindex file-supersession
419Depending on the user's answer, the function may return normally, in 415Depending on the user's answer, the function may return normally, in
420which case the modification of the buffer proceeds, or it may signal a 416which case the modification of the buffer proceeds, or it may signal a
421@code{file-supersession} error with data @code{(@var{fn})}, in which 417@code{file-supersession} error with data @code{(@var{filename})}, in which
422case the proposed buffer modification is not allowed. 418case the proposed buffer modification is not allowed.
423 419
420This function is called automatically by Emacs on the proper
421occasions. It exists so you can customize Emacs by redefining it.
422See the file @file{userlock.el} for the standard definition.
423
424See also the file locking mechanism in @ref{File Locks}. 424See also the file locking mechanism in @ref{File Locks}.
425@end defun 425@end defun
426 426
@@ -460,14 +460,16 @@ The buffer is read-only if this variable is non-@code{nil}.
460 460
461@defvar inhibit-read-only 461@defvar inhibit-read-only
462If this variable is non-@code{nil}, then read-only buffers and read-only 462If this variable is non-@code{nil}, then read-only buffers and read-only
463characters may be modified. The value of @code{buffer-read-only} does 463characters may be modified. Read-only characters in a buffer are those
464not matter when @code{inhibit-read-only} is non-@code{nil}. 464that have non-@code{nil} @code{read-only} properties (either text
465 465properties or overlay properties). @xref{Special Properties}, for more
466If @code{inhibit-read-only} is @code{t}, all @code{read-only} text 466information about text properties. @xref{Overlays}, for more
467properties have no effect (@pxref{Special Properties}). If 467information about overlays and their properties.
468@code{inhibit-read-only} is a list, then @code{read-only} text 468
469properties are ignored if they are members of the list (comparison is 469If @code{inhibit-read-only} is @code{t}, all @code{read-only} character
470done with @code{eq}). 470properties have no effect. If @code{inhibit-read-only} is a list, then
471@code{read-only} character properties have no effect if they are members
472of the list (comparison is done with @code{eq}).
471@end defvar 473@end defvar
472 474
473@deffn Command toggle-read-only 475@deffn Command toggle-read-only
@@ -547,11 +549,11 @@ without changing the order of any of the other buffers on the list.
547This buffer therefore becomes the least desirable candidate for 549This buffer therefore becomes the least desirable candidate for
548@code{other-buffer} to return. 550@code{other-buffer} to return.
549 551
550If @var{buffer-or-name} is @code{nil} or omitted, this means to bury 552If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the
551the current buffer. In addition, this switches to some other buffer 553current buffer. In addition, if the buffer is displayed in the selected
552(obtained using @code{other-buffer}) in the selected window. If the 554window, this switches to some other buffer (obtained using
553buffer is displayed in a window other than the selected one, it remains 555@code{other-buffer}) in the selected window. But if the buffer is
554there. 556displayed in some other window, it remains displayed there.
555 557
556If you wish to replace a buffer in all the windows that display it, use 558If you wish to replace a buffer in all the windows that display it, use
557@code{replace-buffer-in-windows}. @xref{Buffers and Windows}. 559@code{replace-buffer-in-windows}. @xref{Buffers and Windows}.
@@ -563,9 +565,9 @@ If you wish to replace a buffer in all the windows that display it, use
563@cindex buffers, creating 565@cindex buffers, creating
564 566
565 This section describes the two primitives for creating buffers. 567 This section describes the two primitives for creating buffers.
566@code{get-buffer-create} creates a buffer if it finds no existing 568@code{get-buffer-create} creates a buffer if it finds no existing buffer
567buffer; @code{generate-new-buffer} always creates a new buffer, and 569with the specified name; @code{generate-new-buffer} always creates a new
568gives it a unique name. 570buffer and gives it a unique name.
569 571
570 Other functions you can use to create buffers include 572 Other functions you can use to create buffers include
571@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and 573@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and
@@ -595,9 +597,9 @@ The major mode for the new buffer is set according to the variable
595This function returns a newly created, empty buffer, but does not make 597This function returns a newly created, empty buffer, but does not make
596it current. If there is no buffer named @var{name}, then that is the 598it current. If there is no buffer named @var{name}, then that is the
597name of the new buffer. If that name is in use, this function adds 599name of the new buffer. If that name is in use, this function adds
598suffixes of the form @samp{<@var{n}>} are added to @var{name}, where 600suffixes of the form @samp{<@var{n}>} to @var{name}, where @var{n} is an
599@var{n} is an integer. It tries successive integers starting with 2 601integer. It tries successive integers starting with 2 until it finds an
600until it finds an available name. 602available name.
601 603
602An error is signaled if @var{name} is not a string. 604An error is signaled if @var{name} is not a string.
603 605
@@ -629,9 +631,9 @@ Names}.
629@cindex buffers, killing 631@cindex buffers, killing
630 632
631 @dfn{Killing a buffer} makes its name unknown to Emacs and makes its 633 @dfn{Killing a buffer} makes its name unknown to Emacs and makes its
632space available for other use. 634text space available for other use.
633 635
634 The buffer object for the buffer which has been killed remains in 636 The buffer object for the buffer that has been killed remains in
635existence as long as anything refers to it, but it is specially marked 637existence as long as anything refers to it, but it is specially marked
636so that you cannot make it current or display it. Killed buffers retain 638so that you cannot make it current or display it. Killed buffers retain
637their identity, however; two distinct buffers, when killed, remain 639their identity, however; two distinct buffers, when killed, remain
@@ -733,8 +735,8 @@ is designated.
733 735
734 When an editing command returns to the editor command loop, the 736 When an editing command returns to the editor command loop, the
735command loop designates the buffer displayed in the selected window as 737command loop designates the buffer displayed in the selected window as
736current, to prevent confusion: the buffer that the cursor is in, when 738current, to prevent confusion: the buffer that the cursor is in when
737Emacs reads a command, is the one to which the command will apply. 739Emacs reads a command is the buffer that the command will apply to.
738(@xref{Command Loop}.) Therefore, @code{set-buffer} is not the way to 740(@xref{Command Loop}.) Therefore, @code{set-buffer} is not the way to
739switch visibly to a different buffer so that the user can edit it. For 741switch visibly to a different buffer so that the user can edit it. For
740this, you must use the functions described in @ref{Displaying Buffers}. 742this, you must use the functions described in @ref{Displaying Buffers}.
@@ -788,7 +790,7 @@ is unbound.
788 790
789 It is not reliable to change the current buffer back with 791 It is not reliable to change the current buffer back with
790@code{set-buffer}, because that won't do the job if a quit happens while 792@code{set-buffer}, because that won't do the job if a quit happens while
791the wrong buffer is current. Here is what not to do: 793the wrong buffer is current. Here is what @emph{not} to do:
792 794
793@example 795@example
794@group 796@group
@@ -801,8 +803,8 @@ the wrong buffer is current. Here is what not to do:
801@end example 803@end example
802 804
803@noindent 805@noindent
804Using @code{save-excursion}, as shown below, handles quitting, errors 806Using @code{save-excursion}, as shown below, handles quitting, errors,
805and @code{throw} as well as ordinary evaluation. 807and @code{throw}, as well as ordinary evaluation.
806 808
807@example 809@example
808@group 810@group