[slime-cvs] CVS slime
gcarncross
gcarncross at common-lisp.net
Thu Apr 24 01:25:05 UTC 2008
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv6500
Modified Files:
swank-ecl.lisp
Log Message:
Initial support for find-source-location with functions
--- /project/slime/cvsroot/slime/swank-ecl.lisp 2008/04/17 14:56:43 1.16
+++ /project/slime/cvsroot/slime/swank-ecl.lisp 2008/04/24 01:25:05 1.17
@@ -302,6 +302,22 @@
(defimplementation find-definitions (name) nil)
+(defimplementation find-source-location (obj)
+ (or
+ (typecase obj
+ (function
+ (multiple-value-bind (file pos) (ignore-errors (si:bc-file obj))
+ (if (and file pos)
+ `(:location
+ (:file ,file)
+ (:position ,pos)
+ (:snippet
+ ,(with-open-file (s file)
+ (skip-toplevel-forms pos s)
+ (skip-comments-and-whitespace s)
+ (read-snippet s))))))))
+ `(:error (format nil "Source definition of ~S not found" obj))))
+
;;;; Threads
#+threads
More information about the slime-cvs
mailing list