2

I am using completion-styles and cannot decipher the difference between flex and initials.

2 Answers 2

1

initials matches "acronyms and initialisms", e.g., can complete "M-x lch" to list-command-history and "C-x C-f ~/sew" can match "~/src/emacs/work".

flex will match an in-order subset of characters. When completing "foo" the glob "*f*o*o*" is used, so that "foo" can complete to "frodo".

You can read more about these and other options (like basic and substring) from the docstring for completion-styles-alist.

Orderless and Fussy are third-party packages to provide additional completion styles.

1

See the manual:

M-x emacs-index-search RET completion-styles RET takes you to (emacs)Completion Styles, which says:

‘flex’
     This aggressive completion style, also known as ‘flx’ or ‘fuzzy’ or
     ‘scatter’ completion, attempts to complete using in-order
     substrings.  For example, it can consider ‘foo’ to match ‘frodo’ or
     ‘fbarbazoo’.

‘initials’
     This very aggressive completion style attempts to complete acronyms
     and initialisms.  For example, when completing command names, it
     matches ‘lch’ to ‘list-command-history’.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.