aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2013-05-28 02:02:37 +0300
committerJuri Linkov2013-05-28 02:02:37 +0300
commitd289938a057ab8572fc60eb5367980eeef35d600 (patch)
tree90ca18e1aeef7cc5f824ce5ed8d8ac99887eeb4e
parent66fc57e3cdc9ffc2bed7a457a39a210fcf773e98 (diff)
downloademacs-d289938a057ab8572fc60eb5367980eeef35d600.tar.gz
emacs-d289938a057ab8572fc60eb5367980eeef35d600.zip
* lisp/replace.el (perform-replace): Ignore invisible matches.
In addition to checking `query-replace-skip-read-only', also filter out matches by calling `run-hook-with-args-until-failure' on `isearch-filter-predicates', and also check `search-invisible' for t or call `isearch-range-invisible'. (replace-dehighlight): Call `isearch-clean-overlays'. Fixes: debbugs:11746
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/replace.el20
3 files changed, 28 insertions, 6 deletions
diff --git a/etc/NEWS b/etc/NEWS
index fbb32326dac..80546ce985a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -236,11 +236,14 @@ callers to fit the image to a frame other than the selected frame.
236entries displayed by `Info-index-next', `Info-virtual-index' and 236entries displayed by `Info-index-next', `Info-virtual-index' and
237`info-apropos'. 237`info-apropos'.
238 238
239** Isearch 239** Search and Replace
240 240
241*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name 241*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name
242and adds it to the search string. 242and adds it to the search string.
243 243
244*** `query-replace' skips invisible text when `search-invisible' is nil,
245and opens overlays with hidden text when `search-invisible' is `open'.
246
244** MH-E has been updated to MH-E version 8.5. 247** MH-E has been updated to MH-E version 8.5.
245See MH-E-NEWS for details. 248See MH-E-NEWS for details.
246 249
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 486e5d75343..cc3122f7e6f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,14 @@
12013-05-27 Juri Linkov <juri@jurta.org> 12013-05-27 Juri Linkov <juri@jurta.org>
2 2
3 * replace.el (perform-replace): Ignore invisible matches.
4 In addition to checking `query-replace-skip-read-only', also
5 filter out matches by calling `run-hook-with-args-until-failure'
6 on `isearch-filter-predicates', and also check `search-invisible'
7 for t or call `isearch-range-invisible'.
8 (replace-dehighlight): Call `isearch-clean-overlays'. (Bug#11746)
9
102013-05-27 Juri Linkov <juri@jurta.org>
11
3 * isearch.el (isearch-filter-predicates): Rename from 12 * isearch.el (isearch-filter-predicates): Rename from
4 `isearch-filter-predicate'. Doc fix. (Bug#11378) 13 `isearch-filter-predicate'. Doc fix. (Bug#11378)
5 (isearch-message-prefix): Display text from the property 14 (isearch-message-prefix): Display text from the property
diff --git a/lisp/replace.el b/lisp/replace.el
index 1bebff448fa..7c26f1ed063 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2003,10 +2003,18 @@ make, or the user didn't cancel the call."
2003 match)))))) 2003 match))))))
2004 2004
2005 ;; Optionally ignore matches that have a read-only property. 2005 ;; Optionally ignore matches that have a read-only property.
2006 (unless (and query-replace-skip-read-only 2006 (when (and (or (not query-replace-skip-read-only)
2007 (text-property-not-all 2007 (not (text-property-not-all
2008 (nth 0 real-match-data) (nth 1 real-match-data) 2008 (nth 0 real-match-data) (nth 1 real-match-data)
2009 'read-only nil)) 2009 'read-only nil)))
2010 ;; Optionally filter out matches.
2011 (run-hook-with-args-until-failure
2012 'isearch-filter-predicates
2013 (nth 0 real-match-data) (nth 1 real-match-data))
2014 ;; Optionally ignore invisible matches.
2015 (or (eq search-invisible t)
2016 (not (isearch-range-invisible
2017 (nth 0 real-match-data) (nth 1 real-match-data)))))
2010 2018
2011 ;; Calculate the replacement string, if necessary. 2019 ;; Calculate the replacement string, if necessary.
2012 (when replacements 2020 (when replacements
@@ -2251,6 +2259,8 @@ make, or the user didn't cancel the call."
2251 (delete-overlay replace-overlay)) 2259 (delete-overlay replace-overlay))
2252 (when query-replace-lazy-highlight 2260 (when query-replace-lazy-highlight
2253 (lazy-highlight-cleanup lazy-highlight-cleanup) 2261 (lazy-highlight-cleanup lazy-highlight-cleanup)
2254 (setq isearch-lazy-highlight-last-string nil))) 2262 (setq isearch-lazy-highlight-last-string nil))
2263 ;; Close overlays opened by `isearch-range-invisible' in `perform-replace'.
2264 (isearch-clean-overlays))
2255 2265
2256;;; replace.el ends here 2266;;; replace.el ends here