1

According to this question, I can customize the variable *DEBUGGER-HOOK* so that it falls back to toplevel (in REPL) instead of the debugger. I've added this line to my ~/.sbclrc and it's all fine when I start sbcl from command line.

(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (print c) (abort)))

But, the above doesn't work for Emacs SLIME. Whenever I compile/load a file (C-c C-k), it still invokes the debugger (with options like abort calculation, restart, enter new value etc.). How can I ask SLIME to just print the error message and throw me back to toplevel? Yea, it's with SBCL and the same ~/.sbclrc as before. Looks like SLIME doesn't respect a user's setting of *DEBUGGER-HOOK*.

Community
  • 1
  • 1
Satish
  • 78
  • 6
  • I imagine `*DEBUGGER-HOOK*` refers to the implementation's debugger. It is part of the standard. So, I don't think SLIME is required to respect it. – Faheem Mitha Apr 21 '13 at 12:32
  • @FaheemMitha Yes, it is part of the Common Lisp standard: http://clhs.lisp.se/Body/v_debugg.htm – Satish Apr 21 '13 at 20:33

1 Answers1

1

As per http://common-lisp.net/project/slime/doc/html/Other-configurables.html setting SWANK:*GLOBAL-DEBUGGER* to nil in ~/.swank.lisp file should force SLIME to not replace *DEBUGGER-HOOK* to SWANK:SWANK-DEBUGGER-HOOK (which shows list of restarts etc.), but it somehow doesn't work for me, i.e. SWANK:*GLOBAL-DEBUGGER* is nil but anyway *DEBUGGER-HOOK* is replaced by SLIME. Maybe you'll be more lucky.

As a workaround I can propose to set *DEBUGGER-HOOK* to whatever you want in the slime-repl buffer manually, which is worked for me.

cybevnm
  • 2,586
  • 4
  • 30
  • 33
  • Doesn't work, just like for you. I put `(setq SWANK:*GLOBAL-DEBUGGER* nil)` in ~/.swank.lisp but has no effect. I can set `*debugger-hook*` in the REPL, but that's clumsy to do every time. I'm thinking of asking this in the slime-devel mailing list, if no one on SO gets it. – Satish Apr 22 '13 at 19:33