[Top][All Lists]

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

scratch/handler-bind-2 bc5500be3b0 15/16: (edebug-format): Make it obsol

From: Stefan Monnier
Subject: scratch/handler-bind-2 bc5500be3b0 15/16: (edebug-format): Make it obsolete
Date: Wed, 27 Dec 2023 23:53:31 -0500 (EST)

branch: scratch/handler-bind-2
commit bc5500be3b0110724b2fccd14b85fbcb130f04d0
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 | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index aa68978f6d6..412bb672627 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2272,8 +2272,8 @@ DATA should be a list.  Its elements are printed as part 
of the error message.
 If the signal is handled, DATA is made available to the handler.
 See `condition-case'.
-This is the Edebug replacement for the standard `signal'.  It should
-only be active while Edebug is.  It checks `debug-on-error' to see
+This is the error handler installed during Edebug.
+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 signaled again."
   (if (and (listp debug-on-error) (memq signal-name debug-on-error))
@@ -3695,9 +3695,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
@@ -3741,7 +3739,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)
@@ -3761,10 +3759,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)
@@ -4346,7 +4341,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]