emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master df1dbaf: Make fileloop skip missing files


From: Lars Ingebrigtsen
Subject: master df1dbaf: Make fileloop skip missing files
Date: Fri, 30 Jul 2021 09:01:01 -0400 (EDT)

branch: master
commit df1dbaf121703aebae83d2725b7aed8b961f2913
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make fileloop skip missing files
    
    * lisp/fileloop.el (fileloop-next-file): If a file doesn't exist,
    skip to the next one (bug#44979).
---
 etc/NEWS         | 3 +++
 lisp/fileloop.el | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index d378a81..36dc98d 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 8a2755d..45b9cea 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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]