Skip to content

lewang/hotfuzz-with-orderless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

EXPERIMENTAL WARNING

This is experimental.

What is hotfuzz?

`flex’ style, but with a better scoring algorithm. Specifically, it is non-greedy and ranks completions that match at word; path component; or camelCase boundaries higher.

What is orderless?

Orderless completion style divides the pattern into space-separated components, and matches candidates that match all of the components in any order.

Why together?

Hotfuzz and earlier (and slower) flx algorithm offer excellent sorting. It allows the user to **always type forward**. The score of target completion improves without manipulating the point or pressing C-p or C-n.

It sounds trivial, but as the user develops scoring intuition, it can feel quite magical.

The score based sorting can occasionally narrow to a target you didn’t intend, especially for a large array to complete against.

This is where orderless filtering comes in. The user can press space and type more words to filter the completions with orderless.

Other considerations

Orderless has builtin `orderless-flex’ style, which does matching without sorting. Sorting really is mandatory to make flex search useful.

Orderless also has builtin `orderless-initialism’ style, which completes strictly as initials, which is not flexible or powerful enough to be generally useful.

How do hotfuzz and orderless work together?

  1. Starting typing query, hotfuzz is used for superior sorting.
  2. Press space, and orderless takes over, but treats the first word before space as `orderless-flex’.
  3. Note this combination means completions can be filter by a list of space separated words (i.e. the default orderless usage). However, the first word has special powers.

What’s the compromise?

`orderless-flex’ will redo the work hotfuzz did to filter the collection. In practice this is not noticeable.

future dev

  1. invert logic so orderless does filtering before hotfuzz does scoring
  2. remove duplicated work
  3. look into possibility of using historical items to give some hotfuzz scores a boost

About

Emacs completion dispatch between hotfuzz (superior sorting) and orderless (robust composability)..

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published