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: Tue, 08 Feb 2022 21:32:44 +0200 Organization: LINKOV.NET Message-ID: <86h799jgrn.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> <87tuo123ru.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3218"; 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: 14013@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 08 20:44:44 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 1nHWPs-0000fu-7i for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 20:44:44 +0100 Original-Received: from localhost ([::1]:50994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHWPr-00027s-6y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 14:44:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWIQ-0002ch-6J for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 14:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWIP-0000w4-SS for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 14:37:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHWIP-0007an-Qi for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 14:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Feb 2022 19:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14013 X-GNU-PR-Package: emacs Original-Received: via spool by 14013-submit@debbugs.gnu.org id=B14013.164434898729113 (code B ref 14013); Tue, 08 Feb 2022 19:37:01 +0000 Original-Received: (at 14013) by debbugs.gnu.org; 8 Feb 2022 19:36:27 +0000 Original-Received: from localhost ([127.0.0.1]:48713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWHr-0007ZT-6t for submit@debbugs.gnu.org; Tue, 08 Feb 2022 14:36:27 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:56289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWHo-0007Z9-Ox; Tue, 08 Feb 2022 14:36:25 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C482E100003; Tue, 8 Feb 2022 19:36:16 +0000 (UTC) In-Reply-To: <87tuo123ru.fsf@web.de> (Michael Heerdegen's message of "Tue, 20 Apr 2021 02:33:41 +0200") 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:226406 Archived-At: forcemerge 14013 29215 thanks > Michael Heerdegen writes: > >> Right, thanks. Now I'm beginning to understand how this code works. > > BTW, one (related) thing that I found problematic over the time: I like > to use query-replace on file names in WDired. There is no way to match > the beginning of the file name - right? That's sometimes a problem. In > this situation it is even better to use dired-isearch-filenames -> nil > because then I can match the space character before the beginning of the > file name. Like was discussed in bug#53758, xref uses ".*" to replace in results where search/replace should be performed only within boundaries of matches. xref uses own search function: (replace-re-search-function (lambda (from &optional _bound noerror) (let (found pair) (while (and (not found) pairs) (setq pair (pop pairs) current-beg (car pair) current-end (cdr pair)) (goto-char current-beg) (when (re-search-forward from current-end noerror) (setq found t))) found))) So maybe Dired/WDired could use a similar function. But in any case it seems matching at the beginning of the file name with "^" as also requested by Drew in bug#29215 (merged) is still impossible.