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


View this message in rfc822 format

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: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames
Date: Mon, 04 Apr 2022 22:40:11 +0300
> 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`.




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.