emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult b404039f56 2/2: Minor cleanup


From: ELPA Syncer
Subject: [elpa] externals/consult b404039f56 2/2: Minor cleanup
Date: Sun, 11 Dec 2022 05:57:24 -0500 (EST)

branch: externals/consult
commit b404039f567ce296823425b641b2348482a1750e
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor cleanup
---
 consult.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/consult.el b/consult.el
index 98fd381b73..1fe3a45779 100644
--- a/consult.el
+++ b/consult.el
@@ -653,20 +653,19 @@ Return cons of point position and a list of match 
begin/end pairs."
 If a regular expression contains capturing groups, only these are highlighted.
 If no capturing groups are used highlight the whole match. Case is ignored
 if IGNORE-CASE is non-nil."
-  (let ((case-fold-search ignore-case))
-    (dolist (re regexps)
-      (let ((i 0))
-        (while (string-match re str i)
-          ;; Unfortunately there is no way to avoid the allocation of the match
-          ;; data, since the number of capturing groups is unknown.
-          (let ((m (match-data)))
-            (setq i (cadr m))
-            (setq m (or (cddr m) m))
-            (while m
-              (when (car m)
-                (add-face-text-property (car m) (cadr m)
-                                        'consult-highlight-match nil str))
-              (setq m (cddr m)))))))))
+  (dolist (re regexps)
+    (let ((i 0))
+      (while (let ((case-fold-search ignore-case))
+               (string-match re str i))
+        ;; Unfortunately there is no way to avoid the allocation of the match
+        ;; data, since the number of capturing groups is unknown.
+        (let ((m (match-data)))
+          (setq i (cadr m) m (or (cddr m) m))
+          (while m
+            (when (car m)
+              (add-face-text-property (car m) (cadr m)
+                                      'consult-highlight-match nil str))
+            (setq m (cddr m))))))))
 
 (defconst consult--convert-regexp-table
   (append



reply via email to

[Prev in Thread] Current Thread [Next in Thread]