GNU bug report logs - #14013
24.3.50; dired-isearch-filenames-regexp is matching text outside filenames

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Wed, 20 Mar 2013 23:42:01 UTC

Severity: normal

Tags: patch

Merged with 29215

Found in versions 24.3.50, 26.0

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #91 received at 14013 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 14013 <at> debbugs.gnu.org
Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching
 text outside filenames
Date: Mon, 14 Feb 2022 09:41:04 +0200
> Thanks.  I quickly tested your patch, and it seems to work well so far

Thanks for testing, this confirms that the proof of concept is viable,
so now the docstrings could be updated as well.

> (except for the ^ thing fo course).  Also highlighting worked.

To implement ^, I see no way other than special handling:
when a regexp begins with ^, then after removing ^ from the regexp,
call 'looking-at' at the beginning of the file name.

> Anything particular I should keep my eye on?

Please help to decide how search/replace should be implemented in WDired.
The current implementation filters out read-only parts of the Dired buffer.
Should the new search function also skip read-only parts or should it
match only on file names in WDired the same way as in Dired?

>>  (defun wdired-change-to-wdired-mode ()
>> @@ -238,8 +239,9 @@ wdired-change-to-wdired-mode
>>    (setq-local wdired--old-point (point))
>>    (wdired--set-permission-bounds)
>>    (setq-local query-replace-skip-read-only t)
>> -  (add-function :after-while (local 'isearch-filter-predicate)
>> -                #'wdired-isearch-filter-read-only)
>> +  (add-function :around (local 'isearch-search-fun-function)
>> +                #'dired-isearch-search-filenames)
>> +  (setq-local replace-re-search-function #'dired-isearch-search-filenames)
>
> And: Is it intended that this is unconditional (I would expect a
> `dired-isearch-filenames-mode' test)?

Currently it is unconditional when it's using isearch-filter-predicate.
So maybe it should be kept this way since it's what was used for many years?
Or is there a reason to change the current behavior?




This bug report was last modified 1 year and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.