From df1dbaf121703aebae83d2725b7aed8b961f2913 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 30 Jul 2021 14:58:25 +0200 Subject: Make fileloop skip missing files * lisp/fileloop.el (fileloop-next-file): If a file doesn't exist, skip to the next one (bug#44979). --- lisp/fileloop.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp/fileloop.el') 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 () -- cgit v1.2.3