Mercurial > emacs
changeset 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 | bc5fce1393f8 |
children | 615f40c9b741 |
files | lisp/files.el |
diffstat | 1 files changed, 22 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/files.el Fri Jun 02 18:37:43 2000 +0000 +++ b/lisp/files.el Fri Jun 02 18:42:13 2000 +0000 @@ -133,24 +133,26 @@ :type '(choice (const nil) integer) :group 'backup) -(defvar backup-enable-predicate - (lambda (name) - (not (or (let ((comp (compare-strings temporary-file-directory 0 nil - name 0 nil))) - ;; Directory is under temporary-file-directory. - (and (not (eq comp t)) - (< comp -1))) - (if small-temporary-file-directory - (let ((comp (compare-strings small-temporary-file-directory - 0 nil - name 0 nil))) - ;; Directory is under small-temporary-file-directory. - (and (not (eq comp t)) - (< comp -1))))))) +(defun normal-backup-enable-predicate (name) + "Default `backup-enable-predicate' function. +Checks for files in `temporary-file-directory' or +`small-temporary-file-directory'." + (not (or (let ((comp (compare-strings temporary-file-directory 0 nil + name 0 nil))) + ;; Directory is under temporary-file-directory. + (and (not (eq comp t)) + (< comp -1))) + (if small-temporary-file-directory + (let ((comp (compare-strings small-temporary-file-directory + 0 nil + name 0 nil))) + ;; Directory is under small-temporary-file-directory. + (and (not (eq comp t)) + (< comp -1))))))) + +(defvar backup-enable-predicate 'normal-backup-enable-predicate "Predicate that looks at a file name and decides whether to make backups. -Called with an absolute file name as argument, it returns t to enable backup. -The default version checks for files in `temporary-file-directory' or -`small-temporary-file-directory'.") +Called with an absolute file name as argument, it returns t to enable backup.") (defcustom buffer-offer-save nil "*Non-nil in a buffer means always offer to save buffer on exit. @@ -458,8 +460,9 @@ (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the current OS. This function's standard definition is trivial; it just returns the argument. -However, on some systems, the function is redefined -with a definition that really does change some file names." +However, on some systems, the function is redefined with a definition +that really does change some file names to canonicalize certain +patterns and to guarantee valid names." filename) (defun pwd ()