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

Luke Gorrie lgorrie at common-lisp.net
Tue Dec 16 10:07:31 UTC 2003


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

Modified Files:
	swank.lisp 
Log Message:
(invoke-nth-restart-for-emacs): Wrapper around INVOKE-NTH-RESTART that
checks that Lisp and Emacs agree on the debug level. This detects and
ignores old restart requests when several are sent at once (possible
because of new oneway-eval feature).

(oneway-eval-string): New function to evaluate a string without
sending a result, and with *DEBUGGER-HOOK* bound to NIL. (The debugger
hook is inhibited to avoid state conflicts.)

Date: Tue Dec 16 05:07:31 2003
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.83 slime/swank.lisp:1.84
--- slime/swank.lisp:1.83	Mon Dec 15 14:12:37 2003
+++ slime/swank.lisp	Tue Dec 16 05:07:31 2003
@@ -371,6 +371,19 @@
 (defslimefun sldb-continue ()
   (continue))
 
+(defslimefun invoke-nth-restart-for-emacs (sldb-level n)
+  "Invoke the Nth available restart.
+SLDB-LEVEL is the debug level when the request was made. If this
+has changed, ignore the request."
+  (when (= sldb-level *sldb-level*)
+    (invoke-nth-restart n)))
+
+(defun sldb-break-with-default-debugger ()
+  (let ((*debugger-hook* nil))
+    ;; FIXME: This will break when the SBCL backend starts using the
+    ;; extra sbcl debugger hook.
+    (break)))
+
 (defslimefun eval-string-in-frame (string index)
   (to-string (eval-in-frame (from-string string) index)))
 
@@ -399,6 +412,14 @@
   (when *debugger-hook-passback*
     (setq *debugger-hook* *debugger-hook-passback*)
     (setq *debugger-hook-passback* nil)))
+
+(defslimefun oneway-eval-string (string buffer-package)
+  "Evaluate STRING in BUFFER-PACKAGE, without sending a reply.
+The debugger hook is inhibited during the evaluation."
+  (let ((*buffer-package* (guess-package-from-string buffer-package))
+        (*package* *buffer-package*)
+        (*debugger-hook* nil))
+    (eval (read-form string))))
 
 (defun format-values-for-echo-area (values)
   (cond (values (format nil "~{~S~^, ~}" values))





More information about the slime-cvs mailing list