summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-03-03 18:30:22 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2024-03-03 18:51:58 +0100
commit939ceece866e802e4cd8ed7e80c9715f39e7c0ec (patch)
tree9e4d6aa74d97ab140d045d338cb7dd88e05f9d08
parent5dcf92a6624911cd85d6fbf42a4cc2980d9afef3 (diff)
Rename orderless-prefix to orderless-literal-prefix and register
Avoid confusion with orderless-prefixes. Registering orderless-literal-prefix with the ^ character has a modest advantage - it makes sure that the prefix optimization sets in.
-rw-r--r--README.org5
-rw-r--r--orderless.el6
-rw-r--r--orderless.texi8
3 files changed, 12 insertions, 7 deletions
diff --git a/README.org b/README.org
index a0ad2f1..dc9bbd1 100644
--- a/README.org
+++ b/README.org
@@ -133,8 +133,8 @@ matching styles are:
- orderless-literal :: the component is treated as a literal string
that must occur in the candidate.
-- orderless-prefix :: the component is treated as a literal string
- that must occur as a prefix of a 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
@@ -195,6 +195,7 @@ Style modifiers should not be used directly in
will match against the candidate's annotation.
- , uses =orderless-initialism=.
- = uses =orderless-literal=.
+ - ^ uses =orderless-literal-prefix=.
- ~ uses =orderless-flex=.
- % makes the string match ignoring diacritics and similar
inflections on characters (it uses the function
diff --git a/orderless.el b/orderless.el
index 66a7b53..0177133 100644
--- a/orderless.el
+++ b/orderless.el
@@ -133,6 +133,7 @@ customizing this variable to see a list of them."
(?@ . ,#'orderless-annotation)
(?, . ,#'orderless-initialism)
(?= . ,#'orderless-literal)
+ (?^ . ,#'orderless-literal-prefix)
(?~ . ,#'orderless-flex))
"Alist associating characters to matching styles.
The function `orderless-affix-dispatch' uses this list to
@@ -145,8 +146,9 @@ matched according the style associated to it."
:value-type (choice
(const :tag "Annotation" ,#'orderless-annotation)
(const :tag "Literal" ,#'orderless-literal)
- (const :tag "Regexp" ,#'orderless-regexp)
(const :tag "Without literal" ,#'orderless-without-literal)
+ (const :tag "Literal prefix" ,#'orderless-literal-prefix)
+ (const :tag "Regexp" ,#'orderless-regexp)
(const :tag "Not" ,#'orderless-not)
(const :tag "Flex" ,#'orderless-flex)
(const :tag "Initialism" ,#'orderless-initialism)
@@ -221,7 +223,7 @@ is determined by the values of `completion-ignore-case',
"Match COMPONENT as a literal string."
`(literal ,component))
-(defun orderless-prefix (component)
+(defun orderless-literal-prefix (component)
"Match COMPONENT as a literal prefix string."
`(seq bos (literal ,component)))
diff --git a/orderless.texi b/orderless.texi
index 9e8c7d4..b381aa2 100644
--- a/orderless.texi
+++ b/orderless.texi
@@ -169,9 +169,9 @@ If the component is not a valid regexp, it is ignored.
the component is treated as a literal string
that must occur in the candidate.
-@item orderless-prefix
-the component is treated as a literal string
-that must occur as a prefix of a candidate.
+@item orderless-literal-prefix
+the component is treated as a literal
+string that must occur as a prefix of a candidate.
@item orderless-prefixes
the component is split at word endings and
@@ -254,6 +254,8 @@ will match against the candidate's annotation.
@item
= uses @samp{orderless-literal}.
@item
+^ uses @samp{orderless-literal-prefix}.
+@item
~ uses @samp{orderless-flex}.
@item
% makes the string match ignoring diacritics and similar