[slime-cvs] CVS update: slime/swank-sbcl.lisp

Helmut Eller heller at common-lisp.net
Tue Dec 2 14:01:16 UTC 2003


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv11273

Modified Files:
	swank-sbcl.lisp 
Log Message:
(find-function-locations): Return a non-empty list of source locations.

Date: Tue Dec  2 09:01:16 2003
Author: heller

Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.34 slime/swank-sbcl.lisp:1.35
--- slime/swank-sbcl.lisp:1.34	Mon Dec  1 19:56:26 2003
+++ slime/swank-sbcl.lisp	Tue Dec  2 09:01:15 2003
@@ -295,13 +295,14 @@
        (cond (path (list :source-path path position))
              (t (list :function-name fname)))))))
                                 
-(defmethod function-source-location-for-emacs (fname-string)
-  "Return the source-location(s) of FNAME's definition(s)."
+(defslimefun find-function-locations (fname-string)
+  "Return a list of source-locations of FNAME's definitions."
   (let* ((fname (from-string fname-string)))
     (labels ((finder (fname)
                (cond ((and (symbolp fname) (macro-function fname))
-                      (function-source-location (macro-function fname) 
-                                                fname-string))
+                      (list 
+                       (function-source-location (macro-function fname) 
+                                                 fname-string)))
                      ((typep fname 'sb-mop:generic-function)
                       (list*
                        (function-source-location fname fname-string)
@@ -309,7 +310,8 @@
                         (lambda (x) (function-source-location x fname-string))
                         (sb-mop:generic-function-methods fname))))
                      ((functionp fname) 
-                      (function-source-location fname fname-string))
+                      (list 
+                       (function-source-location fname fname-string)))
                      ((sb-introspect:valid-function-name-p fname)
                       (finder (fdefinition fname))) )))
       (if *debug-definition-finding*
@@ -317,12 +319,6 @@
           (handler-case (finder fname)
             (error (e) 
               (list :error (format nil "Error: ~A" e))))))))
-
-(defslimefun find-function-locations (name)
-  (let ((loc (function-source-location-for-emacs name)))
-    (if (listp loc)
-        loc
-        (list loc))))
 
 (defmethod describe-symbol-for-emacs (symbol)
   "Return a plist describing SYMBOL.





More information about the slime-cvs mailing list