From 077a2e8f3b65a9bbdeb5b8c4fb170f9e253cf5c4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 2 Sep 2025 13:42:26 +0100 Subject: [PATCH] fileloop-next-file: Convert file-error to warnings * lisp/fileloop.el (fileloop-next-file): Catch file-error and convert to a delayed warning (bug#79356). --- lisp/fileloop.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/fileloop.el b/lisp/fileloop.el index d7d2aa7e0d5..a302719bcd5 100644 --- a/lisp/fileloop.el +++ b/lisp/fileloop.el @@ -121,10 +121,16 @@ operating on the next file and nil otherwise." (kill-all-local-variables) (erase-buffer) (setq new next) - (condition-case nil + (condition-case err (insert-file-contents new nil) (file-missing - (fileloop-next-file novisit)))) + (fileloop-next-file novisit)) + (file-error + ;; See bug#79356 for discussion. + (let ((msg (error-message-string err))) + (unless (string-search new msg) + (setq msg (format "%s: %s" new msg))) + (delay-warning 'file-error msg :error))))) new))) (defun fileloop-continue ()