emacs-diffs
[Top][All Lists]
Advanced

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

scratch/bulk-tracing 4c2b11024c: fixup! New commands for bulk tracing of


From: Phil Sainty
Subject: scratch/bulk-tracing 4c2b11024c: fixup! New commands for bulk tracing of elisp functions (bug#27397)
Date: Thu, 14 Jul 2022 22:04:49 -0400 (EDT)

branch: scratch/bulk-tracing
commit 4c2b11024cab593dcd81483975993b25d378fd47
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>

    fixup! New commands for bulk tracing of elisp functions (bug#27397)
---
 etc/NEWS                 |  3 ++-
 lisp/emacs-lisp/trace.el | 16 +++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 3cea3ced82..0f7947283c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1895,7 +1895,8 @@ and friends.
 (and their counterparts 'untrace-package', 'untrace-regexp', and
 'untrace-library') allow for the bulk tracing of calls to functions
 with names matching a specified prefix or regexp, or functions defined
-by a specified file.
+by a specified file.  New command 'trace-currently-traced' lists the
+traced function symbols.
 
 ** Tramp
 
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 9ebaed078a..7cb2baf81b 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -69,6 +69,7 @@
 ;; - To untrace multiple functions by regexp use `M-x untrace-regexp'.
 ;; - To untrace multiple functions by file use `M-x untrace-library'.
 ;; - To untrace all currently traced functions use `M-x untrace-all'.
+;; - To list all currently traced functions use `M-x trace-currently-traced'.
 
 ;; Examples:
 ;; =========
@@ -297,11 +298,16 @@ Autoloaded functions are traceable."
 
 (define-obsolete-function-alias 'trace-is-traced 'trace-is-traced-p "29.1")
 
-(defun trace-currently-traced ()
-  "Return the list of currently traced function symbols."
-  (cl-loop for sym being the symbols
-           if (trace-is-traced-p sym)
-           collect sym))
+(defun trace-currently-traced (&optional display-message)
+  "Return the list of currently traced function symbols.
+Interactively, display the list as a message."
+  (interactive "p")
+  (let ((tracelist (cl-loop for sym being the symbols
+                            if (trace-is-traced-p sym)
+                            collect sym)))
+    (when display-message
+      (message "%S" tracelist))
+    tracelist))
 
 (defun trace--read-function (prompt)
   "Read a function name, prompting with string PROMPT."



reply via email to

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