[slime-devel] Duplicate definitions in slime-edit-definition

Chris Dean ctdean at sokitomi.com
Thu Jun 1 02:19:27 UTC 2006


I'm not sure if this happens in other Lisps, but in LispWorks I start
to get duplicate definitions listed when I used SLIME-EDIT-DEFINITION
to jump to a function.  These are all the "same" function definition,
just with a slightly different line numbers as I make changes to
whatever .lisp file I'm editing and recompile the function.

(This sure is tricky to explain!)

I made a change to slime-edit-definition to remove the duplicates.
Patch below.

If this only happens in LispWorks I can modify swank-lispworks.lisp
instead.

Cheers,
Chris Dean


Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.625
diff -u -w -r1.625 slime.el
--- slime.el	29 May 2006 23:39:47 -0000	1.625
+++ slime.el	1 Jun 2006 02:08:02 -0000
@@ -6327,7 +6327,12 @@
         (if slime-edit-definition-fallback-function
             (funcall slime-edit-definition-fallback-function name)
           (error "No known definition for: %s" name))
-      (slime-goto-definition name definitions where))))
+      (slime-goto-definition name
+                             (remove-duplicates definitions
+                                                :key #'car
+                                                :test #'string= 
+                                                :from-end t)
+                             where))))
 
 (defun slime-goto-definition (name definitions &optional where)
   (slime-push-definition-stack)
Index: ChangeLog
===================================================================
RCS file: /project/slime/cvsroot/slime/ChangeLog,v
retrieving revision 1.904
diff -u -w -r1.904 ChangeLog
--- ChangeLog	31 May 2006 19:27:31 -0000	1.904
+++ ChangeLog	1 Jun 2006 02:08:10 -0000
@@ -1,3 +1,8 @@
+2006-05-31  Chris Dean  <ctdean at sokitomi.com>
+
+	* slime.el (slime-edit-definition): Remove duplicate functions
+    	  names.
+
 2006-05-31  Nathan Bird <nathan at acceleration.net>
 
 	* swank.lisp (*sldb-quit-restart*): New variable.



More information about the slime-devel mailing list