Subject: bug#21092: 25.0.50; Option `lazy-highlight-max-at-a-time' does not work

From: Juri Linkov <[email-masked]>
Date: Thu, 03 Sep 2015 01:40:10 +0300

>> I tried to find a useful application for this feature, and finally found.
>
> Great.  What's the application?

Reducing flicker.

>> > Whole buffer OR rest-of-buffer forward or backward.  Au choix.
>> > Both behaviors are useful.
>>
>> Since you can scroll up or down, highlighting the whole buffer is
>> unavoidable.
>
> I don't understand.  Can you elaborate a bit?

With ‘isearch-allow-scroll’ you can scroll backwards to previous
parts of the buffer that need to display highlighted matches too.

>> > A second question concerns how to control whether this acts
>> > only in the current search direction or in both directions.
>>
>> We can highlight only in the search direction because regexp
>> search might match different results depending on direction.
>> So you need to switch directions with ‘C-r’ to re-highlight
>> the buffer.
>
> You just said that "highlighting the whole buffer is unavoidable",
> so I am a bit confused.  Now you seem to be saying that we can
> highlight only in one direction at a time.  Maybe you could
> elaborate a bit here?

Highlighting the whole buffer needs to be in the same direction
as the current search direction.  But ‘isearch-lazy-highlight-update’
already takes care about this.

> The difference is that I did not change the occurrences of
> `window-(start|end)' in `isearch-lazy-highlight-new-loop'.
> I wasn't sure it was needed (not fully understanding it),
> and I didn't notice a problem without it.

You can see the difference when scrolling by one line
with e.g. ‘scroll-down-line’.