emacs-diffs
[Top][All Lists]
Advanced

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

master 018cf86605b 1/3: trace.el: use cl-print


From: João Távora
Subject: master 018cf86605b 1/3: trace.el: use cl-print
Date: Wed, 20 Dec 2023 19:58:53 -0500 (EST)

branch: master
commit 018cf86605b0ab1976c01ed5f1b511280c31887d
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    trace.el: use cl-print
    
    Any non-trivial EIEO object in particular is impossible to read in the
    *trace-output* buffer without this.  Functions, hash-tables, etc now
    print as they do in backtrace buffers.
    
    * lisp/emacs-lisp/trace.el (cl-print): Require it
    (trace-entry-message, trace-exit-message): Use cl-prin1-to-string
---
 lisp/emacs-lisp/trace.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index d802648d8ab..3881fe66eb4 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -128,6 +128,8 @@
 
 ;;; Code:
 
+(require 'cl-print)
+
 (defgroup trace nil
   "Tracing facility for Emacs Lisp functions."
   :prefix "trace-"
@@ -168,13 +170,13 @@ and CONTEXT is a string describing the dynamic context 
(e.g. values of
 some global variables)."
   (let ((print-circle t)
         (print-escape-newlines t))
-    (format "%s%s%d -> %S%s\n"
+    (format "%s%s%d -> %s%s\n"
             (mapconcat #'char-to-string (make-string (max 0 (1- level)) ?|) " 
")
             (if (> level 1) " " "")
             level
             ;; FIXME: Make it so we can click the function name to jump to its
             ;; definition and/or untrace it.
-            (cons function args)
+            (cl-prin1-to-string (cons function args))
             context)))
 
 (defun trace-exit-message (function level value context)
@@ -184,13 +186,13 @@ and CONTEXT is a string describing the dynamic context 
(e.g. values of
 some global variables)."
   (let ((print-circle t)
         (print-escape-newlines t))
-    (format "%s%s%d <- %s: %S%s\n"
+    (format "%s%s%d <- %s: %s%s\n"
             (mapconcat 'char-to-string (make-string (1- level) ?|) " ")
             (if (> level 1) " " "")
             level
             function
             ;; Do this so we'll see strings:
-            value
+            (cl-prin1-to-string value)
             context)))
 
 (defvar trace--timer nil)



reply via email to

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