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: Wed, 16 Feb 2022 20:11:09 +0200 Organization: LINKOV.NET Message-ID: <86czjmzwi2.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> <87sfsk961i.fsf@web.de> <86leycoszt.fsf@mail.linkov.net> <874k4z38pu.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="11378"; 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 Wed Feb 16 19:53:16 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 1nKPQR-0002nm-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Feb 2022 19:53:15 +0100 Original-Received: from localhost ([::1]:39492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKPQO-0007ee-H1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Feb 2022 13:53:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKPIU-00043Y-KJ for bug-gnu-emacs@gnu.org; Wed, 16 Feb 2022 13:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKPIU-0003kg-Ap for bug-gnu-emacs@gnu.org; Wed, 16 Feb 2022 13:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKPIU-00064S-9M for bug-gnu-emacs@gnu.org; Wed, 16 Feb 2022 13:45: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: Wed, 16 Feb 2022 18:45:02 +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.164503709823310 (code B ref 14013); Wed, 16 Feb 2022 18:45:02 +0000 Original-Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 18:44:58 +0000 Original-Received: from localhost ([127.0.0.1]:49440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKPIQ-00063u-By for submit@debbugs.gnu.org; Wed, 16 Feb 2022 13:44:58 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKPIO-00063M-4P for 14013@debbugs.gnu.org; Wed, 16 Feb 2022 13:44:56 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 606676000A; Wed, 16 Feb 2022 18:44:47 +0000 (UTC) In-Reply-To: <874k4z38pu.fsf@web.de> (Michael Heerdegen's message of "Wed, 16 Feb 2022 02:23:41 +0100") 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:227048 Archived-At: >> This works reliably only because the search function puts point at the >> beginning of every file name during search. > > I'm not about non-interactive searches, seldom use them - can something > like `dired-isearch-filenames-regexp' be done non-interactively? It should work non-interactively as well. > Anyway, my complete idea was: whenever we provide a special search > command that limits isearch to certain entities, like file names in a > dired buffer, we always guarantee that point can be matched at the > beginning of each entity with \= (and maybe also \` and ^). In an > interactive search \= is quite useless (right?), so we can use it for > that and avoid hacks that would probably be worse. This is more complicated for backward search where \= should match at the end of the file name, so \' and $ should be replaced with \=. > We would still not have a solution to match the end of the entities, > however. Fortunately for files in dired $ works (by coincidence). This is still not reliable since the dired line doesn't always end with the end of the file name such as "filename -> symlink" format. But with the previous patch this works because of the BOUND argument of the search function set to the end of the file name. For the backward search, the BOUND argument corresponds to $. This makes the search function more complicated, but this is doable, just needs more special-casing.