summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-02-02 00:41:21 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2025-02-02 00:41:21 +0100
commitc7cb04499d94ee1c17affb29b1cfcd2a45116c97 (patch)
treedb2c26cdd76e403553a660ce9d91012c2cb5c296
parent411051c3257d60f0492cf88065193bb443b6ca0d (diff)
Relax the smart-case heuristic; Check the whole pattern
By not only checking the compiled regexp, smart case is also toggled when matching on annotations, e.g., &Lv as in #184.
-rw-r--r--orderless.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/orderless.el b/orderless.el
index f521c4c..c3e6f6b 100644
--- a/orderless.el
+++ b/orderless.el
@@ -498,7 +498,7 @@ The predicate PRED is used to constrain the entries in TABLE."
(prefix (substring string 0 limit))
(pattern (substring string limit))
(`(,fun . ,regexps) (orderless-compile pattern)))
- (list prefix regexps (orderless--ignore-case-p regexps)
+ (list prefix regexps (orderless--ignore-case-p pattern)
(orderless--predicate-normalized-and pred fun))))
;; Thanks to @jakanakaevangeli for writing a version of this function:
@@ -519,7 +519,7 @@ then return (cons REGEXP u); else return nil."
(defun orderless--ignore-case-p (regexps)
"Return non-nil if case should be ignored for REGEXPS."
(if orderless-smart-case
- (cl-loop for regexp in regexps
+ (cl-loop for regexp in (ensure-list regexps)
always (isearch-no-upper-case-p regexp t))
completion-ignore-case))