GNU bug report logs - #53126
29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc.

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sat, 8 Jan 2022 13:25:01 UTC

Severity: normal

Tags: patch

Merged with 53341

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 53126 <at> debbugs.gnu.org
Subject: Re: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading
 query-replace string, etc.
Date: Thu, 17 Mar 2022 19:05:34 +0200
>> When I tried your latest patch, it still flashes when it starts
>> the perform-replace loop.
>
> Does it always happen for you?  I see this occasionally, and as far as I
> can tell it's random.

It happens every time when starting perform-replace from isearch.

>>>> Highlighting is still incorrect for word replacement ('C-u M-%')
>>>> and for non-nil 'replace-char-fold'.  To handle these cases correctly,
>>>> 'replace-highlight' uses:
>>>>
>>>> 	    (isearch-regexp-function (or replace-regexp-function
>>>> 					 delimited-flag
>>>> 					 (and replace-char-fold
>>>> 					      (not regexp-flag)
>>>> 					      #'char-fold-to-regexp)))
>>>
>>> Okay, fixed this.  (BTW, where is replace-regexp-function used?  It's
>>> not set anywhere in Emacs, and it's not a defcustom either.)
>>
>> 'replace-regexp-function' was added recently in bug#52558
>> to allow implementing more regexp types in bug#54017.
>
> Ah, I see.  I must say, in isearch.el I don't like this trichotomy of
> the regexp/literal/with isearch-regexp-function cases.  Ideally, the
> regexp and literal search cases would be handled by
> isearch-regexp-function set to identity respectively regexp-quote.  But
> it would be a large refactoring, perhaps with only aesthetic benefits.

Yep, too much changes for little benefit.

The biggest hunk in your patch are changes in query-replace-read-args
starting from 'condition-case error'.  Would it be possible to simplify
this part?  Maybe by some refactoring?

OTOH, your changes that add lazy-count-update-hook and remove
'(null isearch-message-function)' can be already pushed.
Could you please send a separate patch for pushing with these changes only?

Then the patch with minibuffer-lazy-count feature will be shorter.




This bug report was last modified 3 years and 39 days ago.

Previous Next


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