Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect

From: Eli Zaretskii <[email-masked]>
Date: Fri, 29 Jul 2022 08:50:02 +0300

> From: Juri Linkov <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 28 Jul 2022 23:08:23 +0300
> 
> > If isearch.el cannot find a better criterion for stopping highlighting
> > beyond some buffer position, it should at least use some reasonable
> > fixed (or customizable) limit.  Another possibility is to turn off
> > lazy-highlight by default when truncate-lines is turned on.
> >
> > This issue is related to poor Emacs performance in buffers with very
> > long lines, and its fix is essential for making Emacs more usable with
> > such buffers.
> 
> I didn't follow the new design of long lines handling.
> Does it just narrow each long truncated line?

I don't think it matters, because that narrowing is in effect only as
long as redisplay runs.  Isearch's lazy-highlight runs off a timer,
not from redisplay.

I think the main point here is that under truncate-lines, whether a
given buffer position is or isn't visible cannot be easily deduced
from just its position and the window-end position.