[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Thu May 24 19:23:37 UTC 2007


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

Modified Files:
	swank.lisp 
Log Message:
* swank.lisp: Fixed regression in completion: "swank[TAB]" would
  previously be completed to "swank-backend:"; "get-internal[TAB]"
  would be completed to "get-internal-r-time" (instead of simply
  "get-internal-r"); and "custom:*comp[TAB]" would be completed to
  "custom:*compiled-" on CLISP, even though there's a
  "custom:*complile-". 
  
  Thanks to Ken Causey for helping me find the first two.
  
  (completions): Revert changes from 2007-05-11.
  (longest-compound-prefix): Fixed to properly generate a compound
  _prefix_.


--- /project/slime/cvsroot/slime/swank.lisp	2007/05/17 14:31:26	1.488
+++ /project/slime/cvsroot/slime/swank.lisp	2007/05/24 19:23:36	1.489
@@ -3260,18 +3260,7 @@
   (let ((completion-set (completion-set string default-package-name
                                         #'compound-prefix-match)))
     (when completion-set
-      (list completion-set
-            ;; We strip off the package identifier, and compute the
-            ;; longest compound prefix of the symbol identifiers only,
-            ;; because the package identifier is fixed anyway, so that
-            ;; LONGEST-COMPOUND-PREFIX will not think it found a prefix,
-            ;; even though all it found was the common package identifier.
-            (multiple-value-bind (_ package-identifier internalp)
-                (tokenize-symbol (first completion-set))
-              (declare (ignore _))
-              (untokenize-symbol package-identifier internalp
-                                 (longest-compound-prefix
-                                  (mapcar #'tokenize-symbol completion-set))))))))
+      (list completion-set (longest-compound-prefix completion-set)))))
 
 
 (defslimefun simple-completions (string default-package-name)
@@ -3564,12 +3553,12 @@
   "Return the longest compound _prefix_ for all COMPLETIONS."
   (flet ((tokenizer (string) (tokenize-completion string delimeter)))
     (untokenize-completion
-     (loop for sub-prefix in (mapcar #'longest-common-prefix
-                                 (transpose-lists (mapcar #'tokenizer completions)))
-           if (string= sub-prefix "")
-             collect sub-prefix and do (loop-finish) ; Collect the "" so that
-           else collect sub-prefix))))               ;  UNTOKENIZE-COMPLETION 
-                                                     ;  appends a hyphen.
+     (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.
 (defun tokenize-completion (string delimeter)
   "Return all substrings of STRING delimited by DELIMETER."
   (loop with end




More information about the slime-cvs mailing list