]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/isearch.el: Add save-match-data for funcall isearch-filter-predicate.
authorJuri Linkov <juri@linkov.net>
Tue, 13 Jul 2021 22:29:53 +0000 (01:29 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 13 Jul 2021 22:29:53 +0000 (01:29 +0300)
* lisp/isearch.el (isearch-search): Add save-match-data before
funcall isearch-filter-predicate.
(isearch-lazy-highlight-search): Add save-match-data before
funcall isearch-filter-predicate.
(Bug#49534)

lisp/isearch.el

index d1b9f2c4397963fde0f9d150e04cad678a4f6760..4bc5956e50eef16a7521a92ecf1d98e47e039f5a 100644 (file)
@@ -3529,8 +3529,9 @@ Optional third argument, if t, means if fail just return nil (no error).
          ;; Clear RETRY unless the search predicate says
          ;; to skip this search hit.
          (if (or (not isearch-success)
-                 (funcall isearch-filter-predicate
-                          (match-beginning 0) (match-end 0)))
+                 (save-match-data
+                   (funcall isearch-filter-predicate
+                            (match-beginning 0) (match-end 0))))
              (setq retry nil)
            ;; Advance point on empty matches before retrying
            (when (= (match-beginning 0) (match-end 0))
@@ -4048,8 +4049,9 @@ Attempt to do the search exactly the way the pending Isearch would."
          ;; to skip this search hit.
          (if (or (not success)
                  (= (match-beginning 0) (match-end 0))
-                 (funcall isearch-filter-predicate
-                          (match-beginning 0) (match-end 0)))
+                 (save-match-data
+                   (funcall isearch-filter-predicate
+                            (match-beginning 0) (match-end 0))))
              (setq retry nil)))
        success)
     (error nil)))