* lisp/vc/add-log.el (change-log-next-buffer): Check if file exists

before adding it to the list of files.
This commit is contained in:
Juri Linkov 2017-02-28 00:53:46 +02:00
parent 61881d32ad
commit 499b43d4cc

View file

@ -1077,14 +1077,16 @@ A sequence of buffers is formed by ChangeLog files with decreasing
numeric file name suffixes in the directory of the initial ChangeLog
file were isearch was started."
(let* ((name (change-log-name))
(files (cons name (sort (file-expand-wildcards
(concat name "[-.][0-9]*"))
(lambda (a b)
;; The file's extension may not have a valid
;; version form (e.g. VC backup revisions).
(ignore-errors
(version< (substring b (length name))
(substring a (length name))))))))
(files (append
(and (file-exists-p name) (list name))
(sort (file-expand-wildcards
(concat name "[-.][0-9]*"))
(lambda (a b)
;; The file's extension may not have a valid
;; version form (e.g. VC backup revisions).
(ignore-errors
(version< (substring b (length name))
(substring a (length name))))))))
(files (if isearch-forward files (reverse files)))
(file (if wrap
(car files)