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/startup.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/startup.el')
| -rw-r--r-- | lisp/startup.el | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 9c1eafdae07..5b8f90a81c4 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1123,15 +1123,12 @@ init-file, or to a default value if loading is not possible." | |||
| 1123 | (display-warning | 1123 | (display-warning |
| 1124 | 'initialization | 1124 | 'initialization |
| 1125 | (format-message "\ | 1125 | (format-message "\ |
| 1126 | An error occurred while loading `%s':\n\n%s%s%s\n\n\ | 1126 | An error occurred while loading `%s':\n\n%s\n\n\ |
| 1127 | To ensure normal operation, you should investigate and remove the | 1127 | To ensure normal operation, you should investigate and remove the |
| 1128 | cause of the error in your initialization file. Start Emacs with | 1128 | cause of the error in your initialization file. Start Emacs with |
| 1129 | the `--debug-init' option to view a complete error backtrace." | 1129 | the `--debug-init' option to view a complete error backtrace." |
| 1130 | user-init-file | 1130 | user-init-file |
| 1131 | (get (car error) 'error-message) | 1131 | (error-message-string error)) |
| 1132 | (if (cdr error) ": " "") | ||
| 1133 | (mapconcat (lambda (s) (prin1-to-string s t)) | ||
| 1134 | (cdr error) ", ")) | ||
| 1135 | :warning) | 1132 | :warning) |
| 1136 | (setq init-file-had-error t)))))) | 1133 | (setq init-file-had-error t)))))) |
| 1137 | 1134 | ||
| @@ -1593,15 +1590,12 @@ please check its value") | |||
| 1593 | (princ | 1590 | (princ |
| 1594 | (if (eq (car error) 'error) | 1591 | (if (eq (car error) 'error) |
| 1595 | (apply #'concat (cdr error)) | 1592 | (apply #'concat (cdr error)) |
| 1596 | (if (memq 'file-error (get (car error) 'error-conditions)) | 1593 | (if (error-has-type-p error 'file-error) |
| 1597 | (format "%s: %s" | 1594 | (format "%s: %s" |
| 1598 | (nth 1 error) | 1595 | (nth 1 error) |
| 1599 | (mapconcat (lambda (obj) (prin1-to-string obj t)) | 1596 | (mapconcat (lambda (obj) (prin1-to-string obj t)) |
| 1600 | (cdr (cdr error)) ", ")) | 1597 | (cdr (cdr error)) ", ")) |
| 1601 | (format "%s: %s" | 1598 | (error-message-string error))) |
| 1602 | (get (car error) 'error-message) | ||
| 1603 | (mapconcat (lambda (obj) (prin1-to-string obj t)) | ||
| 1604 | (cdr error) ", ")))) | ||
| 1605 | 'external-debugging-output) | 1599 | 'external-debugging-output) |
| 1606 | (terpri 'external-debugging-output) | 1600 | (terpri 'external-debugging-output) |
| 1607 | (setq initial-window-system nil) | 1601 | (setq initial-window-system nil) |