[slime-cvs] CVS slime

mbaringer mbaringer at common-lisp.net
Sun Apr 8 11:23:18 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv1000

Modified Files:
	swank.lisp ChangeLog 
Log Message:


--- /project/slime/cvsroot/slime/swank.lisp	2007/04/08 11:21:45	1.466
+++ /project/slime/cvsroot/slime/swank.lisp	2007/04/08 11:23:17	1.467
@@ -1362,15 +1362,22 @@
 
 ;; FIXME: deal with #\| etc.  hard to do portably.
 (defun tokenize-symbol (string)
+  "STRING is interpreted as the string representation of a symbol
+and is tokenized accordingly. The result is returned in three
+values: The package identifier part, the actual symbol identifier
+part, and a flag if the STRING represents a symbol that is
+internal to the package identifier part. (Notice that the flag is
+also true with an empty package identifier part, as the STRING is
+considered to represent a symbol internal to some current package.)"
   (let ((package (let ((pos (position #\: string)))
                    (if pos (subseq string 0 pos) nil)))
         (symbol (let ((pos (position #\: string :from-end t)))
                   (if pos (subseq string (1+ pos)) string)))
-        (internp (search "::" string)))
+        (internp (not (= (count #\: string) 1))))
     (values symbol package internp)))
 
 (defun tokenize-symbol-thoroughly (string)
-  "This version of tokenize-symbol handles escape characters."
+  "This version of TOKENIZE-SYMBOL handles escape characters."
   (let ((package nil)
         (token (make-array (length string) :element-type 'character
                            :fill-pointer 0))
@@ -1397,7 +1404,7 @@
                                          :fill-pointer 0))))
             (t
              (vector-push-extend (casify-char char) token))))
-    (values token package internp)))
+    (values token package (or (not package) internp))))
 
 (defun casify-char (char)
   "Convert CHAR accoring to readtable-case."
@@ -3333,9 +3340,9 @@
           (sort strings #'string<)))
 
 (defun format-completion-result (string internal-p package-name)
-  (let ((prefix (cond (internal-p (format nil "~A::" package-name))
-                      (package-name (format nil "~A:" package-name))
-                      (t ""))))
+  (let ((prefix (cond ((not package-name) "")
+                      (internal-p (format nil "~A::" package-name))
+                      (t (format nil "~A:" package-name)))))
     (values (concatenate 'string prefix string)
             (length prefix))))
 
--- /project/slime/cvsroot/slime/ChangeLog	2007/04/08 11:21:45	1.1094
+++ /project/slime/cvsroot/slime/ChangeLog	2007/04/08 11:23:17	1.1095
@@ -1,5 +1,19 @@
 2007-04-06  Tobias C. Rittweiler <tcr at freebits.de>
 
+	* swank.lisp (tokenize-symbol, tokenize-symbol-thoroughly):
+	Previously these functions said a string representing a symbol is
+	internal exactly if it contained "::" as substring. Now they say
+	additionally so for symbols without any package identifier, as
+	they are internal to am implicit current package. (Otherwise
+	will break fuzzy completion.)
+
+	(tokenize-symbol): Added docstring.
+
+	* swank.lisp (format-completion-result): Fixed formation
+	for the case that PACKAGE-NAME is NIL but INTERNAL-P is T.
+
+2007-04-06  Tobias C. Rittweiler <tcr at freebits.de>
+
 	* swank.lisp: Making fuzzy completion semantically right from a
 	user perspective. As an example on SBCL, "sb:with- C-c M-i" will
 	display all exported "with"-style macros in all sb-* packages from




More information about the slime-cvs mailing list