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
This commit is contained in:
parent
62bf0b7a57
commit
018cf86605
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue