* Overview :PROPERTIES: :TOC: :include all :ignore this :END: This package provides an =orderless= /completion style/ that divides the pattern into space-separated components, and matches candidates that match all of the components in any order. Each component can match in any one of several ways: literally, as a regexp, as an initialism, in the flex style, or as multiple word prefixes. By default, regexp and initialism matches are enabled. A completion style is a backend for completion and is used from a frontend that provides a completion UI. Any completion style can be used with the default Emacs completion UI (sometimes called minibuffer tab completion) or with the built-in Icomplete package (which is similar to the more well-known Ido Mode). To use a completion style in this fashion simply add it as an entry in the variables =completion-styles= and =completion-category-overrides= (see their documentation). With a bit of effort, it might still be possible to use =orderless= with other completion UIs, even if those UIs don't support the standard Emacs completion styles. Currently there is support for [[https://github.com/abo-abo/swiper][Ivy]] and [[https://github.com/raxod502/selectrum][Selectrum]] (see below). If you use MELPA, the easiest way to install =orderless= is via =package-install=. If you use both MELPA and =use-package=, you can use: #+begin_src emacs-lisp (use-package orderless :ensure t :init (icomplete-mode) ; optional but recommended! :custom (completion-styles '(orderless))) #+end_src Alternatively, put =orderless.el= somewhere on your =load-path=, and use the following configuration: #+begin_src emacs-lisp (require 'orderless) (setq completion-styles '(orderless)) (icomplete-mode) ; optional but recommended! #+end_src (And of course, if you use another completion framework such as Ivy or Helm, disable it.) If you like the experience of using =orderless= with Icomplete, but wish the candidates displayed vertically, you can use [[https://github.com/oantolin/icomplete-vertical][icomplete-vertical]]. Bug reports are highly welcome and appreciated! :CONTENTS: - [[#screenshot][Screenshot]] - [[#customization][Customization]] - [[#component-matching-styles][Component matching styles]] - [[#component-separator-regexp][Component separator regexp]] - [[#faces-for-component-matches][Faces for component matches]] - [[#related-packages][Related packages]] - [[#ivy-and-helm][Ivy and Helm]] - [[#prescient][Prescient]] - [[#icicless-progressive-matching][Icicles's progressive matching]] - [[#integration-with-other-completion-uis][Integration with other completion UIs]] - [[#ivy][Ivy]] - [[#selectrum][Selectrum]] :END: ** Screenshot This is what it looks like to use =describe-function= (bound by default to =C-h f=) to match =eis ff=. Notice that in this particular case =eis= matched as an initialism, and =ff= matched as a regexp. The completion UI in the screenshot is [[https://github.com/oantolin/icomplete-vertical][icomplete-vertical]] and the theme is Protesilaos Stavrou's lovely [[https://gitlab.com/protesilaos/modus-themes][modus-operandi]]. [[images/describe-function-eis-ff.png]] * Customization ** Component matching styles Each component of a pattern can match in any of several matching styles. A matching style is simply a function from strings to strings that maps a component to a regexp to match against, so it is easy to define new matching styles. The predefined ones are: - orderless-regexp :: the component is treated as a regexp that must match somewhere in the candidate. This is simply the identity function! - orderless-literal :: the component is treated as a literal string that must occur in the candidate. This is just =regexp-quote=. - orderless-initialism :: each character of the component should appear as the beginning of a word in the candidate, in order. This maps =abc= to =\