How to debug elisp?

prosseek picture prosseek · Jul 15, 2010 · Viewed 19.3k times · Source

Normally the easiest way to debug is using printf. What can I do to debug emacs-lisp? How can I print something to emacs editor from elisp? Or is there any way to debug elisp code?

For example, how can I check if the following code is run in .emacs file?

(load "auctex.el" nil t t)

Answer

Trey Jackson picture Trey Jackson · Jul 15, 2010

The debugger (edebug) is pretty straight forward to use. Go to the definition of the function, and type M-x edebug-defun. The next time it is called, you'll be able to step through the code as with every other debugger. Type ? for the list of keybindings, or check out the documentation for edebug.