From: Stefan Monnier Date: Tue, 2 Mar 2021 14:13:57 +0000 (-0500) Subject: * lisp/emacs-lisp/trace.el (trace-values): Work outside of traced function X-Git-Tag: emacs-28.0.90~3461 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20596a5ca29e879ca81a9209cd57a85a4ae690f2;p=emacs.git * lisp/emacs-lisp/trace.el (trace-values): Work outside of traced function --- diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index fa07d622484..9354687b081 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -161,7 +161,7 @@ "Helper function to get internal values. You can call this function to add internal values in the trace buffer." (unless inhibit-trace - (with-current-buffer trace-buffer + (with-current-buffer (get-buffer-create trace-buffer) (goto-char (point-max)) (insert (trace-entry-message @@ -174,7 +174,7 @@ and CONTEXT is a string describing the dynamic context (e.g. values of some global variables)." (let ((print-circle t)) (format "%s%s%d -> %S%s\n" - (mapconcat 'char-to-string (make-string (1- level) ?|) " ") + (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