From: Dmitry Gutov Date: Fri, 30 Jul 2021 12:58:25 +0000 (+0200) Subject: Make fileloop skip missing files X-Git-Tag: emacs-28.0.90~1644 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df1dbaf121703aebae83d2725b7aed8b961f2913;p=emacs.git Make fileloop skip missing files * lisp/fileloop.el (fileloop-next-file): If a file doesn't exist, skip to the next one (bug#44979). --- diff --git a/etc/NEWS b/etc/NEWS index d378a818909..36dc98d8c09 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2340,6 +2340,9 @@ This command, called interactively, toggles the local value of ** Miscellaneous +--- +*** fileloop will now skip missing files instead of signalling an error. + +++ *** ".dir-locals.el" now supports setting 'auto-mode-alist'. The new 'auto-mode-alist' specification in ".dir-locals.el" files can diff --git a/lisp/fileloop.el b/lisp/fileloop.el index 8a2755d69a5..45b9cea9397 100644 --- a/lisp/fileloop.el +++ b/lisp/fileloop.el @@ -120,7 +120,10 @@ operating on the next file and nil otherwise." (kill-all-local-variables) (erase-buffer) (setq new next) - (insert-file-contents new nil)) + (condition-case nil + (insert-file-contents new nil) + (file-missing + (fileloop-next-file novisit)))) new))) (defun fileloop-continue ()