Subject: Re: bug#72147: 30.0.60; 30.0.60; Misleading regexp highlighting in 'Q' dired command

From: Juri Linkov <[email-masked]>
Date: Fri, 19 Jul 2024 09:50:23 +0300

> 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.
Shouldn't query-replace-lazy-highlight be added to all
functions in dired that use query-replace-read-args?