[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Wed May 2 17:33:17 UTC 2012


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

Modified Files:
	ChangeLog swank.lisp 
Log Message:
* swank.lisp (*find-definitions-right-trim*)
(*find-definitions-left-trim*): New variables. ",:." and "#:"
default values.
(find-definitions-for-emacs): Trim names with using the above
variables when a symbol is not found.


--- /project/slime/cvsroot/slime/ChangeLog	2012/05/01 10:07:34	1.2322
+++ /project/slime/cvsroot/slime/ChangeLog	2012/05/02 17:33:16	1.2323
@@ -1,3 +1,11 @@
+2012-05-02  Stas Boukarev  <stassats at gmail.com>
+
+	* swank.lisp (*find-definitions-right-trim*)
+	(*find-definitions-left-trim*): New variables. ",:." and "#:"
+	default values.
+	(find-definitions-for-emacs): Trim names with using the above
+	variables when a symbol is not found.
+
 2012-05-01  Stas Boukarev  <stassats at gmail.com>
 
 	* slime.el (slime-xrefs-for-notes): Format location in a proper
--- /project/slime/cvsroot/slime/swank.lisp	2012/04/24 11:12:14	1.787
+++ /project/slime/cvsroot/slime/swank.lisp	2012/05/02 17:33:16	1.788
@@ -65,7 +65,9 @@
            #:quit-lisp
            #:eval-for-emacs
            #:eval-in-emacs
-           #:y-or-n-p-in-emacs))
+           #:y-or-n-p-in-emacs
+           #:*find-definitions-right-trim*
+           #:*find-definitions-left-trim*))
 
 (in-package :swank)
 
@@ -2918,12 +2920,29 @@
      (inspector-nth-part part))
     ((:sldb frame var)
      (frame-var-value frame var))))
-  
+
+(defvar *find-definitions-right-trim* ",:.")
+(defvar *find-definitions-left-trim* "#:")
+
+(defun find-definitions-find-symbol (name)
+  (flet ((do-find (name)
+           (multiple-value-bind (symbol found)
+               (parse-symbol name)
+             (when found
+               (return-from find-definitions-find-symbol
+                 (values symbol found))))))
+    (do-find name)
+    (do-find (string-right-trim *find-definitions-right-trim* name))
+    (do-find (string-left-trim *find-definitions-left-trim* name))
+    (do-find (string-left-trim *find-definitions-left-trim*
+                               (string-right-trim
+                                *find-definitions-right-trim* name)))))
+
 (defslimefun find-definitions-for-emacs (name)
   "Return a list ((DSPEC LOCATION) ...) of definitions for NAME.
 DSPEC is a string and LOCATION a source location. NAME is a string."
-  (multiple-value-bind (symbol found) (with-buffer-syntax () 
-                                        (parse-symbol name))
+  (multiple-value-bind (symbol found)
+      (find-definitions-find-symbol name)
     (when found
       (mapcar #'xref>elisp (find-definitions symbol)))))
 





More information about the slime-cvs mailing list