[slime-cvs] CVS slime

mbaringer mbaringer at common-lisp.net
Sun Apr 8 22:56:18 UTC 2007


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

Modified Files:
	swank.lisp 
Log Message:
(inspector-content-for-emacs): Look for refresh
keyword argument in :action links.
(inspect-whole-thing-action, inspect-show-more-action): Update for
new :action argument handling.
(inspect-for-emacs stream, inspect-for-emacs stream-error): Pass
:refresh nil on :action links.
(action-part-for-emacs): Set both lambda and refresh in the
*inspectee-actions* array.
(inspector-call-nth-action): *inspectee-actions* now holds both
the function and the boolean specifying whether to refresh or not.


--- /project/slime/cvsroot/slime/swank.lisp	2007/04/08 18:55:52	1.472
+++ /project/slime/cvsroot/slime/swank.lisp	2007/04/08 22:56:18	1.473
@@ -4544,9 +4544,7 @@
 		      size)
 	    ,(lambda() 
 	       (let ((*slime-inspect-contents-limit* nil))
-		 (values
-		  (swank::inspect-object thing)
-		  :replace)))))
+		 (swank::inspect-object thing)))))
 
 (defmethod inspect-show-more-action (thing)
   `(:action ,(format nil "~a elements shown. Prompt for how many to inspect..." 
@@ -4554,9 +4552,7 @@
 	    ,(lambda() 
 	       (let ((*slime-inspect-contents-limit* 
 		      (progn (format t "How many elements should be shown? ") (read))))
-		 (values
-		  (swank::inspect-object thing)
-		  :replace)))))
+		 (swank::inspect-object thing)))))
 
 (defmethod inspect-for-emacs ((array array) inspector)
   (declare (ignore inspector))
@@ -5219,7 +5215,8 @@
                         ,(let ((pathname (pathname stream))
                                (position (file-position stream)))
                            (lambda ()
-                             (ed-in-emacs `(,pathname :charpos ,position)))))
+                             (ed-in-emacs `(,pathname :charpos ,position))))
+                        :refresh nil)
                (:newline))
              content))))
 
@@ -5238,7 +5235,8 @@
                               ,(let ((pathname (pathname stream))
                                      (position (file-position stream)))
                                     (lambda ()
-                                      (ed-in-emacs `(,pathname :charpos ,position)))))
+                                      (ed-in-emacs `(,pathname :charpos ,position))))
+                              :refresh nil)
                      (:newline))
                    content))
           (values title content)))))
@@ -5342,8 +5340,8 @@
                    (string #\newline))
                   ((:value obj &optional str) 
                    (value-part-for-emacs obj str))
-                  ((:action label lambda) 
-                   (action-part-for-emacs label lambda)))))))
+                  ((:action label lambda &key (refreshp t)) 
+                   (action-part-for-emacs label lambda refreshp)))))))
 
 (defun assign-index (object vector)
   (let ((index (fill-pointer vector)))
@@ -5355,8 +5353,9 @@
         (or string (print-part-to-string object))
         (assign-index object *inspectee-parts*)))
 
-(defun action-part-for-emacs (label lambda)
-  (list :action label (assign-index lambda *inspectee-actions*)))
+(defun action-part-for-emacs (label lambda refreshp)
+  (list :action label (assign-index (list lambda refreshp)
+                                    *inspectee-actions*)))
   
 (defun inspect-object (object &optional (inspector (make-default-inspector)))
   (push (setq *inspectee* object) *inspector-stack*)
@@ -5380,10 +5379,13 @@
     (inspect-object (inspector-nth-part index))))
 
 (defslimefun inspector-call-nth-action (index &rest args)
-  (multiple-value-bind (value replace) (apply (aref *inspectee-actions* index) args)
-      (if (eq replace :replace)
-	  value
-	  (inspect-object (pop *inspector-stack*)))))
+  (destructuring-bind (action-lambda refreshp)
+      (aref *inspectee-actions* index)
+    (apply action-lambda args)
+    (if refreshp
+        (inspect-object (pop *inspector-stack*))
+        ;; tell emacs that we don't want to refresh the inspector buffer
+        nil)))
 
 (defslimefun inspector-pop ()
   "Drop the inspector stack and inspect the second element.  Return




More information about the slime-cvs mailing list