aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorAlan Mackenzie2015-12-20 12:33:30 +0000
committerAlan Mackenzie2015-12-20 12:33:30 +0000
commitdf32db2f5f3dcad4b2b16fd52e51e1c7bd846609 (patch)
tree74c24ce0fd04942ec496aab04d8f25482944107e /lisp/replace.el
parent6a8a41c5104b29846ed6e69da7576e0960f2bf14 (diff)
parenta72a9fbbbc9cd5f5933719b11489c2578eb0aa59 (diff)
downloademacs-df32db2f5f3dcad4b2b16fd52e51e1c7bd846609.tar.gz
emacs-df32db2f5f3dcad4b2b16fd52e51e1c7bd846609.zip
Merge branch 'scratch/follow' into emacs-25
This allows Isearch, etc., to work well when Follow Mode is active.
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)