emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dd34bef: Revert e0619995594d1686afd0493391417d6f900d632c that add


From: Juri Linkov
Subject: master dd34bef: Revert e0619995594d1686afd0493391417d6f900d632c that added save-match-data.
Date: Tue, 13 Jul 2021 19:21:29 -0400 (EDT)

branch: master
commit dd34bef7d3769a8574bcee2c1e91e8445129af75
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    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 4bc5956..922ab0f 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]