Skip to content

Commit dd34bef

Browse files
committed
Revert e061999 that added save-match-data.
* lisp/isearch.el (isearch-filter-predicate): Mention precautions against clobbering the match data in docstring (bug#49534).
1 parent e061999 commit dd34bef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lisp/isearch.el

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ called with the positions of the start and the end of the text
233233
matched by Isearch and replace commands. If this function
234234
returns nil, Isearch and replace commands will continue searching
235235
without stopping at resp. replacing this match.
236+
This function is expected to be careful not to clobber the match data.
236237
237238
If you use `add-function' to modify this variable, you can use the
238239
`isearch-message-prefix' advice property to specify the prefix string
@@ -3529,9 +3530,8 @@ Optional third argument, if t, means if fail just return nil (no error).
35293530
;; Clear RETRY unless the search predicate says
35303531
;; to skip this search hit.
35313532
(if (or (not isearch-success)
3532-
(save-match-data
3533-
(funcall isearch-filter-predicate
3534-
(match-beginning 0) (match-end 0))))
3533+
(funcall isearch-filter-predicate
3534+
(match-beginning 0) (match-end 0)))
35353535
(setq retry nil)
35363536
;; Advance point on empty matches before retrying
35373537
(when (= (match-beginning 0) (match-end 0))
@@ -4049,9 +4049,8 @@ Attempt to do the search exactly the way the pending Isearch would."
40494049
;; to skip this search hit.
40504050
(if (or (not success)
40514051
(= (match-beginning 0) (match-end 0))
4052-
(save-match-data
4053-
(funcall isearch-filter-predicate
4054-
(match-beginning 0) (match-end 0))))
4052+
(funcall isearch-filter-predicate
4053+
(match-beginning 0) (match-end 0)))
40554054
(setq retry nil)))
40564055
success)
40574056
(error nil)))

0 commit comments

Comments
 (0)