Fork me on GitHub
#cider
<
2023-02-11
>
bschrag17:02:36

I'd often like to trace a certain set of functions---not everything in the namespace. Is there a way to do this programmatically, instead of tracing each function individually using C-c M-t v (`*cider*-toggle-trace-*var*`)?

Benjamin11:02:43

This works I think:

(defun cider-crm-trace-vars ()
  (interactive)
  (mapc #'cider--toggle-trace-var
        (completing-read-multiple "Trace them: " 
                                  (mapcar #'car (imenu--make-index-alist)))))
do you want to select from multiple namespaces or the current one?

Benjamin11:02:30

ah you type , btw to select multiple in completing-read-multiple (whatever value crm-separator is)

bschrag19:02:04

@U02CV2P4J6S Even more programmatic: (mapc #'cider--toggle-trace-var '("<f1>" "<f2>")). Thanks!

Benjamin08:02:42

with <f1> etc you mean passing in symbol names right?