bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11746: feature request: `isearch-query-replace' should open invisibl


From: Juri Linkov
Subject: bug#11746: feature request: `isearch-query-replace' should open invisible text
Date: Wed, 20 Jun 2012 00:15:45 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)

> Dunno if this would be easy to implement.  `isearch-query-replace'
> uses just `perform-replace' from replace.el, which doesn't care about
> invisible text.

A quick try does exactly what is needed:

=== modified file 'lisp/replace.el'
--- lisp/replace.el     2012-05-01 02:48:41 +0000
+++ lisp/replace.el     2012-06-19 21:14:59 +0000
@@ -1840,7 +1840,9 @@ (defun perform-replace (from-string repl
                                           limit t)
                                  ;; For speed, use only integers and
                                  ;; reuse the list used last time.
-                                 (replace-match-data t real-match-data)))
+                                 (prog1 (replace-match-data t real-match-data)
+                                   (isearch-range-invisible
+                                    (match-beginning 0) (match-end 0)))))
                                ((and (< (1+ (point)) (point-max))
                                      (or (null limit)
                                          (< (1+ (point)) limit)))

But it would be better to implement this the same way as for isearch
filters.  Adding the same filters in replacements also will make the
variable `query-replace-skip-read-only' obsolete.





reply via email to

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