[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Thu Feb 28 19:44:14 UTC 2008


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

Modified Files:
	swank-sbcl.lisp 
Log Message:

* swank.lisp (find-definition-for-thing): New DEFSLIMEFUN.

* swank-backend (find-source-location): New DEFINTERFACE.

* swank-sbcl (find-source-location): Implement it.

* slime.el (slime-edit-definition-cont): Use `slime-length='.


--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/02/28 19:37:57	1.192
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/02/28 19:44:14	1.193
@@ -494,6 +494,32 @@
                      (make-source-location-specification type name
                                                          source-location))))
 
+(defimplementation find-source-location (obj)
+  (flet ((general-type-of (obj)
+           (typecase obj
+             (method             :method)
+             (generic-function   :generic-function)
+             (function           :function)
+             (structure-class    :structure-class)
+             (class              :class)
+             (method-combination :method-combination)
+             (structure-object   :structure-object)
+             (standard-object    :standard-object)
+             (condition          :condition)
+             (t                  :thing)))
+         (to-string (obj)
+           (typecase obj
+             ((or structure-object standard-object condition)
+              (with-output-to-string (s)
+                (print-unreadable-object (obj s :type t :identity t))))
+             (t (format nil "~A" obj)))))
+    (handler-case
+        (make-definition-source-location
+         (sb-introspect:find-definition-source obj) (general-type-of obj) (to-string obj))
+      (error (e)
+        (list :error (format nil "Error: ~A" e))))))
+
+
 (defun make-source-location-specification (type name source-location)
   (list (list* (getf *definition-types* type)
                name




More information about the slime-cvs mailing list