diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-27 15:10:47 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-27 15:10:47 -0400 |
commit | e638aaf6e82aa9eeb5e5723b995d3295b53fa6c9 (patch) | |
tree | e33298e38b3e51ede7a882b649ef65f153316120 /lisp/files.el | |
parent | d322adabf240a2b39f1b937b8e86009c32be9620 (diff) | |
download | emacs-e638aaf6e82aa9eeb5e5723b995d3295b53fa6c9.tar.gz emacs-e638aaf6e82aa9eeb5e5723b995d3295b53fa6c9.tar.bz2 emacs-e638aaf6e82aa9eeb5e5723b995d3295b53fa6c9.zip |
* lisp/files.el (file-backup-file-names): Don't burp if dir doesn't exist
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/files.el b/lisp/files.el index 1e1ec6127de..b953961aa18 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6127,16 +6127,17 @@ recent files are first." (let* ((filename (file-name-sans-versions (make-backup-file-name (expand-file-name filename)))) (dir (file-name-directory filename))) - (sort - (seq-filter - (lambda (candidate) - (and (backup-file-name-p candidate) - (string= (file-name-sans-versions candidate) filename))) - (mapcar - (lambda (file) - (concat dir file)) - (file-name-all-completions (file-name-nondirectory filename) dir))) - #'file-newer-than-file-p))) + (when (file-directory-p dir) + (sort + (seq-filter + (lambda (candidate) + (and (backup-file-name-p candidate) + (string= (file-name-sans-versions candidate) filename))) + (mapcar + (lambda (file) + (concat dir file)) + (file-name-all-completions (file-name-nondirectory filename) dir))) + #'file-newer-than-file-p)))) (defun rename-uniquely () "Rename current buffer to a similar name not already taken. |