[slime-devel] Strange scores in slime-fuzzy-completion / feature request.

Pascal J. Bourguignon pjb at informatimago.com
Fri Aug 10 01:03:21 UTC 2012

In a new lisp file type:

(defpackage :slime-fuzzy-misfeature
  (:use :cl))
(in-package :slime-fuzzy-misfeature)

(defun f ()
  (let ((pos 4)
        (siz 2))
    (+ pos siz)))

(defstruct pt h v)

(defun g (p)
  (let ((pos-h (pt-h p))
        (pos-v (pt-v p)))
    (+ )))

C-x C-s C-c C-l

Then move after the + in g, and type po M-TAB  We get these fuzzy
completion choices:

For help on how the use this buffer, see `slime-fuzzy-completions-mode'.

Flags: boundp fboundp generic-function class macro special-operator package

Completion:                                                 Flags:   Score:
----------------------------------------------------------- -------- --------
pop                                                         -f---m-- 24.70
pos                                                         -------- 24.70
pos-h                                                       -------- 22.20
pos-v                                                       -------- 22.20
position                                                    -f------ 21.13
position-if                                                 -f------ 20.70
position-if-not                                             -f------ 20.41

1- pop is bound to a function not a variable, we're completing a
   variable: it should not be proposed at all!

2- pos is not in scope it should not be proposed at all.

In general it looks like shorter symbols are proposed with higher
scores.  Instead, symbols in scope (taking account namespaces) should
have higher scores.

__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

More information about the slime-devel mailing list