summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-02-15 16:52:12 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2024-02-15 23:45:26 +0100
commit10bce1bcde5dc7cd3796bb9202dd0eae72e1a088 (patch)
treed2daac816329c0ab8fa55406ca33845f65f59e14
parentc1def76024adb3f6eb55ab476f53fa2f68281d9b (diff)
orderless-annotation, orderless-without-regexp: Check validity
-rw-r--r--orderless.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/orderless.el b/orderless.el
index e2d64c8..93a1fd8 100644
--- a/orderless.el
+++ b/orderless.el
@@ -273,13 +273,14 @@ at a word boundary in the candidate. This is similar to the
(defun orderless-without-regexp (component)
"Match strings that do *not* contain COMPONENT as a regexp match."
- (unless (equal component "")
+ (when (and (not (equal component "")) (orderless-regexp component))
(lambda (str)
(not (string-match-p component str)))))
(defun orderless-annotation (component)
"Match candidates where the annotation matches COMPONENT as a regexp."
(when-let (((not (equal component "")))
+ ((orderless-regexp component)) ;; valid regexp
((minibufferp))
(table minibuffer-completion-table)
(metadata (completion-metadata