[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Sat Mar 7 19:10:06 UTC 2009


Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv27016/contrib

Modified Files:
	swank-fancy-inspector.lisp ChangeLog 
Log Message:
	* swank-fancy-inspector.lisp (make-visit-file-thunk): New helper;
	extracted from emacs-inspect [file-stream].
	([method] emacs-inspect file-stream): Use it.
	([method] emacs-inspect stream-error): Use it, too.


--- /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp	2009/02/26 22:48:15	1.18
+++ /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp	2009/03/07 19:10:06	1.19
@@ -657,6 +657,12 @@
                 (label-value-line "Digits" (float-digits f))
                 (label-value-line "Precision" (float-precision f)))))))
 
+(defun make-visit-file-thunk (stream)
+  (let ((pathname (pathname stream))
+        (position (file-position stream)))
+    (lambda ()
+      (ed-in-emacs `(,pathname :charpos ,position)))))
+
 (defmethod emacs-inspect ((stream file-stream))
   (multiple-value-bind (content)
       (call-next-method)
@@ -664,13 +670,11 @@
              `("Pathname: "
                (:value ,(pathname stream))
                (:newline) "  "
-               (:action "[visit file and show current position]"
-                        ,(let ((pathname (pathname stream))
-                               (position (file-position stream)))
-                           (lambda ()
-                             (ed-in-emacs `(,pathname :charpos ,position))))
-                        :refreshp nil)
-               (:newline))
+               ,@(when (open-stream-p stream)
+                   `((:action "[visit file and show current position]"
+                              ,(make-visit-file-thunk stream)
+                              :refreshp nil)
+                     (:newline))))
              content)))
 
 (defmethod emacs-inspect ((condition stream-error))
@@ -684,12 +688,9 @@
                      (:newline) "  "
                      ,@(when (open-stream-p stream)
                          `((:action "[visit file and show current position]"
-                                    ,(let ((pathname (pathname stream))
-                                           (position (file-position stream)))
-                                          (lambda ()
-                                            (ed-in-emacs `(,pathname :charpos ,position))))
-                                    :refreshp nil)))
-                     (:newline))
+                                    ,(make-visit-file-thunk stream)
+                                    :refreshp nil)
+                           (:newline))))
                    content)
           content))))
 
--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/03/04 17:59:19	1.188
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/03/07 19:10:06	1.189
@@ -1,3 +1,10 @@
+2009-03-08  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* swank-fancy-inspector.lisp (make-visit-file-thunk): New helper;
+	extracted from emacs-inspect [file-stream].
+	([method] emacs-inspect file-stream): Use it.
+	([method] emacs-inspect stream-error): Use it, too.
+
 2009-03-04  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* slime-asdf.el: Really do the commit from entry 2009-02-28.





More information about the slime-cvs mailing list