bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-repl


From: Juri Linkov
Subject: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc.
Date: Thu, 17 Mar 2022 22:43:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> On Thu, 17 Mar 2022 at 19:05, Juri Linkov <juri@linkov.net> wrote:
>
>>>> 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.
>
> Interesting, I can't see thing flash at that particular place.  But I've
> replaced the unwind-protect by a more fine-grained condition-case.  Let
> me know if it helps.
>
>> 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?
>
> The only refactoring opportunity I see it to define
>
>     (defun replace-regexp-function (delimited-flag)
>       (or replace-regexp-function
>           delimited-flag
>           (and replace-char-fold
>                (not regexp-flag)
>                #'char-fold-to-regexp)))
>
> which can be used in 3 places.  Should I do that?
>
> Otherwise, I dont' see much room for improvement.  There are a lot of
> moving parts there, so to me things already turned out surprisingly
> short.

I meant a function that translates arguments of query-replace/perform-replace
to search parameters.  They are currently used in replace-search and
replace-highlight.  But maybe could be reused by query-replace-read-args?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]