comparison lisp/files.el @ 29391:43abee1ebeca

(convert-standard-filename): Doc fix. (normal-backup-enable-predicate): New function. (backup-enable-predicate): Use it to replace the lambda form.
author Dave Love <fx@gnu.org>
date Fri, 02 Jun 2000 18:42:13 +0000
parents e52d90f01f53
children d5b77185f216
comparison
equal deleted inserted replaced
29390:bc5fce1393f8 29391:43abee1ebeca
131 This variable is relevant only if `backup-by-copying' and 131 This variable is relevant only if `backup-by-copying' and
132 `backup-by-copying-when-mismatch' are nil." 132 `backup-by-copying-when-mismatch' are nil."
133 :type '(choice (const nil) integer) 133 :type '(choice (const nil) integer)
134 :group 'backup) 134 :group 'backup)
135 135
136 (defvar backup-enable-predicate 136 (defun normal-backup-enable-predicate (name)
137 (lambda (name) 137 "Default `backup-enable-predicate' function.
138 (not (or (let ((comp (compare-strings temporary-file-directory 0 nil 138 Checks for files in `temporary-file-directory' or
139 name 0 nil))) 139 `small-temporary-file-directory'."
140 ;; Directory is under temporary-file-directory. 140 (not (or (let ((comp (compare-strings temporary-file-directory 0 nil
141 (and (not (eq comp t)) 141 name 0 nil)))
142 (< comp -1))) 142 ;; Directory is under temporary-file-directory.
143 (if small-temporary-file-directory 143 (and (not (eq comp t))
144 (let ((comp (compare-strings small-temporary-file-directory 144 (< comp -1)))
145 0 nil 145 (if small-temporary-file-directory
146 name 0 nil))) 146 (let ((comp (compare-strings small-temporary-file-directory
147 ;; Directory is under small-temporary-file-directory. 147 0 nil
148 (and (not (eq comp t)) 148 name 0 nil)))
149 (< comp -1))))))) 149 ;; Directory is under small-temporary-file-directory.
150 (and (not (eq comp t))
151 (< comp -1)))))))
152
153 (defvar backup-enable-predicate 'normal-backup-enable-predicate
150 "Predicate that looks at a file name and decides whether to make backups. 154 "Predicate that looks at a file name and decides whether to make backups.
151 Called with an absolute file name as argument, it returns t to enable backup. 155 Called with an absolute file name as argument, it returns t to enable backup.")
152 The default version checks for files in `temporary-file-directory' or
153 `small-temporary-file-directory'.")
154 156
155 (defcustom buffer-offer-save nil 157 (defcustom buffer-offer-save nil
156 "*Non-nil in a buffer means always offer to save buffer on exit. 158 "*Non-nil in a buffer means always offer to save buffer on exit.
157 Do so even if the buffer is not visiting a file. 159 Do so even if the buffer is not visiting a file.
158 Automatically local in all buffers." 160 Automatically local in all buffers."
456 (apply op args)))) 458 (apply op args))))
457 459
458 (defun convert-standard-filename (filename) 460 (defun convert-standard-filename (filename)
459 "Convert a standard file's name to something suitable for the current OS. 461 "Convert a standard file's name to something suitable for the current OS.
460 This function's standard definition is trivial; it just returns the argument. 462 This function's standard definition is trivial; it just returns the argument.
461 However, on some systems, the function is redefined 463 However, on some systems, the function is redefined with a definition
462 with a definition that really does change some file names." 464 that really does change some file names to canonicalize certain
465 patterns and to guarantee valid names."
463 filename) 466 filename)
464 467
465 (defun pwd () 468 (defun pwd ()
466 "Show the current default directory." 469 "Show the current default directory."
467 (interactive nil) 470 (interactive nil)