* Mark H. David [2012-02-06 12:52:04 -0500] wrote:
What am I missing?
You probably didn't read my nor Helmut's recent messages too closely. Anyway, here's the code I'm using.
;; ~/.swank.lisp
(defpackage #:personal (:use #:cl) (:export #:debugger #:*use-swank-debugger*))
(in-package #:personal)
;; This variable is used to switch betwee swank and custom debugger ;; function. (defparameter *use-swank-debugger* nil)
(defvar *swank-debugger-orig* #'swank:swank-debugger-hook)
;; Custom "debugger" (just prints condition, restarts and error message.) (defun debugger (condition previous) (declare (ignore previous)) (with-standard-io-syntax (let ((*print-readably* nil) (*print-length* 50) (*print-level* 5)) (format *error-output* "~%; Condition: ~A~%; Restarts: ~{~A~^ ~}~%; ~A~%" (type-of condition) (mapcar #'restart-name (compute-restarts)) condition) (invoke-restart 'abort))))
;; Redefine swank's debugger function. (defun swank:swank-debugger-hook (condition previous) (if *use-swank-debugger* (funcall *swank-debugger-orig* condition previous) (funcall 'debugger condition previous)))
* Mark H. David [2012-02-06 19:02] writes:
I got lost where Helmut said "works for me". Is this a bug that can be fixed?
*global-debugger* works as it is supposed to: *debugger-hook* is not set in new threads. Avoiding any bindings for *debugger-hook* in SLIME's own threads is more tricky. Providing a different implementation for call-with-debugger-hook would probably work, tho.
Helmut