Subject: Re: bug#18590: 24.3.93; Scrolling changes/forgets selection

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 13 Apr 2022 02:37:25 +0200

[email-masked] (N. Jackson) writes:

> After highlighting/selecting text in a window, scrolling the window
> vertically with the scroll bar or with the mouse moves the selection so
> that text intentionally selected is no longer selected.
>
> To reproduce:
>
> 1. emacs -Q
>
> 2. Open a file "longer" than the window such as the Emacs README file. E.g. C-x f R E A D M E
>
> 3. C-x h    ; Select all the text in the window.
>
> 4. Scroll the window with the scroll bar or the mouse.
>
> Expected behaviour:
>
> The text that is selected/highlighted remains selected/highlighted.
>
> Observed behaviour:
>
> The selection changes as the window is scrolled up and down.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

This behaviour is still present in Emacs 29, and is due to Emacs always
keeping point visible in the window, and the region being the area
between point and mark.

I remember Po Lu doing some work at allowing point to be outside the
window, which would fix this issue, I think?  But I forget what the
state of that work is, so I've added Lu to the CC's; perhaps he has some
comments.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no