[slime-cvs] CVS update: slime/swank.lisp

Helmut Eller heller at common-lisp.net
Wed Sep 21 20:44:56 UTC 2005


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv13168

Modified Files:
	swank.lisp 
Log Message:
(throw-to-toplevel): Invoke the `abort-restart' request instead of
throwing to the `slime-toplevel' catch tag.
(handle-request): Rename the restart from abort to abort-request.
(call-with-connection): Remove the slime-toplevel catch tag because
with-connection is used in far to many places which aren't at "toplevel".
Date: Wed Sep 21 22:44:26 2005
Author: heller

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.339 slime/swank.lisp:1.340
--- slime/swank.lisp:1.339	Wed Sep 21 13:41:51 2005
+++ slime/swank.lisp	Wed Sep 21 22:43:17 2005
@@ -278,10 +278,9 @@
 
 (defun call-with-connection (connection fun)
   (let ((*emacs-connection* connection))
-    (catch 'slime-toplevel
-      (with-io-redirection (*emacs-connection*)
-        (let ((*debugger-hook* #'swank-debugger-hook))
-          (funcall fun))))))
+    (with-io-redirection (*emacs-connection*)
+      (let ((*debugger-hook* #'swank-debugger-hook))
+        (funcall fun)))))
 
 (defmacro without-interrupts (&body body)
   `(call-without-interrupts (lambda () , at body)))
@@ -479,7 +478,7 @@
   (let ((*swank-state-stack* '(:handle-request))
 	(*debugger-hook* nil))
     (with-connection (connection)
-      (with-simple-restart (abort "Abort handling SLIME request.")
+      (with-simple-restart (abort-request "Abort handling SLIME request.")
         (read-from-emacs)))))
 
 (defun current-socket-io ()
@@ -2174,12 +2173,15 @@
   (continue))
 
 (defslimefun throw-to-toplevel ()
-  "Use THROW to abort an RPC from Emacs.
+  "Invoke the ABORT-REQUEST restart abort an RPC from Emacs.
 If we are not evaluating an RPC then ABORT instead."
-  (ignore-errors (throw 'slime-toplevel nil))
-  ;; If we get here then there was no catch. Try aborting as a fallback.
-  ;; That makes the 'q' command in SLDB safer to use with threads.
-  (abort))
+  (let ((restart (find-restart 'abort-request)))
+    (cond (restart (invoke-restart restart))
+          (t
+           ;; If we get here then there was no catch. Try aborting as
+           ;; a fallback.  That makes the 'q' command in SLDB safer to
+           ;; use with threads.
+           (abort)))))
 
 (defslimefun invoke-nth-restart-for-emacs (sldb-level n)
   "Invoke the Nth available restart.




More information about the slime-cvs mailing list