haziz
haziz

Reputation: 13602

Suppressing the Debugger in SBCL with Emacs and SLIME?

Putting in the following code into ~/.sbclrc allows me to receive a simplified error message without diving into the debugger (which I find a bit irritating) when using the SBCL REPL from the command line.

 (defun print-condition-hook (condition hook)
  "Print this error message (condition) and abort the current operation."
  (declare (ignore hook))
  (princ condition)
  (clear-input)
  (abort))

(setf *debugger-hook* #'print-condition-hook)

When running the SBCL REPL from within Emacs and SLIME, which is my usual way of interacting with it, the REPL insists on diving into the debugger each time I have an error.

How do I suppress the debugger, while still getting a simplified error message/condition, when working with SBCL from within Emacs and SLIME?

Upvotes: 0

Views: 127

Answers (1)

Xach
Xach

Reputation: 11829

In SBCL, check sb-ext:*invoke-debugger-hook* in addition to cl:*debugger-hook*. SLIME and SLY use both of them, not just one. Updating the former to use your function should give the behavior you want.

The debugger is one of the things that makes Common Lisp nice to use. I can understand turning it off in some limited situations, but it's hard to imagine turning it off all the time, by default.

Upvotes: 3

Related Questions