Next: , Previous: , Up: Contributed Packages   [Contents][Index]

8.6 Fuzzy Completion

The package slime-fuzzy implements yet another symbol completion heuristic.

[Somebody please describe what the algorithm actually does]

It attempts to complete a symbol all at once, instead of in pieces. For example, “mvb” will find “multiple-value-bind” and “norm-df” will find “least-positive-normalized-double-float”.

The algorithm tries to expand every character in various ways and rates the list of possible completions with the following heuristic.

Letters are given scores based on their position in the string. Letters at the beginning of a string or after a prefix letter at the beginning of a string are scored highest. Letters after a word separator such as #\- are scored next highest. Letters at the end of a string or before a suffix letter at the end of a string are scored medium, and letters anywhere else are scored low.

If a letter is directly after another matched letter, and its intrinsic value in that position is less than a percentage of the previous letter’s value, it will use that percentage instead.

Finally, a small scaling factor is applied to favor shorter matches, all other things being equal.

C-c M-i
M-x slime-fuzzy-complete-symbol

Presents a list of likely completions to choose from for an abbreviation at point. If you set the variable slime-complete-symbol-function to this command, fuzzy completion will also be used for M-TAB.