diff options
| author | Dave Love | 2000-08-22 18:08:50 +0000 |
|---|---|---|
| committer | Dave Love | 2000-08-22 18:08:50 +0000 |
| commit | bae2aa40bb1b47425830dfef8e65763319f30c99 (patch) | |
| tree | 661ec93fb7406ea744e719f2b753a904eb560cc8 /lispref | |
| parent | 719e2c6e9d55d169a28d2b4d30102a0e22efb392 (diff) | |
| download | emacs-bae2aa40bb1b47425830dfef8e65763319f30c99.tar.gz emacs-bae2aa40bb1b47425830dfef8e65763319f30c99.zip | |
normal-backup-enable-predicate, backup-directory-alist,
make-backup-file-name-function
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/backups.texi | 50 |
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 |
| 95 | variables in this section say whether and how to make backups. | 95 | variables in this section say whether and how to make backups. |
| 96 | 96 | ||
| 97 | The default value is this: | 97 | @findex normal-backup-enable-predicate |
| 98 | 98 | The default value is @code{normal-backup-enable-predicate}, which checks | |
| 99 | @example | 99 | for 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 | ||
| 117 | This variable's value is an alist of filename patterns and backup | ||
| 118 | directory names. Each element looks like | ||
| 119 | @smallexample | ||
| 120 | (@var{regexp} . @var{directory}) | ||
| 121 | @end smallexample | ||
| 122 | |||
| 123 | @noindent | ||
| 124 | Backups of files with names matching @var{regexp} will be made in | ||
| 125 | @var{directory}. @var{directory} may be relative or absolute. If it is | ||
| 126 | absolute, so that all matching files are backed up into the same | ||
| 127 | directory, the file names in this directory will be the full name of the | ||
| 128 | file backed up with all directory separators changed to @samp{!} to | ||
| 129 | prevent clashes. This will not work correctly if your filesystem | ||
| 130 | truncates the resulting name. | ||
| 131 | |||
| 132 | For the common case of all backups going into one directory, the alist | ||
| 133 | should contain a single element pairing @samp{"."} with the appropriate | ||
| 134 | directory name. | ||
| 135 | |||
| 136 | If this variable is @code{nil}, or it fails to match a filename, the | ||
| 137 | backup is made in the original file's directory. | ||
| 138 | |||
| 139 | On MS-DOS filesystems without long names this variable is always | ||
| 140 | ignored. | ||
| 141 | @end defvar | ||
| 142 | |||
| 143 | @defvar make-backup-file-name-function | ||
| 144 | This variable's value is a function to use for making backups instead of | ||
| 145 | the default @code{make-backup-file-name}. A value of nil gives the | ||
| 146 | default @code{make-backup-file-name} behaviour. | ||
| 147 | |||
| 148 | This could be buffer-local to do something special for for specific | ||
| 149 | files. 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 |