[slime-devel] swank:slime-debugger-function ?

Thomas F. Burdick tfb at OCF.Berkeley.EDU
Sat May 1 19:27:50 UTC 2004


Helmut Eller writes:
 > Pierre-François Gomez <pierre-francois.gomez at NOSPAM-laposte.net> writes:
 > 
 > > Has it been replaced by something else ?
 > 
 > Sort of.  I'm not familiar with Araneida, but it might work if you do:
 > 
 >  (setf *restart-on-handler-errors* #'swank:swank-debugger-hook)

Nope, araneida:*restart-on-handler-errors* is a function of one
argument, the condition.  This should work, though:

  (setf *restart-on-handler-errors* 'swank::debug-in-emacs)

What I do is something like this:

  (defvar *debug* t)

  (defmethod handle-request :around ((handler my-handler) request)
    (if *debug*
        (let ((*debugger-hook* 'swank:swank-debugger-hook))
          (handler-bind ((error #'invoke-debugger))
            (call-next-method)))
        (call-next-method)))

When *debug* is true, the call to handle-request (which in turn calls
the various handle-request-* functions) is wrapped in code that
catches any errors and sends them to the slime debugger.  Of course,
my app already needed that :around method for other reasons.

I assume this will all work right with the threaded listener; I use
the serve-event based one.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               




More information about the slime-devel mailing list