aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-08-22 18:08:50 +0000
committerDave Love2000-08-22 18:08:50 +0000
commitbae2aa40bb1b47425830dfef8e65763319f30c99 (patch)
tree661ec93fb7406ea744e719f2b753a904eb560cc8
parent719e2c6e9d55d169a28d2b4d30102a0e22efb392 (diff)
downloademacs-bae2aa40bb1b47425830dfef8e65763319f30c99.tar.gz
emacs-bae2aa40bb1b47425830dfef8e65763319f30c99.zip
normal-backup-enable-predicate, backup-directory-alist,
make-backup-file-name-function
-rw-r--r--lispref/backups.texi50
1 files changed, 42 insertions, 8 deletions
diff --git a/lispref/backups.texi b/lispref/backups.texi
index d26d0dc4c90..bed1498f121 100644
--- a/lispref/backups.texi
+++ b/lispref/backups.texi
@@ -94,14 +94,10 @@ one argument, a file name to consider. If the function returns
94@code{nil}, backups are disabled for that file. Otherwise, the other 94@code{nil}, backups are disabled for that file. Otherwise, the other
95variables in this section say whether and how to make backups. 95variables in this section say whether and how to make backups.
96 96
97The default value is this: 97@findex normal-backup-enable-predicate
98 98The default value is @code{normal-backup-enable-predicate}, which checks
99@example 99for files in @code{temporary-file-directory} and
100(lambda (name) 100@code{small-temporary-file-directory}.
101 (or (< (length name) 5)
102 (not (string-equal "/tmp/"
103 (substring name 0 5)))))
104@end example
105@end defvar 101@end defvar
106 102
107@defvar backup-inhibited 103@defvar backup-inhibited
@@ -117,6 +113,44 @@ its value. Major modes should not set this variable---they should set
117@code{make-backup-files} instead. 113@code{make-backup-files} instead.
118@end defvar 114@end defvar
119 115
116@defvar backup-directory-alist
117This variable's value is an alist of filename patterns and backup
118directory names. Each element looks like
119@smallexample
120(@var{regexp} . @var{directory})
121@end smallexample
122
123@noindent
124Backups of files with names matching @var{regexp} will be made in
125@var{directory}. @var{directory} may be relative or absolute. If it is
126absolute, so that all matching files are backed up into the same
127directory, the file names in this directory will be the full name of the
128file backed up with all directory separators changed to @samp{!} to
129prevent clashes. This will not work correctly if your filesystem
130truncates the resulting name.
131
132For the common case of all backups going into one directory, the alist
133should contain a single element pairing @samp{"."} with the appropriate
134directory name.
135
136If this variable is @code{nil}, or it fails to match a filename, the
137backup is made in the original file's directory.
138
139On MS-DOS filesystems without long names this variable is always
140ignored.
141@end defvar
142
143@defvar make-backup-file-name-function
144This variable's value is a function to use for making backups instead of
145the default @code{make-backup-file-name}. A value of nil gives the
146default @code{make-backup-file-name} behaviour.
147
148This could be buffer-local to do something special for for specific
149files. If you define it, you may need to change
150@code{backup-file-name-p} and @code{file-name-sans-versions} too.
151@end defvar
152
153
120@node Rename or Copy 154@node Rename or Copy
121@subsection Backup by Renaming or by Copying? 155@subsection Backup by Renaming or by Copying?
122@cindex backup files, how to make them 156@cindex backup files, how to make them