all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9541: mouse-1 inside scroll-margin causes undesirable region activation
@ 2011-09-18  9:14 Le Wang
       [not found] ` <handler.9541.B.131633755619433.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Le Wang @ 2011-09-18  9:14 UTC (permalink / raw)
  To: 9541

Repro:

1. emacs -Q
2. eval:

  (setq scroll-margin 5)

3. open some multi-page file
4. left-click in bottom margin (bottom 5 lines)

Notice region is selected and active.

This problem is noted here: http://www.emacswiki.org/emacs/SmoothScrolling

A package attempts to solve it here:
http://adamspiers.org/computing/elisp/smooth-scrolling.el

But the bug is in Emacs.

-- 
Le





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#9541: Acknowledgement (mouse-1 inside scroll-margin causes undesirable region activation)
       [not found] ` <handler.9541.B.131633755619433.ack@debbugs.gnu.org>
@ 2011-09-18 11:31   ` Le Wang
  2011-09-19 18:34     ` bug#9541: mouse-1 inside scroll-margin causes undesirable region activation Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Le Wang @ 2011-09-18 11:31 UTC (permalink / raw)
  To: 9541

Here is my work-around.  I don't fully understand the ramifications of
doing this, but so far it seems work.

(defun le::mouse-drag-region (event)
  "mouse-drag-region but clickable in scroll-margin"
  (interactive "e")
  (let ((scroll-margin 0))
    (mouse-drag-region event)))

(global-set-key [(down-mouse-1)] 'le::mouse-drag-region)

-- 
Le





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#9541: mouse-1 inside scroll-margin causes undesirable region activation
  2011-09-18 11:31   ` bug#9541: Acknowledgement (mouse-1 inside scroll-margin causes undesirable region activation) Le Wang
@ 2011-09-19 18:34     ` Stefan Monnier
  2011-09-23 20:52       ` Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2011-09-19 18:34 UTC (permalink / raw)
  To: Le Wang; +Cc: 9541

> Here is my work-around.  I don't fully understand the ramifications of
> doing this, but so far it seems work.

> (defun le::mouse-drag-region (event)
>   "mouse-drag-region but clickable in scroll-margin"
>   (interactive "e")
>   (let ((scroll-margin 0))
>     (mouse-drag-region event)))

But this goes against the definition of scroll-margin which does not
make any exception for mouse events.

An alternative would be to declare that scroll-margin does not apply to
commands when run via mouse events.

This said, the current behavior of scroll-margin is clearly problematic
and even buggy (e.g. it seems that displaying the EOB prevents the
mouse-clicks from causing a scroll, even when that scroll would be
towards the BOB).


        Stefan





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#9541: mouse-1 inside scroll-margin causes undesirable region activation
  2011-09-19 18:34     ` bug#9541: mouse-1 inside scroll-margin causes undesirable region activation Stefan Monnier
@ 2011-09-23 20:52       ` Johan Bockgård
  2011-09-24 18:38         ` Chong Yidong
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2011-09-23 20:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9541, Le Wang

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> This said, the current behavior of scroll-margin is clearly problematic
> and even buggy (e.g. it seems that displaying the EOB prevents the
> mouse-clicks from causing a scroll, even when that scroll would be
> towards the BOB).

The real bug is that mouse-clicks set the mark (always). (Search for
push-mark in mouse-drag-track.)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#9541: mouse-1 inside scroll-margin causes undesirable region activation
  2011-09-23 20:52       ` Johan Bockgård
@ 2011-09-24 18:38         ` Chong Yidong
  2011-10-02 10:03           ` New mouse click behavior (was: bug#9541: mouse-1 inside scroll-margin causes undesirable region activation) Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Chong Yidong @ 2011-09-24 18:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9541, Le Wang

Johan Bockgård <bojohan@gnu.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> This said, the current behavior of scroll-margin is clearly problematic
>> and even buggy (e.g. it seems that displaying the EOB prevents the
>> mouse-clicks from causing a scroll, even when that scroll would be
>> towards the BOB).
>
> The real bug is that mouse-clicks set the mark (always). (Search for
> push-mark in mouse-drag-track.)

No, that's intended behavior.  The OP's suggestion of disabling the
scroll margin while tracking a mouse drag is on the right track.  I've
committed a change along those lines.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* New mouse click behavior (was: bug#9541: mouse-1 inside scroll-margin causes undesirable region activation)
  2011-09-24 18:38         ` Chong Yidong
@ 2011-10-02 10:03           ` Johan Bockgård
  2011-10-02 12:14             ` New mouse click behavior martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2011-10-02 10:03 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Johan Bockgård <bojohan@gnu.org> writes:
>
>> The real bug is that mouse-clicks set the mark (always). (Search for
>> push-mark in mouse-drag-track.)
>
> No, that's intended behavior.  The OP's suggestion of disabling the
> scroll margin while tracking a mouse drag is on the right track.  I've
> committed a change along those lines.

I still think it's a bug. The new behavior is a pain. A mouse click
should move point; it makes no sense for it to also set the mark.

Also, there's no simple way to go back to the old, sane, behavior.

(It also causes blinking in the tool bar when you click the mouse.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New mouse click behavior
  2011-10-02 10:03           ` New mouse click behavior (was: bug#9541: mouse-1 inside scroll-margin causes undesirable region activation) Johan Bockgård
@ 2011-10-02 12:14             ` martin rudalics
  0 siblings, 0 replies; 7+ messages in thread
From: martin rudalics @ 2011-10-02 12:14 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: Chong Yidong, emacs-devel

 >>> The real bug is that mouse-clicks set the mark (always). (Search for
 >>> push-mark in mouse-drag-track.)
 >> No, that's intended behavior.  The OP's suggestion of disabling the
 >> scroll margin while tracking a mouse drag is on the right track.  I've
 >> committed a change along those lines.
 >
 > I still think it's a bug. The new behavior is a pain. A mouse click
 > should move point; it makes no sense for it to also set the mark.
 >
 > Also, there's no simple way to go back to the old, sane, behavior.
 >
 > (It also causes blinking in the tool bar when you click the mouse.)

So finally I seem to understand what causes

http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00399.html

Couldn't we make this mark setting behavior customizable?

martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-02 12:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-18  9:14 bug#9541: mouse-1 inside scroll-margin causes undesirable region activation Le Wang
     [not found] ` <handler.9541.B.131633755619433.ack@debbugs.gnu.org>
2011-09-18 11:31   ` bug#9541: Acknowledgement (mouse-1 inside scroll-margin causes undesirable region activation) Le Wang
2011-09-19 18:34     ` bug#9541: mouse-1 inside scroll-margin causes undesirable region activation Stefan Monnier
2011-09-23 20:52       ` Johan Bockgård
2011-09-24 18:38         ` Chong Yidong
2011-10-02 10:03           ` New mouse click behavior (was: bug#9541: mouse-1 inside scroll-margin causes undesirable region activation) Johan Bockgård
2011-10-02 12:14             ` New mouse click behavior martin rudalics

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.