0

I'm trying to read an emacs lisp file and figure out what it's doing and how. Is there some way to turn on some sort of tracing? The file in question is this and I can't figure out where it starts, what calls what. I assume some manner of trace or debugging?

2
  • 2
    Tracing and debugging are possible, but they are tedious. The best thing to do IMO is to read the docs, and then start reading the code. If there is an info file, that's where you should start. For one-file libraries like org-brain, read whatever commentary the author has added at the beginning. In this case, the author mentions org-brain-visualize so that's where you should start: read its doc string and then read the code. Don't try to understand every detail: all you are trying to get is the 10km view. Commented Feb 13 at 22:47
  • emacs.stackexchange.com/tags/elisp/info Commented Feb 14 at 21:04

1 Answer 1

2

If you really want to trace it:

(require 'org-brain)
(mapatoms (lambda (sym)
            (when (and (functionp sym)
                       (string-prefix-p "org-brain-" (symbol-name sym)))
              (trace-function sym))))

Undo that with: M-x untrace-all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.