\input texinfo @c -*- texinfo -*- @c %**start of header @setfilename orderless.info @settitle Orderless @documentencoding UTF-8 @documentlanguage en @c %**end of header @dircategory Emacs @direntry * Orderless: (orderless). Completion style for matching regexps in any order. @end direntry @finalout @titlepage @title Orderless @end titlepage @contents @ifnottex @node Top @top Orderless @end ifnottex @menu * Overview:: * Customization:: * Integration with other completion UIs:: * Related packages:: @detailmenu --- The Detailed Node Listing --- Customization * Component matching styles:: * Component separator regexp:: * Defining custom orderless styles:: * Faces for component matches:: * Pattern compiler:: * Interactively changing the configuration:: Component matching styles * Style dispatchers:: Integration with other completion UIs * Ivy:: * Selectrum:: * Company:: Related packages * Ivy and Helm:: * Prescient:: * Restricting to current matches in Icicles, Ido and Ivy: Restricting to current matches in Icicles Ido and Ivy. @end detailmenu @end menu @node Overview @chapter Overview This package provides an @samp{orderless} @emph{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 literal matches are enabled. A completion style is a back-end for completion and is used from a front-end that provides a completion UI@. Any completion style can be used with the default Emacs completion UI (sometimes called minibuffer tab completion), with the built-in Icomplete package (which is similar to the more well-known Ido Mode), or with some third party completion frameworks such as @uref{https://github.com/raxod502/selectrum, Selectrum} or @uref{https://github.com/oantolin/icomplete-vertical, icomplete-vertical}. To use a completion style in this fashion simply add it as an entry in the variables @samp{completion-styles} and @samp{completion-category-overrides} (see their documentation). You may also want to modify the @samp{completion-category-defaults} variable, which serves as a default value for @samp{completion-category-overrides}: if you want to use @samp{orderless} exclusively, set both variables to @samp{nil}. With a bit of effort, it might still be possible to use @samp{orderless} with other completion UIs, even if those UIs don't support the standard Emacs completion styles. Currently there is support for @uref{https://github.com/abo-abo/swiper, Ivy} (see below). If you use MELPA, the easiest way to install @samp{orderless} is via @samp{package-install}. If you use both MELPA and @samp{use-package}, you can use: @lisp (use-package orderless :ensure t :custom (completion-styles '(orderless))) @end lisp Alternatively, put @samp{orderless.el} somewhere on your @samp{load-path}, and use the following configuration: @lisp (require 'orderless) (setq completion-styles '(orderless)) @end lisp Bug reports are highly welcome and appreciated! @node Customization @chapter Customization @menu * Component matching styles:: * Component separator regexp:: * Defining custom orderless styles:: * Faces for component matches:: * Pattern compiler:: * Interactively changing the configuration:: @end menu @node Component matching styles @section 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: @table @asis @item orderless-regexp the component is treated as a regexp that must match somewhere in the candidate. If the component is not a valid regexp, it is ignored. @item orderless-literal the component is treated as a literal string that must occur in the candidate. This is just @samp{regexp-quote}. @item @strong{orderless-without-literal} the component is a treated as a literal string that must @strong{not} occur in the candidate. Note that nothing is highlighted for this matching style. You probably don't want to use this style directly in @samp{orderless-matching-styles} but with a style dispatcher instead. There is an example in the section on style dispatchers. @item orderless-prefixes the component is split at word endings and each piece must match at a word boundary in the candidate, occurring in that order. This is similar to the built-in @samp{partial-completion} completion-style. For example, @samp{re-re} matches @samp{query-replace-regexp}, @samp{recode-region} and @samp{magit-remote-list-refs}; @samp{f-d.t} matches @samp{final-draft.txt}. @item orderless-initialism each character of the component should appear as the beginning of a word in the candidate, in order. This maps @samp{abc} to @samp{\