GNU bug report logs -
#72147
30.0.60; 30.0.60; Misleading regexp highlighting in 'Q' dired command
Previous Next
Reported by: Visuwesh <visuweshm <at> gmail.com>
Date: Wed, 17 Jul 2024 03:44:02 UTC
Severity: normal
Found in version 30.0.60
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
[வெள்ளி ஜூலை 19, 2024] Juri Linkov wrote:
>> When using the Q command in dired to query-replace-regexp across marked
>> files in dired, the regexp typed in the first prompt highlights text in
>> the _dired_ buffer.
>>
>> To reproduce,
>>
>> 1. emacs -Q
>> 2. C-x d ~
>> 3. Q -
>>
>> Notice how the dashes in the permission fields are highlighted. This is
>> misleading and even confusing. It would be better to turn off regexp
>> highlighting for this command. The attached patch does the job on my
>> end. Let binding the variable this way does not turn off
>> lazy-highlighting during the replacement.
>>
>> @@ -3801,9 +3801,10 @@ dired-do-query-replace-regexp
>> (interactive
>> - (let ((common
>> - (query-replace-read-args
>> - "Query replace regexp in marked files" t t)))
>> + (let* ((query-replace-lazy-highlight)
>> + (common
>> + (query-replace-read-args
>> + "Query replace regexp in marked files" t t)))
>
> Thanks, I tried your patch, but it has no effect since
> by default Q is bound to dired-do-find-regexp-and-replace.
Ah, I guess I didn't test properly in emacs -Q. I ended up mixing my
own config and emacs -Q. My bad.
> Shouldn't query-replace-lazy-highlight be added to all
> functions in dired that use query-replace-read-args?
Yes, you're right. I have attached a patch that does it.
BTW, is there a reason why xref--query-replace-1 let-binds
query-replace-lazy-highlight to nil?
[0001-Don-t-highlight-matches-in-dired-query-replace-comma.patch (text/x-diff, attachment)]
This bug report was last modified 301 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.