From e7b81ae428918e7ee5bdb8ec9c6333c8d4ca3b78 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 3 Mar 2024 14:00:10 +0100 Subject: Add orderless-prefix matching style This matching style is useful as a return value of a style dispatcher like orderless-affix-dispatch. It matches literals as a prefix and triggers the prefix filter optimization, see `orderless--anchored-quoted-regexp'. --- orderless.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/orderless.el b/orderless.el index 0186241..4c96137 100644 --- a/orderless.el +++ b/orderless.el @@ -221,6 +221,10 @@ is determined by the values of `completion-ignore-case', "Match COMPONENT as a literal string." `(literal ,component)) +(defun orderless-prefix (component) + "Match COMPONENT as a literal prefix string." + `(seq bol (literal ,component))) + (defun orderless--separated-by (sep rxs &optional before after) "Return a regexp to match the rx-regexps RXS with SEP in between. If BEFORE is specified, add it to the beginning of the rx -- cgit v1.0