summaryrefslogtreecommitdiff
path: root/orderless.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-04-07 13:32:03 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2021-04-07 13:32:03 +0200
commit818af9e6f0c9ce89dbd45e01a17a9b8f9c74ef7f (patch)
treedee8fc5cbff077698f8c795638c5b6aa01d62599 /orderless.el
parent44935d8962be5724d8a3a4358ce0a4222450ee26 (diff)
Remove pattern compiler variable
It is unlikely that a user wants to customize this variable. If the pattern compiler is to be replaced there is still the advice mechanism.
Diffstat (limited to 'orderless.el')
-rw-r--r--orderless.el31
1 files changed, 6 insertions, 25 deletions
diff --git a/orderless.el b/orderless.el
index ce34d49..0d75a7e 100644
--- a/orderless.el
+++ b/orderless.el
@@ -152,24 +152,9 @@ match as literals. As another example, a style dispatcher could
arrange for a component starting with `?' to match the rest of
the component in the `orderless-flex' style. For more
information on how this variable is used, see
-`orderless-default-pattern-compiler'."
+`orderless-pattern-compiler'."
:type 'hook)
-(defcustom orderless-pattern-compiler #'orderless-default-pattern-compiler
- "The `orderless' pattern compiler.
-This should be a function that takes an input pattern and returns
-a list of regexps that must all match a candidate in order for
-the candidate to be considered a completion of the pattern.
-
-The default pattern compiler is probably flexible enough for most
-users. See `orderless-default-pattern-compiler' for details.
-
-The documentation for `orderless-matching-styles' is written
-assuming the default pattern compiler is used, if you change the
-pattern compiler it can, of course, do anything and need not
-consult this variable at all."
- :type 'function)
-
(defcustom orderless-smart-case t
"Whether to use smart case.
If this variable is t, then case-sensitivity is decided as
@@ -306,7 +291,7 @@ For the user's convenience, if REGEXPS is a string, it is
converted to a list of regexps according to the value of
`orderless-matching-styles'."
(when (stringp regexps)
- (setq regexps (funcall orderless-pattern-compiler regexps)))
+ (setq regexps (orderless-pattern-compiler regexps)))
(cl-loop for original in strings
for string = (copy-sequence original)
collect (orderless--highlight regexps string)))
@@ -362,7 +347,7 @@ DEFAULT as the list of styles."
when result return (cons result string)
finally (return (cons default string))))
-(defun orderless-default-pattern-compiler (pattern &optional styles dispatchers)
+(defun orderless-pattern-compiler (pattern &optional styles dispatchers)
"Build regexps to match the components of PATTERN.
Split PATTERN on `orderless-component-separator' and compute
matching styles for each component. For each component the style
@@ -376,11 +361,7 @@ dispatchers.
The STYLES default to `orderless-matching-styles', and the
DISPATCHERS default to `orderless-dipatchers'. Since nil gets you
the default, if want to no dispatchers to be run, use '(ignore)
-as the value of DISPATCHERS.
-
-This function is the default for `orderless-pattern-compiler' and
-might come in handy as a subroutine to implement other pattern
-compilers."
+as the value of DISPATCHERS."
(unless styles (setq styles orderless-matching-styles))
(unless dispatchers (setq dispatchers orderless-style-dispatchers))
(cl-loop
@@ -413,7 +394,7 @@ The predicate PRED is used to constrain the entries in TABLE."
(pcase-let* ((`(,prefix . ,pattern)
(orderless--prefix+pattern string table pred))
(completion-regexp-list
- (funcall orderless-pattern-compiler pattern))
+ (orderless-pattern-compiler pattern))
(completion-ignore-case
(if orderless-smart-case
(cl-loop for regexp in completion-regexp-list
@@ -515,7 +496,7 @@ delegates to `orderless-%s'.")
This function is for integration of orderless with ivy, use it as
a value in `ivy-re-builders-alist'."
(or (mapcar (lambda (x) (cons x t))
- (funcall orderless-pattern-compiler str))
+ (orderless-pattern-compiler str))
""))
(defun orderless-ivy-highlight (str)