Many languages have a mechanism to signal an attached debugger to pause or break. For example in JavaScript this is done using the debugger keyword. In others like C# or Visual Basic the signal is generated by a built-in function. This functionality is useful in situations where it is difficult or impossible to set breakpoints using the debugger.

Does elisp have an equivalent?

  • Just add (debug) to your code [Ref]. Commented Jun 9, 2016 at 3:47
  • 1
    Also have a look at debug-on-message variable. Does edebug not help you in your use case? Commented Jun 9, 2016 at 3:49
  • facepalm Thanks :-) debug-on-message looks neat! I seem to have encountered functions instrumented by edebug-defun not pausing in the debugger in certain contexts. I'll create a separate question if the mystery persists.
    – ebpa
    Commented Jun 9, 2016 at 4:01
  • I'm unsure of the proper etiquette here, but as the Q creator I believe I'm entitled to apply arbitrary answer selection criteria. @KaushalModi If you add an equivalent answer to your comment I'll mark it as answered. If you would like to defer to Stefan's answer (which was made after your comment) I'll mark his. In either case the "Explicit Debug" link should be included.
    – ebpa
    Commented Jun 9, 2016 at 4:09
  • No worries. Mark Stefan's answer as the answer :). You can ask him to add that link to his answer so that other users get a lead to learn more about this. Commented Jun 9, 2016 at 4:13

1 Answer 1


Add (debug) and you'll be thrown into a buffer showing you the backtrace and where you can examine the current state.

See: Emacs Manual "Explicit Entry to the Debugger"

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.