Skip to content

Commit e061999

Browse files
committed
* 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)
1 parent f339cc3 commit e061999

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lisp/isearch.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,8 +3529,9 @@ Optional third argument, if t, means if fail just return nil (no error).
35293529
;; Clear RETRY unless the search predicate says
35303530
;; to skip this search hit.
35313531
(if (or (not isearch-success)
3532-
(funcall isearch-filter-predicate
3533-
(match-beginning 0) (match-end 0)))
3532+
(save-match-data
3533+
(funcall isearch-filter-predicate
3534+
(match-beginning 0) (match-end 0))))
35343535
(setq retry nil)
35353536
;; Advance point on empty matches before retrying
35363537
(when (= (match-beginning 0) (match-end 0))
@@ -4048,8 +4049,9 @@ Attempt to do the search exactly the way the pending Isearch would."
40484049
;; to skip this search hit.
40494050
(if (or (not success)
40504051
(= (match-beginning 0) (match-end 0))
4051-
(funcall isearch-filter-predicate
4052-
(match-beginning 0) (match-end 0)))
4052+
(save-match-data
4053+
(funcall isearch-filter-predicate
4054+
(match-beginning 0) (match-end 0))))
40534055
(setq retry nil)))
40544056
success)
40554057
(error nil)))

0 commit comments

Comments
 (0)