[slime-devel] Patch for improving xref with clisp

Carsten carstenblaauw at web.de
Sat Jan 17 10:25:59 UTC 2009


Hi,

here is a patch that improves handling of cross references with clisp.
With this patch file locations are presented to the function level instead of
"no location".

To enable cross referencing at asdf load time I have the following in my
.swank.lisp:

;; update xref-results after loading of files
#+clisp
(defmethod asdf:perform :after ((operation asdf:load-op) (c asdf:cl-source-ile))
  (pxref:xref-files (asdf:component-pathname c))
  t)


Here's the patch (diffed against swank-clisp.lisp 1.88)

#########start#########

--- /home/carsten/lisp/slime/swank-clisp.lisp	2009-01-11 04:15:02.000000000 +0100
+++ swank-clisp.lisp	2009-01-16 10:14:47.794470571 +0100
@@ -307,8 +307,9 @@
 			  (make-location (list :file (namestring truename))
 					 (if (consp lines)
 					     (list* :line lines)
-				     (list :function-name (string fspec)))
-				 (list :snippet (format nil "~A" type))))
+				     (list :function-name (string name)))
+                                         (when (consp type)
+                                      (list :snippet (format nil "~A"type)))))
 			 (t (list :error (princ-to-string c))))))
 	(t (list :error (format nil "No source information available for: ~S"
 					fspec)))))))
@@ -666,7 +667,7 @@
 (defun xref-results (symbols)
   (let ((xrefs '()))
     (dolist (symbol symbols)
-      (push (fspec-location symbol symbol) xrefs))
+      (push (fspec-location symbol (car (pxref:source-file symbol))) xrefs))
     xrefs))
 
 (when (find-package :swank-loader)
####end####


I hope it's useful for you and thanks for the good work on Slime


Carsten





More information about the slime-devel mailing list