From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#11746: feature request: `isearch-query-replace' should open invisible text Date: Wed, 20 Jun 2012 00:15:45 +0300 Organization: JURTA Message-ID: <87395rm29q.fsf@mail.jurta.org> References: <87mx3z9od7.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340140666 2258 80.91.229.3 (19 Jun 2012 21:17:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 21:17:46 +0000 (UTC) Cc: 11746@debbugs.gnu.org To: michael_heerdegen@web.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 19 23:17:45 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sh5o0-0000P1-Kd for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jun 2012 23:17:44 +0200 Original-Received: from localhost ([::1]:35657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh5o0-0000dx-J9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jun 2012 17:17:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh5nx-0000bI-N9 for bug-gnu-emacs@gnu.org; Tue, 19 Jun 2012 17:17:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh5nw-0004aZ-1e for bug-gnu-emacs@gnu.org; Tue, 19 Jun 2012 17:17:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh5nv-0004aC-UG for bug-gnu-emacs@gnu.org; Tue, 19 Jun 2012 17:17:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sh5rC-0002Bf-BK for bug-gnu-emacs@gnu.org; Tue, 19 Jun 2012 17:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jun 2012 21:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11746 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11746-submit@debbugs.gnu.org id=B11746.13401408618400 (code B ref 11746); Tue, 19 Jun 2012 21:21:02 +0000 Original-Received: (at 11746) by debbugs.gnu.org; 19 Jun 2012 21:21:01 +0000 Original-Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sh5rB-0002BQ-3d for submit@debbugs.gnu.org; Tue, 19 Jun 2012 17:21:01 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:45842 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sh5r8-0002Ar-VM for 11746@debbugs.gnu.org; Tue, 19 Jun 2012 17:21:00 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 88449451C9D2; Tue, 19 Jun 2012 14:17:33 -0700 (PDT) In-Reply-To: <87mx3z9od7.fsf@web.de> (Michael Heerdegen's message of "Tue, 19 Jun 2012 19:56:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61130 Archived-At: > 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.