* Ergonomics: mouse clicking with scroll-margin
@ 2020-06-14 17:09 Yuri D'Elia
2020-06-14 17:45 ` Eli Zaretskii
2020-06-14 18:47 ` Stefan Monnier
0 siblings, 2 replies; 6+ messages in thread
From: Yuri D'Elia @ 2020-06-14 17:09 UTC (permalink / raw)
To: emacs-devel
The combined behavior of the mouse and "scroll-margin" is a bit odd
currently and I wonder if there's something that can be done to improve
it.
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.
This in turn often results in the click becoming a "drag" instead,
selecting parts of the buffer.
I rarely use the mouse, but when I do (usually in customize groups, or
when using eww), it trips me all the time since I use a rather large
scroll-margin.
Can this be improved _without_ disabling scroll-margin?
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 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.
Is there a better approach?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ergonomics: mouse clicking with scroll-margin
2020-06-14 17:09 Ergonomics: mouse clicking with scroll-margin Yuri D'Elia
@ 2020-06-14 17:45 ` Eli Zaretskii
2020-06-14 17:58 ` Yuri D'Elia
2020-06-14 18:47 ` Stefan Monnier
1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-06-14 17:45 UTC (permalink / raw)
To: Yuri D'Elia; +Cc: emacs-devel
> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Sun, 14 Jun 2020 19:09:20 +0200
>
> Can this be improved _without_ disabling scroll-margin?
Can you propose a more useful behavior in that case?
> If feels like that moving the point when using the mouse shouldn't
> trigger scroll-margin ever
If you are saying that Emacs should put point inside the scroll-margin
and leave it there in this case, then I don't recommend such a
solution: any subsequent command will scroll the window anyway,
because Emacs is programmed to keep point outside of the scroll
margin.
We need to come up with a more clever approach.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ergonomics: mouse clicking with scroll-margin
2020-06-14 17:45 ` Eli Zaretskii
@ 2020-06-14 17:58 ` Yuri D'Elia
2020-06-14 19:02 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Yuri D'Elia @ 2020-06-14 17:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On Sun, Jun 14 2020, Eli Zaretskii wrote:
>> Can this be improved _without_ disabling scroll-margin?
>
> Can you propose a more useful behavior in that case?
Another solution would be to move the pointer along with the scrolling
buffer (as done occasionally in cad software when moving the viewport),
so that the pointer doesn't move from the POV of the buffer.
Kind of odd for an editor though.
> If you are saying that Emacs should put point inside the scroll-margin
> and leave it there in this case, then I don't recommend such a
> solution: any subsequent command will scroll the window anyway,
> because Emacs is programmed to keep point outside of the scroll
> margin.
Would that happen for _any_ command or just for commands that already
move the point?
If that happens only with a command that already moves the point up or
down, such as next-line, I'd actually say that's OK and I would find
that expected.
It's definitely an edge scenario, but less unorthodox than moving the
pointer IMHO.
> We need to come up with a more clever approach.
Fully open to any idea here.
This is just the first thing that came to mind.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ergonomics: mouse clicking with scroll-margin
2020-06-14 17:58 ` Yuri D'Elia
@ 2020-06-14 19:02 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2020-06-14 19:02 UTC (permalink / raw)
To: Yuri D'Elia; +Cc: emacs-devel
> From: Yuri D'Elia <wavexx@thregr.org>
> Cc: emacs-devel@gnu.org
> Date: Sun, 14 Jun 2020 19:58:56 +0200
>
> > If you are saying that Emacs should put point inside the scroll-margin
> > and leave it there in this case, then I don't recommend such a
> > solution: any subsequent command will scroll the window anyway,
> > because Emacs is programmed to keep point outside of the scroll
> > margin.
>
> Would that happen for _any_ command or just for commands that already
> move the point?
Any command that causes a non-trivial redisplay. Which in practice
means quite a few (not only those which move point).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ergonomics: mouse clicking with scroll-margin
2020-06-14 17:09 Ergonomics: mouse clicking with scroll-margin Yuri D'Elia
2020-06-14 17:45 ` Eli Zaretskii
@ 2020-06-14 18:47 ` Stefan Monnier
2020-07-01 12:34 ` Yuri D'Elia
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2020-06-14 18:47 UTC (permalink / raw)
To: Yuri D'Elia; +Cc: emacs-devel
> The combined behavior of the mouse and "scroll-margin" is a bit odd
> currently and I wonder if there's something that can be done to
> improve it.
>
> 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.
>
> This in turn often results in the click becoming a "drag" instead,
> selecting parts of the buffer.
I think this is a bug. It's not immediately clear how we could/should
fix it, but I think it deserves a bug number (and ideally a slightly
more precise recipe).
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ergonomics: mouse clicking with scroll-margin
2020-06-14 18:47 ` Stefan Monnier
@ 2020-07-01 12:34 ` Yuri D'Elia
0 siblings, 0 replies; 6+ messages in thread
From: Yuri D'Elia @ 2020-07-01 12:34 UTC (permalink / raw)
To: emacs-devel
On Sun, Jun 14 2020, Stefan Monnier wrote:
>> This in turn often results in the click becoming a "drag" instead,
>> selecting parts of the buffer.
>
> I think this is a bug. It's not immediately clear how we could/should
> fix it, but I think it deserves a bug number (and ideally a slightly
> more precise recipe).
I don't have anything to add at the moment, but I filed it as bug
report: bug#42150
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-07-01 12:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-14 17:09 Ergonomics: mouse clicking with scroll-margin Yuri D'Elia
2020-06-14 17:45 ` Eli Zaretskii
2020-06-14 17:58 ` Yuri D'Elia
2020-06-14 19:02 ` Eli Zaretskii
2020-06-14 18:47 ` Stefan Monnier
2020-07-01 12:34 ` Yuri D'Elia
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.