From dd34bef7d3769a8574bcee2c1e91e8445129af75 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 14 Jul 2021 02:21:17 +0300 Subject: [PATCH] Revert e0619995594d1686afd0493391417d6f900d632c that added save-match-data. * lisp/isearch.el (isearch-filter-predicate): Mention precautions against clobbering the match data in docstring (bug#49534). --- lisp/isearch.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 4bc5956e50e..922ab0f6ad4 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -233,6 +233,7 @@ called with the positions of the start and the end of the text matched by Isearch and replace commands. If this function returns nil, Isearch and replace commands will continue searching without stopping at resp. replacing this match. +This function is expected to be careful not to clobber the match data. If you use `add-function' to modify this variable, you can use the `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). ;; Clear RETRY unless the search predicate says ;; to skip this search hit. (if (or (not isearch-success) - (save-match-data - (funcall isearch-filter-predicate - (match-beginning 0) (match-end 0)))) + (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)) @@ -4049,9 +4049,8 @@ 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)) - (save-match-data - (funcall isearch-filter-predicate - (match-beginning 0) (match-end 0)))) + (funcall isearch-filter-predicate + (match-beginning 0) (match-end 0))) (setq retry nil))) success) (error nil))) -- 2.39.2