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

(dired-collect-file-versions): Discard version #s from

arg; then do nothing if already in dired-file-version-alist.
parent d0011c11
......@@ -246,19 +246,24 @@ with a prefix argument."
(forward-line 1)))))
(defun dired-collect-file-versions (fn)
;; "If it looks like file FN has versions, return a list of the versions.
;;That is a list of strings which are file names.
;;The caller may want to flag some of these files for deletion."
(let* ((base-versions
(concat (file-name-nondirectory fn) ".~"))
(bv-length (length base-versions))
(possibilities (file-name-all-completions
base-versions
(file-name-directory fn)))
(versions (mapcar 'backup-extract-version possibilities)))
(if versions
(setq dired-file-version-alist (cons (cons fn versions)
dired-file-version-alist)))))
(let ((fn (file-name-sans-versions fn)))
;; Only do work if this file is not already in the alist.
(if (assoc fn dired-file-version-alist)
nil
;; If it looks like file FN has versions, return a list of the versions.
;;That is a list of strings which are file names.
;;The caller may want to flag some of these files for deletion."
(let* ((base-versions
(concat (file-name-nondirectory fn) ".~"))
(bv-length (length base-versions))
(possibilities (file-name-all-completions
base-versions
(file-name-directory fn)))
(versions (mapcar 'backup-extract-version possibilities)))
(if versions
(setq dired-file-version-alist
(cons (cons fn versions)
dired-file-version-alist)))))))
(defun dired-trample-file-versions (fn)
(let* ((start-vn (string-match "\\.~[0-9]+~$" fn))
......
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