aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 54b3a71bda2..d48f4f3fdf9 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2011,6 +2011,9 @@ passed in. If LITERAL is set, no checking is done, anyway."
2011 (when backward (goto-char (nth 0 match-data))) 2011 (when backward (goto-char (nth 0 match-data)))
2012 noedit) 2012 noedit)
2013 2013
2014(defvar replace-update-post-hook nil
2015 "Function(s) to call after query-replace has found a match in the buffer.")
2016
2014(defvar replace-search-function nil 2017(defvar replace-search-function nil
2015 "Function to use when searching for strings to replace. 2018 "Function to use when searching for strings to replace.
2016It is used by `query-replace' and `replace-string', and is called 2019It is used by `query-replace' and `replace-string', and is called
@@ -2264,7 +2267,7 @@ It must return a string."
2264 (and nonempty-match 2267 (and nonempty-match
2265 (or (not regexp-flag) 2268 (or (not regexp-flag)
2266 (and (if backward 2269 (and (if backward
2267 (looking-back search-string) 2270 (looking-back search-string nil)
2268 (looking-at search-string)) 2271 (looking-at search-string))
2269 (let ((match (match-data))) 2272 (let ((match (match-data)))
2270 (and (/= (nth 0 match) (nth 1 match)) 2273 (and (/= (nth 0 match) (nth 1 match))
@@ -2318,7 +2321,8 @@ It must return a string."
2318 ;; `real-match-data'. 2321 ;; `real-match-data'.
2319 (while (not done) 2322 (while (not done)
2320 (set-match-data real-match-data) 2323 (set-match-data real-match-data)
2321 (replace-highlight 2324 (run-hooks 'replace-update-post-hook) ; Before `replace-highlight'.
2325 (replace-highlight
2322 (match-beginning 0) (match-end 0) 2326 (match-beginning 0) (match-end 0)
2323 start end search-string 2327 start end search-string
2324 regexp-flag delimited-flag case-fold-search backward) 2328 regexp-flag delimited-flag case-fold-search backward)