[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Wed Mar 22 02:46:46 UTC 2006


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

Modified Files:
	swank.lisp 
Log Message:
(inspect-for-emacs): Specialize on FILE-STREAM and STREAM-ERROR,
offering to visit the file at the current stream position as an
inspector action.  Useful for dealing with reader errors.


--- /project/slime/cvsroot/slime/swank.lisp	2006/03/19 06:38:52	1.365
+++ /project/slime/cvsroot/slime/swank.lisp	2006/03/22 02:46:45	1.366
@@ -4134,6 +4134,43 @@
              (label-value-line "Digits" (float-digits f))
              (label-value-line "Precision" (float-precision f))))))
 
+(defmethod inspect-for-emacs ((stream file-stream) inspector)
+  (declare (ignore inspector))
+  (multiple-value-bind (title content)
+      (call-next-method)
+    (declare (ignore title))
+    (values "A file stream."
+            (append
+             `("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)))))
+               (:newline))
+             content))))
+
+(defmethod inspect-for-emacs ((condition stream-error) inspector)
+  (declare (ignore inspector))
+  (multiple-value-bind (title content)
+      (call-next-method)
+    (declare (ignore title))
+    (let ((stream (stream-error-stream condition)))
+      (values "A stream error."
+              (append
+               `("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)))))
+                 (:newline))
+               content)))))
+
 (defvar *inspectee*)
 (defvar *inspectee-parts*) 
 (defvar *inspectee-actions*)




More information about the slime-cvs mailing list