From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#53758: 28.0.91; Recursive edit during dired-do-find-regexp-and-replace breaks isearch Date: Sun, 06 Feb 2022 19:44:34 +0200 Organization: LINKOV.NET Message-ID: <867da8x7v1.fsf@mail.linkov.net> References: <87mtj7yddd.fsf@earth.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3125"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: sbaugh@catern.com, 53758@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 06 19:01:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGlqv-0000iX-9Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Feb 2022 19:01:33 +0100 Original-Received: from localhost ([::1]:51250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGlqt-0004kt-LI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Feb 2022 13:01:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGlqQ-0004KF-EQ for bug-gnu-emacs@gnu.org; Sun, 06 Feb 2022 13:01:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGlqQ-0001Og-5a for bug-gnu-emacs@gnu.org; Sun, 06 Feb 2022 13:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGlqQ-0006vC-5W for bug-gnu-emacs@gnu.org; Sun, 06 Feb 2022 13:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Feb 2022 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53758 X-GNU-PR-Package: emacs Original-Received: via spool by 53758-submit@debbugs.gnu.org id=B53758.164417045326551 (code B ref 53758); Sun, 06 Feb 2022 18:01:02 +0000 Original-Received: (at 53758) by debbugs.gnu.org; 6 Feb 2022 18:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:39798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGlqG-0006uB-TW for submit@debbugs.gnu.org; Sun, 06 Feb 2022 13:00:53 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:32957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGlqF-0006tv-7s for 53758@debbugs.gnu.org; Sun, 06 Feb 2022 13:00:52 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8DF6A1BF205; Sun, 6 Feb 2022 18:00:42 +0000 (UTC) In-Reply-To: <87mtj7yddd.fsf@earth.mail-host-address-is-not-set> (sbaugh@catern.com's message of "Thu, 03 Feb 2022 19:11:11 +0000 (UTC)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226167 Archived-At: > isearch-forward (C-s) while in a recursive edit (C-r) triggered from > dired-do-find-regexp-and-replace (Q in a dired buffer) always fails to > find any matches for any string, even if there are matches in the > buffer. > > Steps to reproduce: > 1. Open a dired buffer in a directory containing at least one file which > contains some text (e.g. "Hello world") > 2. Run dired-do-find-regexp-and-replace to replace "Hello" with > "Goodbye" ("Q Hello RET Goodbye RET"); this will switch buffers > to the first matching file. > 3. Type C-r to enter a recursive edit (I'm guessing this runs > (recursive-edit)?) > 4. At the start of the buffer, run isearch-forward searching for "world" > ("C-s world RET") > 5. Note that the isearch fails despite "world" being in the buffer. > > For what it's worth, this interestingly doesn't happen with > project-query-regexp-replace (which also does multi-file query-replace). This is because of these lines in xref--query-replace-1: ;; Counteract the "do the next match now" hack in ;; `perform-replace'. And still, it'll report that those ;; matches were "filtered out" at the end. (isearch-filter-predicate (lambda (beg end) (and current-beg (>= beg current-beg) (<= end current-end)))) Dmitry, could you please explain the comment above. What I don't understand is where this "the next match now" hack is in `perform-replace'?