unofficial mirror of bug-gnu-emacs@gnu.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; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ 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
  0 siblings, 0 replies; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2011-09-24 18:38 UTC | newest]

Thread overview: 5+ 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).