diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-12 20:00:32 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-12 20:00:32 +0100 |
| commit | ed16a8e05922e39f0e57d188c288592a053d7c11 (patch) | |
| tree | 79bd7ec344232e91df5c5e26965ae1f2f4c4bc4a /orderless.el | |
| parent | bbebdf6de587963d94fc0c19926ead52884aeac8 (diff) | |
rx-to-string: Pass no-group argument
Diffstat (limited to 'orderless.el')
| -rw-r--r-- | orderless.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/orderless.el b/orderless.el index 637db17..9c7b6b4 100644 --- a/orderless.el +++ b/orderless.el @@ -416,7 +416,7 @@ DEFAULT as the list of styles." else if res collect (if (stringp res) `(regexp ,res) res) into regexps finally return (when (or pred regexps) - (cons pred (and regexps (rx-to-string `(or ,@(delete-dups regexps)))))))) + (cons pred (and regexps (rx-to-string `(or ,@(delete-dups regexps)) t)))))) (defun orderless-compile (pattern &optional styles dispatchers) "Build regexps to match the components of PATTERN. @@ -495,10 +495,10 @@ The predicate PRED is used to constrain the entries in TABLE." ;; https://github.com/oantolin/orderless/issues/79#issuecomment-916073526 (defun orderless--literal-prefix-p (regexp) "Determine if REGEXP is a quoted regexp anchored at the beginning. -If REGEXP is of the form \"\\(?:\\`q\\)\" for q = (regexp-quote u), +If REGEXP is of the form \"\\`q\" for q = (regexp-quote u), then return (cons REGEXP u); else return nil." - (when (and (string-prefix-p "\\(?:\\`" regexp) (string-suffix-p "\\)" regexp)) - (let ((trimmed (substring regexp 6 -2))) + (when (string-prefix-p "\\`" regexp) + (let ((trimmed (substring regexp 2))) (unless (string-match-p "[$*+.?[\\^]" (replace-regexp-in-string "\\\\[$*+.?[\\^]" "" trimmed @@ -517,7 +517,7 @@ then return (cons REGEXP u); else return nil." (defun orderless--filter (prefix regexps ignore-case table pred) "Filter TABLE by PREFIX, REGEXPS and PRED. The matching should be case-insensitive if IGNORE-CASE is non-nil." - ;; If there is a regexp of the form \(?:\`quoted-regexp\) then + ;; If there is a regexp of the form \`quoted-regexp then ;; remove the first such and add the unquoted form to the prefix. (pcase (cl-loop for r in regexps thereis (orderless--literal-prefix-p r)) |
