GNU bug report logs - #9541
mouse-1 inside scroll-margin causes undesirable region activation

Previous Next

Package: emacs;

Reported by: Le Wang <l26wang <at> gmail.com>

Date: Sun, 18 Sep 2011 09:20:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9541 in the body.
You can then email your comments to 9541 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9541; Package emacs. (Sun, 18 Sep 2011 09:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Le Wang <l26wang <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 18 Sep 2011 09:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Le Wang <l26wang <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: mouse-1 inside scroll-margin causes undesirable region activation
Date: Sun, 18 Sep 2011 17:14:14 +0800
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9541; Package emacs. (Sun, 18 Sep 2011 11:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 9541 <at> debbugs.gnu.org (full text, mbox):

From: Le Wang <l26wang <at> gmail.com>
To: 9541 <at> debbugs.gnu.org
Subject: Re: bug#9541: Acknowledgement (mouse-1 inside scroll-margin causes
	undesirable region activation)
Date: Sun, 18 Sep 2011 19:31:27 +0800
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9541; Package emacs. (Mon, 19 Sep 2011 18:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 9541 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Le Wang <l26wang <at> gmail.com>
Cc: 9541 <at> debbugs.gnu.org
Subject: Re: mouse-1 inside scroll-margin causes undesirable region activation
Date: Mon, 19 Sep 2011 14:34:36 -0400
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9541; Package emacs. (Fri, 23 Sep 2011 20:54:02 GMT) Full text and rfc822 format available.

Message #14 received at 9541 <at> debbugs.gnu.org (full text, mbox):

From: Johan Bockgård <bojohan <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9541 <at> debbugs.gnu.org, Le Wang <l26wang <at> gmail.com>
Subject: Re: bug#9541: mouse-1 inside scroll-margin causes undesirable region
	activation
Date: Fri, 23 Sep 2011 22:52:45 +0200
Stefan Monnier <monnier <at> 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.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9541; Package emacs. (Sat, 24 Sep 2011 18:39:02 GMT) Full text and rfc822 format available.

Message #17 received at 9541 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9541 <at> debbugs.gnu.org, Le Wang <l26wang <at> gmail.com>
Subject: Re: bug#9541: mouse-1 inside scroll-margin causes undesirable region
	activation
Date: Sat, 24 Sep 2011 14:38:20 -0400
Johan Bockgård <bojohan <at> gnu.org> writes:

> Stefan Monnier <monnier <at> 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.




bug closed, send any further explanations to 9541 <at> debbugs.gnu.org and Le Wang <l26wang <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 24 Sep 2011 18:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Oct 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.