[slime-cvs] CVS slime

alendvai alendvai at common-lisp.net
Tue Dec 19 10:21:33 UTC 2006


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

Modified Files:
	swank.lisp 
Log Message:
Add (expt 1.2 length) higher scores for longer matches in fuzzy completion.

A good example: puts "make-instance" before "make-string-input-stream" while completing "make-ins"


--- /project/slime/cvsroot/slime/swank.lisp	2006/12/14 16:17:36	1.428
+++ /project/slime/cvsroot/slime/swank.lisp	2006/12/19 10:21:32	1.429
@@ -3627,9 +3627,10 @@
 
 Once a word has been completely matched, the chunks are pushed
 onto the special variable *ALL-CHUNKS* and the function returns."
-  (declare ;;(optimize speed)
+  (declare (optimize speed)
            (fixnum short-index initial-full-index)
            (simple-string short full)
+           (type list *all-chunks*)
            (special *all-chunks*))
   (flet ((short-cur () 
            "Returns the next letter from the abbreviation, or NIL
@@ -3738,7 +3739,8 @@
              (if (zerop chunk-pos) 
                  base-score 
                  (max base-score 
-                      (* (score-char (1- pos) (1- chunk-pos)) 0.85))))
+                      (+ (* (score-char (1- pos) (1- chunk-pos)) 0.85)
+                         (expt 1.2 chunk-pos)))))
            (score-char (pos chunk-pos)
              (score-or-percentage-of-previous
               (cond ((at-beginning-p pos)         10)




More information about the slime-cvs mailing list