[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112747: * lisp/replace.el (perform-r
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112747: * lisp/replace.el (perform-replace): Ignore invisible matches. |
Date: |
Tue, 28 May 2013 02:02:37 +0300 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112747
fixes bug: http://debbugs.gnu.org/11746
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-05-28 02:02:37 +0300
message:
* 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'.
modified:
etc/NEWS
lisp/ChangeLog
lisp/replace.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2013-05-27 22:42:11 +0000
+++ b/etc/NEWS 2013-05-27 23:02:37 +0000
@@ -236,11 +236,14 @@
entries displayed by `Info-index-next', `Info-virtual-index' and
`info-apropos'.
-** Isearch
+** Search and Replace
*** `C-x 8 RET' in Isearch mode reads a character by its Unicode name
and adds it to the search string.
+*** `query-replace' skips invisible text when `search-invisible' is nil,
+and opens overlays with hidden text when `search-invisible' is `open'.
+
** MH-E has been updated to MH-E version 8.5.
See MH-E-NEWS for details.
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-05-27 22:42:11 +0000
+++ b/lisp/ChangeLog 2013-05-27 23:02:37 +0000
@@ -1,5 +1,14 @@
2013-05-27 Juri Linkov <address@hidden>
+ * 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'. (Bug#11746)
+
+2013-05-27 Juri Linkov <address@hidden>
+
* isearch.el (isearch-filter-predicates): Rename from
`isearch-filter-predicate'. Doc fix. (Bug#11378)
(isearch-message-prefix): Display text from the property
=== modified file 'lisp/replace.el'
--- a/lisp/replace.el 2013-03-24 21:47:52 +0000
+++ b/lisp/replace.el 2013-05-27 23:02:37 +0000
@@ -2003,10 +2003,18 @@
match))))))
;; Optionally ignore matches that have a read-only property.
- (unless (and query-replace-skip-read-only
- (text-property-not-all
- (nth 0 real-match-data) (nth 1 real-match-data)
- 'read-only nil))
+ (when (and (or (not query-replace-skip-read-only)
+ (not (text-property-not-all
+ (nth 0 real-match-data) (nth 1 real-match-data)
+ 'read-only nil)))
+ ;; Optionally filter out matches.
+ (run-hook-with-args-until-failure
+ 'isearch-filter-predicates
+ (nth 0 real-match-data) (nth 1 real-match-data))
+ ;; Optionally ignore invisible matches.
+ (or (eq search-invisible t)
+ (not (isearch-range-invisible
+ (nth 0 real-match-data) (nth 1
real-match-data)))))
;; Calculate the replacement string, if necessary.
(when replacements
@@ -2251,6 +2259,8 @@
(delete-overlay replace-overlay))
(when query-replace-lazy-highlight
(lazy-highlight-cleanup lazy-highlight-cleanup)
- (setq isearch-lazy-highlight-last-string nil)))
+ (setq isearch-lazy-highlight-last-string nil))
+ ;; Close overlays opened by `isearch-range-invisible' in `perform-replace'.
+ (isearch-clean-overlays))
;;; replace.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112747: * lisp/replace.el (perform-replace): Ignore invisible matches.,
Juri Linkov <=