(defclass tdbg-env (env:environment) ((debugger-hook :initarg :debugger-hoook))) (defun tdbg-env (hook) (make-instance 'tdbg-env :name "TDBG Environment" :io-bindings '() :debugger-hoook hook)) (defmethod env-internals:environment-display-notifier ((env tdbg-env) &key restarts condition) (declare (ignore restarts)) (funcall (slot-value env 'debugger-hook) condition *debugger-hook*)) (defmethod env-internals:environment-display-debugger ((env tdbg-env)) *debug-io*) (defmethod env-internals:confirm-p ((e tdbg-env) &optional msg &rest args) (apply #'y-or-n-p msg args)) (defun test () (let ((hook (lambda (condition hook) (declare (ignore hook)) (describe condition) (throw :foo t)))) (list (catch :foo (env:with-environment ((tdbg-env hook)) (error "foo"))) (catch :foo (env:with-environment ((tdbg-env hook)) (break "foo"))) (catch :foo (let ((*break-on-signals* 'error)) (env:with-environment ((tdbg-env hook)) (break "foo")))) (catch :foo (env:with-environment ((tdbg-env hook)) (invoke-debugger (make-condition 'error))))))) (test) ;=> I wish it returned (T T T T) after printing the four condition descriptions