Subject: bug#72830: Big rectangular selections are slow

From: Eli Zaretskii <[email-masked]>
Date: Tue, 27 Aug 2024 20:47:18 +0300

> From: Mattias Engdegård <[email-masked]>
> Date: Tue, 27 Aug 2024 18:42:19 +0200
> Cc: Emacs Bug Report <[email-masked]>,
>  Juri Linkov <[email-masked]>
> 
> 27 aug. 2024 kl. 15.48 skrev Eli Zaretskii <[email-masked]>:
> 
> > Does turning off auto-composition-mode help in any way?
> 
> I don't think so. Were you able to reproduce the problem?

I didn't have time to try, sorry.  Too much stuff on my plate, and
still only 24 hours a day, even with Emacs 30...

> Yes, I see no reason for having the highlight overlay on something that can't be seen. 
> 
> But how do we know what the viewport will be in `rectangle--highlight-for-redisplay`? Since it is redisplay that determines window-start and window-end, and it hasn't run yet, this puts us in some kind of chicken-egg situation. Maybe it has to be done inside redisplay.

It has to be done with the display code, but does not have to be as
part of redisplay.  We can use functions like vertical-motion,
window-text-pixel-size, posn-at-point, and other similar APIs, which
all employ display code that performs layout-related calculations
without actually displaying anything.