Speed up tall rectangular selections (bug#72830)
Instead of setting the highlight overlay on every line in the selection,
only do so on the window-height worth of lines closest to point because
the rest aren't likely to be visible.
This makes a massive difference for tall rectangular selections which
previously were so slow as to be unusable.
(Tall selections are still slow if `select-active-regions` is non-nil,
but that is something that users can actually do something about.)
* lisp/rect.el (rectangle--highlight-for-redisplay)
(rectangle--unhighlight-for-redisplay):
Replace call to `apply-on-rectangle`, which operates on every line,
with a loop over an approximate screenful.
Extend the `rectangle` overlay list structure with a value for point,
because `exchange-point-and-mark` must trigger a recomputation of
highlight overlays despite the selection not actually changing.
(cherry picked from commit
38c7516827902cdfb70bf68b2da4296a8d9349c0)