From: Juri Linkov Date: Tue, 13 Jul 2021 22:29:53 +0000 (+0300) Subject: * lisp/isearch.el: Add save-match-data for funcall isearch-filter-predicate. X-Git-Tag: emacs-28.0.90~1877 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e0619995594d1686afd0493391417d6f900d632c;p=emacs.git * lisp/isearch.el: Add save-match-data for funcall isearch-filter-predicate. * 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) --- diff --git a/lisp/isearch.el b/lisp/isearch.el index d1b9f2c4397..4bc5956e50e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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)))