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#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Date: Mon, 04 Apr 2022 22:40:11 +0300 Organization: LINKOV.NET Message-ID: <86lewk4oys.fsf@mail.linkov.net> References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29963"; 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: Stefan Monnier , 14013@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 04 21:52:14 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 1nbSkH-0007d9-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Apr 2022 21:52:13 +0200 Original-Received: from localhost ([::1]:51054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbSkG-00024E-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Apr 2022 15:52:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbSk7-00021Y-29 for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 15:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbSk6-0005WL-HT for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 15:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nbSk6-0004tI-E9 for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2022 15:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Apr 2022 19:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14013-submit@debbugs.gnu.org id=B14013.164910187518691 (code B ref 14013); Mon, 04 Apr 2022 19:52:02 +0000 Original-Received: (at 14013) by debbugs.gnu.org; 4 Apr 2022 19:51:15 +0000 Original-Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSjL-0004rO-5H for submit@debbugs.gnu.org; Mon, 04 Apr 2022 15:51:15 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:33249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSjJ-0004r3-FZ for 14013@debbugs.gnu.org; Mon, 04 Apr 2022 15:51:13 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8DCDE20002; Mon, 4 Apr 2022 19:51:05 +0000 (UTC) In-Reply-To: <86pmlyqbfh.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 03 Apr 2022 21:05:07 +0300") 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:229420 Archived-At: > This works surprisingly well. Maybe there are more corner cases, > but something already works with quick tests: But there is a long-standing bug in query-replace. The optimization that uses `match-again` and `looking-at` ignores search-related variables such as isearch-search-fun-function, replace-re-search-function, etc. Here's is a test case that demonstrates the problem in current master with the recent addition of dired-isearch-search-filenames: 1. cd /tmp; touch file1; ln -s file1 file2 2. enter Wdired and move point to the beginning of file2 3. C-M-% .* RET foo RET 4. answer `n` when asked to replace `file2` After that the remaining part of the same line is highlighted, i.e. the part after "file2" (that is a symbolic link) in: file2 -> file1 This is because the `match-again` optimization uses `(looking-at ".*")` after the previous replacement "file2" to ask about the next replacement of " -> file1" that ignores isearch-search-fun-function. I believe it would be safe to just remove this `match-again` optimization from `perform-replace`.