summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-07-14 01:29:53 +0300
committerJuri Linkov <juri@linkov.net>2021-07-14 01:29:53 +0300
commite0619995594d1686afd0493391417d6f900d632c (patch)
tree9fcad39aa3b322afc70e095bd3e80088db8a9684 /lisp/isearch.el
parentf339cc3b81e28cabfd583c862b5011ac40acf935 (diff)
downloademacs-e0619995594d1686afd0493391417d6f900d632c.tar.gz
emacs-e0619995594d1686afd0493391417d6f900d632c.tar.bz2
emacs-e0619995594d1686afd0493391417d6f900d632c.zip
* 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)
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el10
1 files changed, 6 insertions, 4 deletions
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)))