aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/jka-compr.el
diff options
context:
space:
mode:
authorStefan Monnier2026-03-08 23:28:11 -0400
committerStefan Monnier2026-03-08 23:28:11 -0400
commit225977cda7c819c3bbf018d870c0eedfa92023bd (patch)
treeb81e3e98b3cb651f47ddc96bb926ec62fe0d5fa7 /lisp/jka-compr.el
parent0349286fb6c4d4b4c67b5ae0e51e8ece196fbfb9 (diff)
downloademacs-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/jka-compr.el')
-rw-r--r--lisp/jka-compr.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 8258ab32495..c4643fb2d8c 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -471,22 +471,21 @@ There should be no more than seven characters after the final `/'."
471 ;; If the file we wanted to uncompress does not exist, 471 ;; If the file we wanted to uncompress does not exist,
472 ;; handle that according to VISIT as `insert-file-contents' 472 ;; handle that according to VISIT as `insert-file-contents'
473 ;; would, maybe signaling the same error it normally would. 473 ;; would, maybe signaling the same error it normally would.
474 (if (and (eq (car error-code) 'file-missing) 474 (if (and (error-has-type-p error-code 'file-missing)
475 (eq (nth 3 error-code) local-file)) 475 (eq (error-slot-value error-code 3) local-file))
476 (if visit 476 (if visit
477 (setq notfound error-code) 477 (setq notfound error-code)
478 (signal 'file-missing 478 (setf (error-slot-value error-code 1)
479 (cons "Opening input file" 479 "Opening input file")
480 (nthcdr 2 error-code)))) 480 (signal error-code))
481 ;; If the uncompression program can't be found, 481 ;; If the uncompression program can't be found,
482 ;; signal that as a non-file error 482 ;; signal that as a non-file error
483 ;; so that find-file-noselect-1 won't handle it. 483 ;; so that find-file-noselect-1 won't handle it.
484 (if (and (memq 'file-error (get (car error-code) 484 (if (and (error-has-type-p error-code 'file-error)
485 'error-conditions))
486 (equal (cadr error-code) "Searching for program")) 485 (equal (cadr error-code) "Searching for program"))
487 (error "Uncompression program `%s' not found" 486 (error "Uncompression program `%s' not found"
488 (nth 3 error-code))) 487 (error-slot-value error-code 3))
489 (signal (car error-code) (cdr error-code))))))) 488 (signal error-code)))))))
490 489
491 (and 490 (and
492 local-copy 491 local-copy