[வெள்ளி ஜூலை 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?