aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el27
-rw-r--r--lisp/emacs-lisp/debug.el4
-rw-r--r--lisp/emacs-lisp/edebug.el18
-rw-r--r--lisp/emacs-lisp/ert.el9
4 files changed, 16 insertions, 42 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 ()
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index bcea708c678..3019ada1bbd 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -560,9 +560,7 @@ The environment used is the one when entering the activation frame at point."
560 (condition-case err 560 (condition-case err
561 (backtrace-eval exp nframe base) 561 (backtrace-eval exp nframe base)
562 (error (setq errored 562 (error (setq errored
563 (format "%s: %s" 563 (error-message-string err)))))))
564 (get (car err) 'error-message)
565 (car (cdr err)))))))))
566 (if errored 564 (if errored
567 (progn 565 (progn
568 (message "Error: %s" errored) 566 (message "Error: %s" errored)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 5cb781cb39f..3bb12e18842 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3745,9 +3745,7 @@ Return the result of the last expression."
3745 ;; If there is an error, a string is returned describing the error. 3745 ;; If there is an error, a string is returned describing the error.
3746 (condition-case edebug-err 3746 (condition-case edebug-err
3747 (edebug-eval expr) 3747 (edebug-eval expr)
3748 (error (edebug-format "%s: %s" ;; could 3748 (error (error-message-string edebug-err))))
3749 (get (car edebug-err) 'error-message)
3750 (car (cdr edebug-err))))))
3751 3749
3752;;; Printing 3750;;; Printing
3753 3751
@@ -3755,14 +3753,7 @@ Return the result of the last expression."
3755(defun edebug-report-error (value) 3753(defun edebug-report-error (value)
3756 ;; Print an error message like command level does. 3754 ;; Print an error message like command level does.
3757 ;; This also prints the error name if it has no error-message. 3755 ;; This also prints the error name if it has no error-message.
3758 (message "%s: %s" 3756 (message "%s" (error-message-string value)))
3759 (or (get (car value) 'error-message)
3760 (format "peculiar error (%s)" (car value)))
3761 (mapconcat (lambda (edebug-arg)
3762 ;; continuing after an error may
3763 ;; complain about edebug-arg. why??
3764 (prin1-to-string edebug-arg))
3765 (cdr value) ", ")))
3766 3757
3767;; Alternatively, we could change the definition of 3758;; Alternatively, we could change the definition of
3768;; edebug-safe-prin1-to-string to only use these if defined. 3759;; edebug-safe-prin1-to-string to only use these if defined.
@@ -3812,10 +3803,7 @@ this is the prefix key.)"
3812 (condition-case err 3803 (condition-case err
3813 (edebug-eval expr) 3804 (edebug-eval expr)
3814 (error 3805 (error
3815 (setq errored 3806 (setq errored (error-message-string err)))))))
3816 (format "%s: %s"
3817 (get (car err) 'error-message)
3818 (car (cdr err)))))))))
3819 (result 3807 (result
3820 (unless errored 3808 (unless errored
3821 (values--store-value value) 3809 (values--store-value value)
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index d5e0afe3b92..6dacd568c7a 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -396,12 +396,11 @@ Returns nil."
396 396
397Determines whether CONDITION matches TYPE and EXCLUDE-SUBTYPES, 397Determines whether CONDITION matches TYPE and EXCLUDE-SUBTYPES,
398and aborts the current test as failed if it doesn't." 398and aborts the current test as failed if it doesn't."
399 (let ((signaled-conditions (get (car condition) 'error-conditions)) 399 (let ((handled-conditions (pcase-exhaustive type
400 (handled-conditions (pcase-exhaustive type
401 ((pred listp) type) 400 ((pred listp) type)
402 ((pred symbolp) (list type))))) 401 ((pred symbolp) (list type)))))
403 (cl-assert signaled-conditions) 402 (unless (cl-some (lambda (hc) (error-has-type-p condition hc))
404 (unless (cl-intersection signaled-conditions handled-conditions) 403 handled-conditions)
405 (ert-fail (append 404 (ert-fail (append
406 (funcall form-description-fn) 405 (funcall form-description-fn)
407 (list 406 (list
@@ -409,7 +408,7 @@ and aborts the current test as failed if it doesn't."
409 :fail-reason (concat "the error signaled did not" 408 :fail-reason (concat "the error signaled did not"
410 " have the expected type"))))) 409 " have the expected type")))))
411 (when exclude-subtypes 410 (when exclude-subtypes
412 (unless (member (car condition) handled-conditions) 411 (unless (member (error-type condition) handled-conditions)
413 (ert-fail (append 412 (ert-fail (append
414 (funcall form-description-fn) 413 (funcall form-description-fn)
415 (list 414 (list