unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: michael_heerdegen@web.de
Cc: 11746@debbugs.gnu.org
Subject: bug#11746: feature request: `isearch-query-replace' should open invisible text
Date: Wed, 20 Jun 2012 00:15:45 +0300	[thread overview]
Message-ID: <87395rm29q.fsf@mail.jurta.org> (raw)
In-Reply-To: <87mx3z9od7.fsf@web.de> (Michael Heerdegen's message of "Tue, 19 Jun 2012 19:56:52 +0200")

> 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	other threads:[~2012-06-19 21:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 17:56 bug#11746: feature request: `isearch-query-replace' should open invisible text Michael Heerdegen
2012-06-19 21:15 ` Juri Linkov [this message]
2013-02-14 19:02 ` Juri Linkov
2013-02-14 20:17   ` Michael Heerdegen
2013-02-15  7:54     ` Juri Linkov
2013-05-27 23:04     ` Juri Linkov
2013-05-28 22:28       ` Juri Linkov
2013-05-30  0:03         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87395rm29q.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=11746@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).