diff options
| author | Stefan Monnier | 2026-03-08 23:28:11 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2026-03-08 23:28:11 -0400 |
| commit | 225977cda7c819c3bbf018d870c0eedfa92023bd (patch) | |
| tree | b81e3e98b3cb651f47ddc96bb926ec62fe0d5fa7 /lisp/emacs-lisp/bytecomp.el | |
| parent | 0349286fb6c4d4b4c67b5ae0e51e8ece196fbfb9 (diff) | |
| download | emacs-feature/error-API.tar.gz emacs-feature/error-API.zip | |
Use the new error API functionsfeature/error-API
* lisp/epa-file.el (epa-file--find-file-not-found-function):
Use `error-slot-value` and `error-data`.
(epa-file-insert-file-contents): Use `error-has-type-p`,
`error-slot-value`, and `error-data`.
* lisp/jka-compr.el (jka-compr-insert-file-contents):
Use `error-has-type-p` and `error-slot-value` as well as new
re-signaling form of `signal`.
* lisp/simple.el (minibuffer-error-function): Use `error-has-type-p`.
* lisp/startup.el (startup--load-user-init-file):
Use `error-message-string`.
(command-line): Use `error-has-type-p` and `error-message-string`.
* lisp/type-break.el (type-break-demo-life):
Use `error-message-string`.
* lisp/emacs-lisp/bytecomp.el (batch-byte-compile-file):
Use `error-message-string` and `error-has-type-p`.
* lisp/emacs-lisp/edebug.el (edebug-safe-eval, edebug-report-error)
(edebug-eval-expression):
* lisp/emacs-lisp/debug.el (debugger-eval-expression):
Use `error-message-string`.
* lisp/emacs-lisp/ert.el (ert--should-error-handle-error):
Use `error-has-type-p` and `error-type`.
* lisp/net/sasl.el (sasl-error): Use `define-error`.
* lisp/net/tramp-compat.el (tramp-error-type-p): New function.
(tramp-permission-denied, tramp-compat-permission-denied): Use it.
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Use `error-type-p`.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e2d73804eb5..aadfc4c335a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -4966,9 +4966,9 @@ binding slots have been popped." | |||
| 4966 | (unless (and c (symbolp c)) | 4966 | (unless (and c (symbolp c)) |
| 4967 | (byte-compile-warn-x | 4967 | (byte-compile-warn-x |
| 4968 | c "`%S' is not a condition name (in condition-case)" c)) | 4968 | c "`%S' is not a condition name (in condition-case)" c)) |
| 4969 | ;; In reality, the `error-conditions' property is only required | 4969 | ;; In reality, the `error-conditions' property is required only |
| 4970 | ;; for the argument to `signal', not to `condition-case'. | 4970 | ;; for the argument to `signal', not to `condition-case'. |
| 4971 | ;;(unless (consp (get c 'error-conditions)) | 4971 | ;;(unless (error-type-p c) |
| 4972 | ;; (byte-compile-warn | 4972 | ;; (byte-compile-warn |
| 4973 | ;; "`%s' is not a known condition name (in condition-case)" | 4973 | ;; "`%s' is not a known condition name (in condition-case)" |
| 4974 | ;; c)) | 4974 | ;; c)) |
| @@ -5778,24 +5778,13 @@ already up-to-date." | |||
| 5778 | (byte-compile-file file) | 5778 | (byte-compile-file file) |
| 5779 | (condition-case err | 5779 | (condition-case err |
| 5780 | (byte-compile-file file) | 5780 | (byte-compile-file file) |
| 5781 | (file-error | ||
| 5782 | (message (if (cdr err) | ||
| 5783 | ">>Error occurred processing %s: %s (%s)" | ||
| 5784 | ">>Error occurred processing %s: %s") | ||
| 5785 | file | ||
| 5786 | (get (car err) 'error-message) | ||
| 5787 | (prin1-to-string (cdr err))) | ||
| 5788 | (let ((destfile (byte-compile-dest-file file))) | ||
| 5789 | (if (file-exists-p destfile) | ||
| 5790 | (delete-file destfile))) | ||
| 5791 | nil) | ||
| 5792 | (error | 5781 | (error |
| 5793 | (message (if (cdr err) | 5782 | (message ">>Error occurred processing %s: %s" |
| 5794 | ">>Error occurred processing %s: %s (%s)" | 5783 | file (error-message-string err)) |
| 5795 | ">>Error occurred processing %s: %s") | 5784 | (when (error-has-type-p err 'file-error) |
| 5796 | file | 5785 | (let ((destfile (byte-compile-dest-file file))) |
| 5797 | (get (car err) 'error-message) | 5786 | (if (file-exists-p destfile) |
| 5798 | (prin1-to-string (cdr err))) | 5787 | (delete-file destfile)))) |
| 5799 | nil))))) | 5788 | nil))))) |
| 5800 | 5789 | ||
| 5801 | (defun byte-compile-refresh-preloaded () | 5790 | (defun byte-compile-refresh-preloaded () |