diff options
| author | Richard M. Stallman <rms@gnu.org> | 1996-04-03 05:55:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1996-04-03 05:55:12 +0000 |
| commit | cf7e94a0dfbdb1e8b9bcb97e838a3f708f3cd0bb (patch) | |
| tree | 62b08d6ae868f13d155c76e036bf27cb6f5c1c93 /lisp/files.el | |
| parent | 3943fa098eb21ae5f536a9dcd81b5b59aa37df80 (diff) | |
| download | emacs-cf7e94a0dfbdb1e8b9bcb97e838a3f708f3cd0bb.tar.gz | |
(file-newest-backup): Return the newest backup for the
exact file name specified, not the newest backup of all files
whose names start with that substring.
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el index 584aef9f456..6839fcf27dc 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2058,13 +2058,17 @@ saying what text to write." (file (file-name-nondirectory filename)) (dir (file-name-directory filename)) (comp (file-name-all-completions file dir)) - newest) + (newest nil) + tem) (while comp - (setq file (concat dir (car comp)) + (setq tem (car comp) comp (cdr comp)) - (if (and (backup-file-name-p file) - (or (null newest) (file-newer-than-file-p file newest))) - (setq newest file))) + (cond ((and (backup-file-name-p tem) + (string= (file-name-sans-versions tem) file)) + (setq tem (concat dir tem)) + (if (or (null newest) + (file-newer-than-file-p tem newest)) + (setq newest tem))))) newest)) (defun rename-uniquely () |
