diff options
| author | Sean Whitton | 2025-09-02 13:42:26 +0100 |
|---|---|---|
| committer | Sean Whitton | 2025-09-02 15:44:00 +0100 |
| commit | 077a2e8f3b65a9bbdeb5b8c4fb170f9e253cf5c4 (patch) | |
| tree | 90f7c5f2623bb7d1b780a9811c7443b64fcfacda | |
| parent | a6dd36e9b1cf7cabb7848c4fa557015762ce0d6c (diff) | |
| download | emacs-077a2e8f3b65a9bbdeb5b8c4fb170f9e253cf5c4.tar.gz emacs-077a2e8f3b65a9bbdeb5b8c4fb170f9e253cf5c4.zip | |
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).
| -rw-r--r-- | lisp/fileloop.el | 10 |
1 files 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." | |||
| 121 | (kill-all-local-variables) | 121 | (kill-all-local-variables) |
| 122 | (erase-buffer) | 122 | (erase-buffer) |
| 123 | (setq new next) | 123 | (setq new next) |
| 124 | (condition-case nil | 124 | (condition-case err |
| 125 | (insert-file-contents new nil) | 125 | (insert-file-contents new nil) |
| 126 | (file-missing | 126 | (file-missing |
| 127 | (fileloop-next-file novisit)))) | 127 | (fileloop-next-file novisit)) |
| 128 | (file-error | ||
| 129 | ;; See bug#79356 for discussion. | ||
| 130 | (let ((msg (error-message-string err))) | ||
| 131 | (unless (string-search new msg) | ||
| 132 | (setq msg (format "%s: %s" new msg))) | ||
| 133 | (delay-warning 'file-error msg :error))))) | ||
| 128 | new))) | 134 | new))) |
| 129 | 135 | ||
| 130 | (defun fileloop-continue () | 136 | (defun fileloop-continue () |