Subject: bug#72830: Big rectangular selections are slow

From: Mattias Engdegård <[email-masked]>
Date: Sun, 22 Sep 2024 18:22:04 +0200

22 sep. 2024 kl. 17.32 skrev Stefan Monnier <[email-masked]>:

> Hmm... I thought your complaint about the cost of
> `select-active-regions` was due to the cost being too high in step
> 2 (which would indicate that the code does not behave quite like the
> design I described, and would thus be a simple bug we should fix).
> 
> Are you saying that when you said:
> 
>    - `select-active-regions`: as mentioned, it slows down rectangle
>      selection massively ...
> 
> you were talking about the slowdown imposed in step 4 rather than in
> step 2?

Sorry if I've lost track with your step numbering, but the problem is still that we extract and retain the selected text both at selection and each incremental modification of it.

So the extraction needs to be delayed until either requested by the X server or locally by mouse-yank-primary. This means that we need to decide whether it would be a problem to do so, as the buffer may have changed between the selection and text extraction. (I think we shouldn't bother preserving PRIMARY data across buffer modification.)