Commit cf7e94a0 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 3943fa09
......@@ -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 nil)
(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)))))
(defun rename-uniquely ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment