Component matching styles
Each component of a pattern can match in any of several matching styles. A matching style is a function from strings to regexps or predicates, so it is easy to define new matching styles. The value returned by a matching style can be either a regexp as a string, an s-expression in ‘rx’ syntax or a predicate function. The predefined matching styles are:
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.
orderless-literal
the component is treated as a literal string that must occur in the candidate.
orderless-literal-prefix
the component is treated as a literal string that must occur as a prefix of a candidate.
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 ‘partial-completion’ completion-style. For example, ‘re-re’ matches ‘query-replace-regexp’, ‘recode-region’ and ‘magit-remote-list-refs’; ‘f-d.t’ matches ‘final-draft.txt’.
orderless-initialism
each character of the component should appear as the beginning of a word in the candidate, in order.
This maps ‘abc’ to ‘\<a.*\<b.*\c’.
orderless-flex
the characters of the component should appear in that order in the candidate, but not necessarily consecutively.
This maps ‘abc’ to ‘a.*b.*c’.
orderless-without-literal
the component is a treated as a literal string that must not occur in the candidate.
Nothing is highlighted by this style. This style should not be used directly in ‘orderless-matching-styles’ but with a style dispatcher instead. See also the more general style modifier ‘orderless-not’.
The variable ‘orderless-matching-styles’ can be set to a list of the desired matching styles to use. By default it enables the literal and regexp styles.