changeset 14927:645493140921

(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.
author Richard M. Stallman <rms@gnu.org>
date Wed, 03 Apr 1996 05:55:12 +0000
parents 963288ebadeb
children 3c06e0acc205
files lisp/files.el
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Wed Apr 03 04:51:35 1996 +0000
+++ b/lisp/files.el	Wed Apr 03 05:55:12 1996 +0000
@@ -2058,13 +2058,17 @@
 	 (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 ()