1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

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).
This commit is contained in:
Sean Whitton 2025-09-02 13:42:26 +01:00
parent a6dd36e9b1
commit 077a2e8f3b

View file

@ -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 ()