[slime-cvs] CVS slime

alendvai alendvai at common-lisp.net
Wed Jan 3 10:56:14 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv24330

Modified Files:
	slime.el swank.lisp 
Log Message:
Handle better the case when swank can not read anything from the string sent to be inspected.

Only bring up the debugger when the inspect command is prefixed.


--- /project/slime/cvsroot/slime/slime.el	2006/12/29 18:39:15	1.728
+++ /project/slime/cvsroot/slime/slime.el	2007/01/03 10:56:14	1.729
@@ -9133,11 +9133,13 @@
                                            :reset ,(not no-reset)
                                            :eval ,eval
                                            :dwim-mode ,dwim-mode)
-                    (with-lexical-bindings (thread package)
+                    (with-lexical-bindings (thread package form)
                       (lambda (thing)
-                        (slime-open-inspector thing
-                                              :thread thread
-                                              :package package)))))
+                        (if thing
+                            (slime-open-inspector thing
+                                                  :thread thread
+                                                  :package package)
+                            (message "Couldn't read anything from '%s' (hint: prefix for debugger with details)" form))))))
 
 (defun* slime-read-object (prompt &key return-names-unconfirmed)
   "Read a Common Lisp expression from the minibuffer, providing
--- /project/slime/cvsroot/slime/swank.lisp	2006/12/31 12:28:28	1.445
+++ /project/slime/cvsroot/slime/swank.lisp	2007/01/03 10:56:14	1.446
@@ -4880,30 +4880,38 @@
   (with-buffer-syntax ()
     (when reset
       (reset-inspector))
-    (let* ((form (read-from-string string))
-           (value (cond
-                    (dwim-mode
-                     (let ((things (loop for hook :in *inspector-dwim-lookup-hooks*
-                                         for (result foundp) = (multiple-value-list
-                                                                 (funcall hook form))
-                                         when foundp
-                                         append (if (consp result)
-                                                    result
-                                                    (list result)))))
-                       (if (rest things)
-                           things
-                           (first things))))
-                    (eval (eval form))
-                    (t form))))
-      (when (and dwim-mode
-                 form
-                 value)
-        ;; push the form to the inspector stack, so you can go back to it
-        ;; with slime-inspector-pop if dwim missed the intention
-        (push form *inspector-stack*))
-      (inspect-object (if dwim-mode
-                          (or value form)
-                          value)))))
+    (let* ((form (block reading
+                   (handler-bind
+                       ((error (lambda (e)
+                                 (declare (ignore e))
+                                 (when dwim-mode
+                                   (return-from reading 'nothing)))))
+                     (read-from-string string nil 'nothing))))
+           (value))
+      (unless (eq form 'nothing)
+        (setf value (cond
+                      (dwim-mode
+                       (let ((things (loop for hook :in *inspector-dwim-lookup-hooks*
+                                           for (result foundp) = (multiple-value-list
+                                                                     (funcall hook form))
+                                           when foundp
+                                           append (if (consp result)
+                                                      result
+                                                      (list result)))))
+                         (if (rest things)
+                             things
+                             (first things))))
+                      (eval (eval form))
+                      (t form)))
+        (when (and dwim-mode
+                   form
+                   value)
+          ;; push the form to the inspector stack, so you can go back to it
+          ;; with slime-inspector-pop if dwim missed the intention
+          (push form *inspector-stack*))
+        (inspect-object (if dwim-mode
+                            (or value form)
+                            value))))))
 
 (defun print-part-to-string (value)
   (let ((string (to-string value))




More information about the slime-cvs mailing list