]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/backups.texi
Merge from emacs-24; up to 117656
[gnu-emacs] / doc / lispref / backups.texi
index 935a49116cde7eb28df4b9f02125a2bb4d267210..63f8f227c847430d0d901bfd980c568e3ceafd9c 100644 (file)
@@ -1,6 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1999, 2001-2012 Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1999, 2001-2014 Free Software Foundation,
+@c Inc.
 @c See the file elisp.texi for copying conditions.
 @node Backups and Auto-Saving
 @chapter Backups and Auto-Saving
@@ -56,13 +57,15 @@ buffer, if appropriate.  It is called by @code{save-buffer} before
 saving the buffer the first time.
 
 If a backup was made by renaming, the return value is a cons cell of
-the form (@var{modes} @var{context} @var{backupname}), where
+the form (@var{modes} @var{extra-alist} @var{backupname}), where
 @var{modes} are the mode bits of the original file, as returned by
-@code{file-modes} (@pxref{File Attributes,, Other Information about
-Files}), @var{context} is a list describing the original file's
-SELinux context (@pxref{File Attributes}), and @var{backupname} is the
-name of the backup.  In all other cases, that is, if a backup was made
-by copying or if no backup was made, this function returns @code{nil}.
+@code{file-modes} (@pxref{Testing Accessibility}), @var{extra-alist}
+is an alist describing the original file's extended attributes, as
+returned by @code{file-extended-attributes} (@pxref{Extended
+Attributes}), and @var{backupname} is the name of the backup.
+
+In all other cases (i.e., if a backup was made by copying or if no
+backup was made), this function returns @code{nil}.
 @end defun
 
 @defvar buffer-backed-up
@@ -87,8 +90,7 @@ save disk space.  (You would put this code in your init file.)
 @smallexample
 @group
 (add-hook 'rmail-mode-hook
-          (lambda ()
-            (set (make-local-variable 'make-backup-files) nil)))
+          (lambda () (setq-local make-backup-files nil)))
 @end group
 @end smallexample
 @end defopt
@@ -147,13 +149,12 @@ ignored.
 @end defopt
 
 @defopt make-backup-file-name-function
-This variable's value is a function to use for making backups instead
-of the default @code{make-backup-file-name}.  A value of @code{nil}
-gives the default @code{make-backup-file-name} behavior.
+This variable's value is a function to use for making backup file names.
+The function @code{make-backup-file-name} calls it.
 @xref{Backup Names,, Naming Backup Files}.
 
 This could be buffer-local to do something special for specific
-files.  If you define it, you may need to change
+files.  If you change it, you may need to change
 @code{backup-file-name-p} and @code{file-name-sans-versions} too.
 @end defopt
 
@@ -661,7 +662,7 @@ host name.
 After Emacs reads your init file, it initializes
 @code{auto-save-list-file-name} (if you have not already set it
 non-@code{nil}) based on this prefix, adding the host name and process
-ID.  If you set this to @code{nil} in your init file, then Emacs does
+ID@.  If you set this to @code{nil} in your init file, then Emacs does
 not initialize @code{auto-save-list-file-name}.
 @end defopt
 
@@ -724,25 +725,24 @@ buffer-local bindings for these variables:
 @defvar revert-buffer-function
 @anchor{Definition of revert-buffer-function}
 The value of this variable is the function to use to revert this
-buffer.  If non-@code{nil}, it should be a function with two optional
+buffer.  It should be a function with two optional
 arguments to do the work of reverting.  The two optional arguments,
 @var{ignore-auto} and @var{noconfirm}, are the arguments that
-@code{revert-buffer} received.  If the value is @code{nil}, reverting
-works the usual way.
+@code{revert-buffer} received.
 
 Modes such as Dired mode, in which the text being edited does not
 consist of a file's contents but can be regenerated in some other
-fashion, can give this variable a buffer-local value that is a function to
-regenerate the contents.
+fashion, can give this variable a buffer-local value that is a special
+function to regenerate the contents.
 @end defvar
 
 @defvar revert-buffer-insert-file-contents-function
-The value of this variable, if non-@code{nil}, specifies the function to use to
+The value of this variable specifies the function to use to
 insert the updated contents when reverting this buffer.  The function
 receives two arguments: first the file name to use; second, @code{t} if
 the user has asked to read the auto-save file.
 
-The reason for a mode to set this variable instead of
+The reason for a mode to change this variable instead of
 @code{revert-buffer-function} is to avoid duplicating or replacing the
 rest of what @code{revert-buffer} does: asking for confirmation,
 clearing the undo list, deciding the proper major mode, and running the
@@ -750,21 +750,23 @@ hooks listed below.
 @end defvar
 
 @defvar before-revert-hook
-This normal hook is run by @code{revert-buffer} before
-inserting the modified contents---but only if
-@code{revert-buffer-function} is @code{nil}.
+This normal hook is run by the default @code{revert-buffer-function}
+before inserting the modified contents.  A custom @code{revert-buffer-function}
+may or may not run this hook.
 @end defvar
 
 @defvar after-revert-hook
-This normal hook is run by @code{revert-buffer} after inserting
-the modified contents---but only if @code{revert-buffer-function} is
-@code{nil}.
+This normal hook is run by the default @code{revert-buffer-function}
+after inserting the modified contents.  A custom @code{revert-buffer-function}
+may or may not run this hook.
 @end defvar
 
 @c FIXME?  Move this section from arevert-xtra to here?
 @defvar buffer-stale-function
-The value of this variable, if non-@code{nil}, specifies a function
-to call to check whether a non-file buffer needs reverting
+The value of this variable specifies a function to call to check
+whether a buffer needs reverting.  The default value only handles
+buffers that are visiting files, by checking their modification time.
+Buffers that are not visiting files require a custom function
 @iftex
 (@pxref{Supporting additional buffers,,, emacs-xtra,  Specialized Emacs Features}).
 @end iftex
@@ -772,4 +774,3 @@ to call to check whether a non-file buffer needs reverting
 (@pxref{Supporting additional buffers,,, emacs}).
 @end ifnottex
 @end defvar
-