Subject: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin region

From: Eli Zaretskii <[email-masked]>
Date: Wed, 01 Jul 2020 17:13:23 +0300

> From: Yuri D'Elia <[email-masked]>
> Date: Wed, 01 Jul 2020 14:30:14 +0200
> 
> The combined behavior of the mouse and "scroll-margin" is a bit odd
> currently.

As discussed elsewhere, the problem here is to define alternative
behavior that could make sense while preventing the downsides.

> If you have a buffer which has "scroll-margin" enabled, and you click
> anywhere in the scroll-margin region, the point is moved and the buffer
> is immediately scrolled.

That is true, but it's the intended behavior: a mouse clock sets
point, and the scroll-margin says scroll the window when point enters
the margin for any reason.  So this does what it should do.

> This in turn often results in the click becoming a "drag" instead,
> selecting parts of the buffer.

This part I couldn't reproduce.  Maybe it's specific to the
window-system you are using or to something else that isn't Emacs per
se.

> If feels like that moving the point when using the mouse shouldn't
> trigger scroll-margin ever, since any action that causes a scroll would
> immediately move the current target away and result in unintended
> behavior.

I don't think I understand what you mean by "move the current target
away".  Text scrolls, but it doesn't scroll out of the window, at
least not in my testing.

> I can see the same effect when performing a selection by
> dragging: once you reach the scroll-margin area every single motion
> events selects half the visible buffer, which is also broken.

You need to select "carefully", and then it doesn't select half of the
window, but only what you dragged across.  But yes, this is a bit
tricky.

Once again, the problem is to decide what to do instead.

Thanks.