From 137987ab43d15cfafc0e11639d80f700408d5bea Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 16 Jul 2009 19:37:08 +0000 Subject: [PATCH] * buffers.texi (Swapping Text): Recommend setting write-region-annotate-functions and buffer-saved-size. * backups.texi (Auto-Saving): Document buffer-saved-size = -2. --- doc/lispref/ChangeLog | 7 +++++++ doc/lispref/backups.texi | 4 ++++ doc/lispref/buffers.texi | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f0e57f6d529..7f6bca51300 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,10 @@ +2009-07-16 Richard Stallman + + * buffers.texi (Swapping Text): Recommend setting + write-region-annotate-functions and buffer-saved-size. + + * backups.texi (Auto-Saving): Document buffer-saved-size = -2. + 2009-07-15 Glenn Morris * edebug.texi: Minor re-phrasings throughout. diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi index 6de8594607f..d43bce28d7a 100644 --- a/doc/lispref/backups.texi +++ b/doc/lispref/backups.texi @@ -632,6 +632,10 @@ this buffer due to a substantial decrease in size. Explicitly saving the buffer stores a positive value in this variable, thus reenabling auto-saving. Turning auto-save mode off or on also updates this variable, so that the substantial decrease in size is forgotten. + +If it is @minus{}2, that means this buffer should disregard changes in +buffer size; in particular, it should not shut off auto-saving +temporarily due to changes in buffer size. @end defvar @defvar auto-save-list-file-name diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 5d03865e8e2..97242d8d5de 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -1192,6 +1192,13 @@ overlays, the text properties, the undo list, the value of the enable-multibyte-characters}), etc. @end defun + If you use @code{buffer-swap-text} on a file-visiting buffer, you +should set up a hook to save the buffer's original text rather than +what it was swapped with. @code{write-region-annotate-functions} +works for this purpose. You should probably set +@code{buffer-saved-size} to @minus{}2 in the buffer, so that changes +in the text it is swapped with will not interfere with auto-saving. + @node Buffer Gap @section The Buffer Gap -- 2.39.2