[mcclim-cvs] CVS mcclim/Apps/Listener

ahefner ahefner at common-lisp.net
Sun Nov 30 22:19:52 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Apps/Listener
In directory cl-net:/tmp/cvs-serv29980

Modified Files:
	dev-commands.lisp 
Log Message:
Two error handling fixes to com-eval: First, don't handle errors when
evaluating in the foreground thread, so that errors can be handled in the
SLIME debugger or similar.. Second, rebind *debugger-hook* if evaluating 
in a background thread.


--- /project/mcclim/cvsroot/mcclim/Apps/Listener/dev-commands.lisp	2008/10/23 20:54:53	1.64
+++ /project/mcclim/cvsroot/mcclim/Apps/Listener/dev-commands.lisp	2008/11/30 22:19:52	1.65
@@ -1516,21 +1516,25 @@
     ((form 'clim:form :prompt "form"))
   (let ((standard-output *standard-output*)
         (standard-input *standard-input*)
+        (debugger-hook *debugger-hook*)
 	(application-frame *application-frame*))
     (flet ((evaluate ()
              (let ((- form)
                    (*standard-output* standard-output)
                    (*standard-input* standard-input)
                    (*error-output* standard-output)
+                   (*debugger-hook* debugger-hook)
 		   (*application-frame* application-frame)
                    error success)
-               (unwind-protect (handler-case (prog1 (cons :values (multiple-value-list (eval form)))
-                                               (setf success t))
-                                 (serious-condition (e)
-                                   (setf error e)
-                                   (error e)))
-                 (when (not success)
-                   (return-from evaluate (cons :error error)))))))
+               (if *use-background-eval*
+                   (unwind-protect (handler-case (prog1 (cons :values (multiple-value-list (eval form)))
+                                                   (setf success t))
+                                     (serious-condition (e)
+                                       (setf error e)
+                                       (error e)))
+                     (when (not success)
+                       (return-from evaluate (cons :error error))))
+                   (cons :values (multiple-value-list (eval form)))))))
       ;; If possible, use a thread for evaluation, permitting us to
       ;; interrupt it.
       (let ((start-time (get-internal-real-time)))





More information about the Mcclim-cvs mailing list