aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2021-07-14 02:21:17 +0300
committerJuri Linkov2021-07-14 02:21:17 +0300
commitdd34bef7d3769a8574bcee2c1e91e8445129af75 (patch)
treee75cb0d4ab270aa8d79117cc7a8d2e407646f244
parente0619995594d1686afd0493391417d6f900d632c (diff)
downloademacs-dd34bef7d3769a8574bcee2c1e91e8445129af75.tar.gz
emacs-dd34bef7d3769a8574bcee2c1e91e8445129af75.zip
Revert e0619995594d1686afd0493391417d6f900d632c that added save-match-data.
* lisp/isearch.el (isearch-filter-predicate): Mention precautions against clobbering the match data in docstring (bug#49534).
-rw-r--r--lisp/isearch.el11
1 files 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
233matched by Isearch and replace commands. If this function 233matched by Isearch and replace commands. If this function
234returns nil, Isearch and replace commands will continue searching 234returns nil, Isearch and replace commands will continue searching
235without stopping at resp. replacing this match. 235without stopping at resp. replacing this match.
236This function is expected to be careful not to clobber the match data.
236 237
237If you use `add-function' to modify this variable, you can use the 238If you use `add-function' to modify this variable, you can use the
238`isearch-message-prefix' advice property to specify the prefix string 239`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).
3529 ;; Clear RETRY unless the search predicate says 3530 ;; Clear RETRY unless the search predicate says
3530 ;; to skip this search hit. 3531 ;; to skip this search hit.
3531 (if (or (not isearch-success) 3532 (if (or (not isearch-success)
3532 (save-match-data 3533 (funcall isearch-filter-predicate
3533 (funcall isearch-filter-predicate 3534 (match-beginning 0) (match-end 0)))
3534 (match-beginning 0) (match-end 0))))
3535 (setq retry nil) 3535 (setq retry nil)
3536 ;; Advance point on empty matches before retrying 3536 ;; Advance point on empty matches before retrying
3537 (when (= (match-beginning 0) (match-end 0)) 3537 (when (= (match-beginning 0) (match-end 0))
@@ -4049,9 +4049,8 @@ Attempt to do the search exactly the way the pending Isearch would."
4049 ;; to skip this search hit. 4049 ;; to skip this search hit.
4050 (if (or (not success) 4050 (if (or (not success)
4051 (= (match-beginning 0) (match-end 0)) 4051 (= (match-beginning 0) (match-end 0))
4052 (save-match-data 4052 (funcall isearch-filter-predicate
4053 (funcall isearch-filter-predicate 4053 (match-beginning 0) (match-end 0)))
4054 (match-beginning 0) (match-end 0))))
4055 (setq retry nil))) 4054 (setq retry nil)))
4056 success) 4055 success)
4057 (error nil))) 4056 (error nil)))