[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/handler-bind e7c19f33112 09/12: (edebug-format): Make it obsolet

From: Stefan Monnier
Subject: scratch/handler-bind e7c19f33112 09/12: (edebug-format): Make it obsolete
Date: Mon, 25 Dec 2023 23:56:51 -0500 (EST)

branch: scratch/handler-bind
commit e7c19f33112a480199053de983552d2c9a91b143
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (edebug-format): Make it obsolete
    * lisp/emacs-lisp/edebug.el (edebug-safe-eval, edebug-eval-expression):
    Use `error-message-string`.
    (edebug-format): Make it obsolete.
    (edebug-trace-display): Adjust accordingly.
 lisp/emacs-lisp/edebug.el | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 2a1851dee58..5c5ce3747d4 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2273,7 +2273,7 @@ If the signal is handled, DATA is made available to the 
 See `condition-case'.
 This is the error handler installed during Edebug.
-It should only be active while Edebug is.  It checks `debug-on-error' to see
+It should be active only while Edebug is.  It checks `debug-on-error' to see
 whether it should call the debugger.  When execution is resumed, the
 error is propagated further."
   (if (and (listp debug-on-error) (memq (car err) debug-on-error))
@@ -3687,9 +3687,7 @@ Return the result of the last expression."
   ;; If there is an error, a string is returned describing the error.
   (condition-case edebug-err
       (edebug-eval expr)
-    (error (edebug-format "%s: %s"  ;; could
-                         (get (car edebug-err) 'error-message)
-                         (car (cdr edebug-err))))))
+    (error (error-message-string edebug-err))))
 ;;; Printing
@@ -3733,7 +3731,7 @@ Return the result of the last expression."
 ;;; Read, Eval and Print
 (defalias 'edebug-prin1-to-string #'cl-prin1-to-string)
-(defalias 'edebug-format #'format-message)
+(define-obsolete-function-alias 'edebug-format #'format-message "30.1")
 (defalias 'edebug-message #'message)
 (defun edebug-eval-expression (expr &optional pp)
@@ -3753,10 +3751,7 @@ this is the prefix key.)"
              (condition-case err
                  (edebug-eval expr)
-                (setq errored
-                      (format "%s: %s"
-                             (get (car err) 'error-message)
-                             (car (cdr err)))))))))
+                (setq errored (error-message-string err)))))))
           (unless errored
             (values--store-value value)
@@ -4338,7 +4333,7 @@ You must include newlines in FMT to break lines, but one 
newline is appended."
     (setq truncate-lines t)
     (setq buf-window (selected-window))
     (goto-char (point-max))
-    (insert (apply #'edebug-format fmt args) "\n")
+    (insert (apply #'format-message fmt args) "\n")
     ;; Make it visible.
     (vertical-motion (- 1 (window-height)))
     (set-window-start buf-window (point))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]