[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Tue Sep 7 03:02:22 UTC 2010


Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv17507

Modified Files:
	ChangeLog swank-c-p-c.lisp 
Log Message:
* swank-c-p-c.lisp (untokenize-completion): Take an optional
argument "delimiter".
(longest-compound-prefix): Pass delimiter to untokenize-completion.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/09/04 00:32:14	1.413
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/09/07 03:02:21	1.414
@@ -1,3 +1,9 @@
+2010-09-07  Stas Boukarev  <stassats at gmail.com>
+
+	* swank-c-p-c.lisp (untokenize-completion): Take an optional
+	argument "delimiter".
+	(longest-compound-prefix): Pass delimiter to untokenize-completion.
+
 2010-09-04  Stas Boukarev  <stassats at gmail.com>
 
 	* swank-fuzzy.lisp (*fuzzy-completion-...*): Change defparameter
--- /project/slime/cvsroot/slime/contrib/swank-c-p-c.lisp	2009/10/31 20:18:28	1.4
+++ /project/slime/cvsroot/slime/contrib/swank-c-p-c.lisp	2010/09/07 03:02:21	1.5
@@ -249,10 +249,13 @@
     (untokenize-completion
      (loop for token-list in (transpose-lists (mapcar #'tokenizer completions))
            if (notevery #'string= token-list (rest token-list))
-             collect (longest-common-prefix token-list) ; Note that we possibly collect
-             and do (loop-finish)                       ;  the "" here as well, so that
-           else collect (first token-list)))))          ;  UNTOKENIZE-COMPLETION will
-                                                        ;  append a hyphen for us.
+           ;; Note that we possibly collect the "" here as well, so that
+           ;; UNTOKENIZE-COMPLETION will append a delimiter for us.
+             collect (longest-common-prefix token-list delimeter)
+             and do (loop-finish)
+           else collect (first token-list))
+     delimeter)))
+
 (defun tokenize-completion (string delimeter)
   "Return all substrings of STRING delimited by DELIMETER."
   (loop with end
@@ -261,8 +264,8 @@
         do (setq end (or (position delimeter string :start start) (length string)))
         collect (subseq string start end)))
 
-(defun untokenize-completion (tokens)
-  (format nil "~{~A~^-~}" tokens))
+(defun untokenize-completion (tokens &optional (delimiter #\-))
+  (format nil (format nil "~~{~~A~~^~a~~}" delimiter) tokens))
 
 (defun transpose-lists (lists)
   "Turn a list-of-lists on its side.
@@ -285,4 +288,4 @@
          (completions (sort completion-set #'string<)))
     (list completions (longest-compound-prefix completions #\_))))
 
-(provide :swank-c-p-c)
\ No newline at end of file
+(provide :swank-c-p-c)





More information about the slime-cvs mailing list