GNU bug report logs - #5557
<left-margin> <double-wheel-down> is undefined

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Wed, 10 Feb 2010 13:22:01 UTC

Severity: minor

Tags: patch

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

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 5557 in the body.
You can then email your comments to 5557 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Wed, 10 Feb 2010 13:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 10 Feb 2010 13:22:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: <left-margin> <double-wheel-down> is undefined
Date: Wed, 10 Feb 2010 14:01:00 +0100
This is rather inconvenient. I would expect the default binding for
double-wheel-down the left and right margin to be the same as in the
text part of the buffer. (Ie I would expect it to be bound to
mwheel-scroll.)

Is there any reason not to bind it in the margins by default?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 15:37:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5557 <at> debbugs.gnu.org
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 17:36:49 +0200
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> This is rather inconvenient. I would expect the default binding for
> double-wheel-down the left and right margin to be the same as in the
> text part of the buffer. (Ie I would expect it to be bound to
> mwheel-scroll.)
>
> Is there any reason not to bind it in the margins by default?

(I'm going through old bug reports that unfortunately didn't get any
response at the time.)

I'm not quite sure what's being referred to here.  Emacs has a fringe
area, and there a "margin" concept in the indentation functions, but is
there also a "margin" concept in windows?

Hm...  I see there's a `window-margins' function.  How does one give
margins to a window, I wonder?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Oct 2019 15:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 16:10:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 19:09:37 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 01 Oct 2019 17:36:49 +0200
> Cc: 5557 <at> debbugs.gnu.org
> 
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
> 
> > This is rather inconvenient. I would expect the default binding for
> > double-wheel-down the left and right margin to be the same as in the
> > text part of the buffer. (Ie I would expect it to be bound to
> > mwheel-scroll.)
> >
> > Is there any reason not to bind it in the margins by default?
> 
> (I'm going through old bug reports that unfortunately didn't get any
> response at the time.)
> 
> I'm not quite sure what's being referred to here.  Emacs has a fringe
> area, and there a "margin" concept in the indentation functions, but is
> there also a "margin" concept in windows?

Yes, see set-window-margins.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 16:20:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 18:19:30 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Yes, see set-window-margins.

Ah, thanks.

After

(set-window-margins (get-buffer-window) 10 10)

and I try to do any mouse stuff there, I get

<left-margin> <down-mouse-1> is undefined
<left-margin> <mouse-1> is undefined

(I don't have a mouse with a scroll wheel.)

So I guess what should be changed is this:

  (when mouse-wheel-mode
    (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event mouse-wheel-right-event mouse-wheel-left-event))
      (dolist (key (mapcar (lambda (amt) `[(,@(if (consp amt) (car amt)) ,event)])
                           mouse-wheel-scroll-amount))
        (global-set-key key 'mwheel-scroll)
        (push key mwheel-installed-bindings)))))

to also work in left-margin/right-margin?  It's a bit difficult for me
to test since I don't have a scroll wheel -- can somebody who has one do
the additional key bindings?  (The code is in mwheel.el.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 16:27:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 19:26:20 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: lennart.borgman <at> gmail.com,  5557 <at> debbugs.gnu.org
> Date: Tue, 01 Oct 2019 18:19:30 +0200
> 
> After
> 
> (set-window-margins (get-buffer-window) 10 10)
> 
> and I try to do any mouse stuff there, I get
> 
> <left-margin> <down-mouse-1> is undefined
> <left-margin> <mouse-1> is undefined
> 
> (I don't have a mouse with a scroll wheel.)
> 
> So I guess what should be changed is this:
> 
>   (when mouse-wheel-mode
>     (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event mouse-wheel-right-event mouse-wheel-left-event))
>       (dolist (key (mapcar (lambda (amt) `[(,@(if (consp amt) (car amt)) ,event)])
>                            mouse-wheel-scroll-amount))
>         (global-set-key key 'mwheel-scroll)
>         (push key mwheel-installed-bindings)))))
> 
> to also work in left-margin/right-margin?  It's a bit difficult for me
> to test since I don't have a scroll wheel -- can somebody who has one do
> the additional key bindings?  (The code is in mwheel.el.)

I actually am not sure a click on the margins should produce the same
effect as on the text area.  The margins are used to display different
text from what's in the text area, so I'm not sure I understand the
rationale.

Does anyone else have an opinion on this?  Should we perhaps ask a
couple of people who maintain packages that display on the margins?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 16:33:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 18:32:24 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I actually am not sure a click on the margins should produce the same
> effect as on the text area.  The margins are used to display different
> text from what's in the text area, so I'm not sure I understand the
> rationale.

Oh, I assumed that this was about scrolling, but that's probably not
what <double-wheel-down> does?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 16:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 19:36:59 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: lennart.borgman <at> gmail.com,  5557 <at> debbugs.gnu.org
> Date: Tue, 01 Oct 2019 18:32:24 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I actually am not sure a click on the margins should produce the same
> > effect as on the text area.  The margins are used to display different
> > text from what's in the text area, so I'm not sure I understand the
> > rationale.
> 
> Oh, I assumed that this was about scrolling, but that's probably not
> what <double-wheel-down> does?

Sorry for confusing wording: it _is_ about scrolling.
double-wheel-down means turning the wheel more than one click down.

What holds me back is that no other area of the display reacts to
mouse-wheel as the text area.  E.g., turning the wheel on the fringes
or on the scroll bar produces the same "undefined" message as for
margins.

I'm guessing that the OP wanted to have the display scrolled no matter
where on display the user turns the mouse wheel, but evidently that's
not how things are defined by default.  If we decide to change that,
it IMO makes little sense to do that only for the margins, but not for
the fringes or the scroll bar.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 17:40:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Lennart Borgman <lennart.borgman <at> gmail.com>
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 1 Oct 2019 19:39:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> What holds me back is that no other area of the display reacts to
> mouse-wheel as the text area.  E.g., turning the wheel on the fringes
> or on the scroll bar produces the same "undefined" message as for
> margins.

FWIW, I personally think it makes sense to add this binding also to
the fringes and the scroll bar.  If the user tries to use the mouse
wheel there, it's it my opinion most likely just a case of missing the
window by a couple of pixels.

> I'm guessing that the OP wanted to have the display scrolled no matter
> where on display the user turns the mouse wheel, but evidently that's
> not how things are defined by default.  If we decide to change that,
> it IMO makes little sense to do that only for the margins, but not for
> the fringes or the scroll bar.

I'm not seeing this when I use the mouse wheel on the scroll bar on
GTK 3.  Instead, the "bar" (inside the scroll bar) that indicates the
current position strangely moves downwards slowly.  I get no error
message, and the window doesn't scroll.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 18:33:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, larsi <at> gnus.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 21:31:58 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 1 Oct 2019 19:39:17 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 5557 <at> debbugs.gnu.org, 
> 	Lennart Borgman <lennart.borgman <at> gmail.com>
> 
> FWIW, I personally think it makes sense to add this binding also to
> the fringes and the scroll bar.  If the user tries to use the mouse
> wheel there, it's it my opinion most likely just a case of missing the
> window by a couple of pixels.

Maybe.  I'd like to hear more opinions, because we didn't have that
since Emacs 21 till now.

> > I'm guessing that the OP wanted to have the display scrolled no matter
> > where on display the user turns the mouse wheel, but evidently that's
> > not how things are defined by default.  If we decide to change that,
> > it IMO makes little sense to do that only for the margins, but not for
> > the fringes or the scroll bar.
> 
> I'm not seeing this when I use the mouse wheel on the scroll bar on
> GTK 3.  Instead, the "bar" (inside the scroll bar) that indicates the
> current position strangely moves downwards slowly.  I get no error
> message, and the window doesn't scroll.

That's because in your build these gestures on the scroll bar are
processed by GTK, not by Emacs.  Try some other toolkit, or maybe
no-toolkit, and you will see what I see.

But you do see what I described on the fringes, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 18:44:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Lennart Borgman <lennart.borgman <at> gmail.com>
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 1 Oct 2019 20:43:36 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> That's because in your build these gestures on the scroll bar are
> processed by GTK, not by Emacs.  Try some other toolkit, or maybe
> no-toolkit, and you will see what I see.

Is that expected behaviour on GTK?  It seems weird to get graphical
feedback when nothing is happening in Emacs.

If I have a long buffer, and I scroll *a lot* to get the bar to move
down.  When I then drag the bar using mouse-1, the buffer jumps to a
location corresponding to the current placement of the bar.  That
doesn't seem right to me?

> But you do see what I described on the fringes, right?

Yes.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Tue, 01 Oct 2019 19:07:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, larsi <at> gnus.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Tue, 01 Oct 2019 22:06:32 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 1 Oct 2019 20:43:36 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 5557 <at> debbugs.gnu.org, 
> 	Lennart Borgman <lennart.borgman <at> gmail.com>
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > That's because in your build these gestures on the scroll bar are
> > processed by GTK, not by Emacs.  Try some other toolkit, or maybe
> > no-toolkit, and you will see what I see.
> 
> Is that expected behaviour on GTK?  It seems weird to get graphical
> feedback when nothing is happening in Emacs.

I don't know.  Maybe Martin does.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Wed, 02 Oct 2019 08:56:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, larsi <at> gnus.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Wed, 2 Oct 2019 10:55:38 +0200
>> Is that expected behaviour on GTK?  It seems weird to get graphical
>> feedback when nothing is happening in Emacs.
>
> I don't know.  Maybe Martin does.

Sorry, no idea.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Thu, 03 Oct 2019 15:37:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Thu, 03 Oct 2019 17:35:54 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I'm guessing that the OP wanted to have the display scrolled no matter
> where on display the user turns the mouse wheel, but evidently that's
> not how things are defined by default.  If we decide to change that,
> it IMO makes little sense to do that only for the margins, but not for
> the fringes or the scroll bar.

That's true.  Hm...  perhaps the user has really big margins?  That
would make the issue more apparent there -- and it's difficult to say
what else the scroll wheel should do there other than work the same as
in the main portion of the buffer.

But I guess we should just wait and see whether the user has any
feedback on the use case here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Thu, 03 Oct 2019 18:12:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Thu, 3 Oct 2019 20:11:08 +0200
> That's true.  Hm...  perhaps the user has really big margins?  That
> would make the issue more apparent there -- and it's difficult to say
> what else the scroll wheel should do there other than work the same as
> in the main portion of the buffer.

Nowadays practically all applications scroll the window vertically
regardless of where the mouse pointer is - even when it's on the
horizontal scroll bar.  The only exception is the title bar where some
window managers optionally "roll" the window in or out.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Thu, 13 Aug 2020 05:35:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 5557 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 lennart.borgman <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Wed, 12 Aug 2020 22:34:10 -0700
[Message part 1 (text/plain, inline)]
tags 5557 + patch
thanks

martin rudalics <rudalics <at> gmx.at> writes:

> Nowadays practically all applications scroll the window vertically
> regardless of where the mouse pointer is - even when it's on the
> horizontal scroll bar.  The only exception is the title bar where some
> window managers optionally "roll" the window in or out.

That strengthens the case for doing the same in Emacs.

I have attached a patch which implements this functionality.
Any comments?

Best regards,
Stefan Kangas
[0001-Bind-mwheel-scroll-also-for-fringe-and-margin.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 13 Aug 2020 05:35:02 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 13 Aug 2020 05:37:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Thu, 13 Aug 2020 08:43:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, martin rudalics <rudalics <at> gmx.at>,
 Eli Zaretskii <eliz <at> gnu.org>, lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Thu, 13 Aug 2020 10:42:12 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> I have attached a patch which implements this functionality.
> Any comments?

I don't use a scroll wheel mouse, but it sounds like a good idea to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Thu, 13 Aug 2020 13:07:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Thu, 13 Aug 2020 16:06:34 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 12 Aug 2020 22:34:10 -0700
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> > Nowadays practically all applications scroll the window vertically
> > regardless of where the mouse pointer is - even when it's on the
> > horizontal scroll bar.  The only exception is the title bar where some
> > window managers optionally "roll" the window in or out.
> 
> That strengthens the case for doing the same in Emacs.
> 
> I have attached a patch which implements this functionality.
> Any comments?

I have some:

> +(defun mouse-wheel--create-scroll-keys-get-key (binding event)
> +  "Given BINDING and EVENT, return symbol for key.
> +Arguments are like in `mouse-wheel--create-scroll-keys'."
> +  (intern (concat (pcase (caar binding)
> +                    ('alt "A-") ('control "C-") ('hyper "H-")
> +                    ('meta "M-") ('shift "S-") ('super "s-"))
> +                  (symbol-name event))))

I don't think I understand why we want to usurp mouse-wheel with every
possible modifier.  I think the request was to honor only unmodified
mouse-wheel scrolls, no?  Let's leave the modifiers to user bindings.

> +(defun mouse-wheel--create-scroll-keys (binding event)
> +  "Return list of key vectors for BINDING and EVENT.
> +BINDING is an element in `mouse-wheel-scroll-amount'.  EVENT is
> +an event used for scrolling, e.g. `mouse-wheel-down-event'."
> +  (let ((prefixes (list 'left-margin 'right-margin
> +                        'left-fringe 'right-fringe))

Martin says (and I concur) that we should also do this on horizontal
scroll bars and on the mode/header-lines.

Finally, this needs a NEWS entry.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Fri, 14 Aug 2020 18:39:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Fri, 14 Aug 2020 11:38:39 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Any comments?
>
> I have some:

Thank you.

>> +(defun mouse-wheel--create-scroll-keys-get-key (binding event)
>> +  "Given BINDING and EVENT, return symbol for key.
>> +Arguments are like in `mouse-wheel--create-scroll-keys'."
>> +  (intern (concat (pcase (caar binding)
>> +                    ('alt "A-") ('control "C-") ('hyper "H-")
>> +                    ('meta "M-") ('shift "S-") ('super "s-"))
>> +                  (symbol-name event))))
>
> I don't think I understand why we want to usurp mouse-wheel with every
> possible modifier.  I think the request was to honor only unmodified
> mouse-wheel scrolls, no?  Let's leave the modifiers to user bindings.

Well, it's not really all modifiers, at least not by default.  This
depends on what is configured in 'mouse-wheel-scroll-amount', so that
the user gets to decide.

My thinking is that it should be exactly the same to use the mouse wheel
(with or without modifiers) in the buffer area as on the fringe,
margins, etc.  I'm thinking that this way we are a bit preemptive, or we
risk getting bug reports saying that "sometimes scrolling doesn't
work".

IOW, I believe that the behaviour I suggest is the least surprising.
I have also checked Firefox and LibreOffice, and they also behave in
this way with regards to the modifiers.

Do you have any reason to believe anyone would specifically not like to
have those bindings there?

I agree with the rest of your comments.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Fri, 14 Aug 2020 19:14:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Fri, 14 Aug 2020 22:13:19 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 14 Aug 2020 11:38:39 -0700
> Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> Do you have any reason to believe anyone would specifically not like to
> have those bindings there?

I just don't want us to usurp key bindings without a good reason.
Let's leave the unbound mouse gestures unbound, and leave it to the
users to decide what effect they have on different parts of the
display.  There's no reason to force them all to do the same on any
part of the display, when we don't even know what commands will be
bound to them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Fri, 14 Aug 2020 21:35:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Fri, 14 Aug 2020 14:34:25 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> I just don't want us to usurp key bindings without a good reason.

I tried arguing that being more like other applications here makes for a
better user experience.  To me that's a good reason.

Plus I really don't know why someone would want to do anything but
scroll using the mouse wheel, or why users (or package authors) can't
rebind this on specific window areas should they want to.

> Let's leave the unbound mouse gestures unbound, and leave it to the
> users to decide what effect they have on different parts of the
> display.  There's no reason to force them all to do the same on any
> part of the display, when we don't even know what commands will be
> bound to them.

OK, I guess we will have to agree to disagree.

One thing I don't understand is how binding to scroll-bar is supposed to
work.  I tried the following, but it didn't work (tested in GTK and
lucid):

    (global-set-key [vertical-scroll-bar mouse-5] 'foo-mouse-message)
    (defun foo-mouse-message (event)
      (interactive "e")
      (message "%s" (format-time-string "%H:%M:%S")))

(Change vertical-scroll-bar to left-fringe to see that it works there.)

Any ideas?

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sat, 15 Aug 2020 17:41:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sat, 15 Aug 2020 20:40:01 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 14 Aug 2020 14:34:25 -0700
> Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> Plus I really don't know why someone would want to do anything but
> scroll using the mouse wheel

??? We do that already: C-wheel-up increases the font size.  It
shouldn't be hard to imagine similar bindings on the fringe, for
example.

> OK, I guess we will have to agree to disagree.

Yes.

> One thing I don't understand is how binding to scroll-bar is supposed to
> work.  I tried the following, but it didn't work (tested in GTK and
> lucid):
> 
>     (global-set-key [vertical-scroll-bar mouse-5] 'foo-mouse-message)
>     (defun foo-mouse-message (event)
>       (interactive "e")
>       (message "%s" (format-time-string "%H:%M:%S")))
> 
> (Change vertical-scroll-bar to left-fringe to see that it works there.)

First, you don't need to do anything for vertical-scroll-bar, as the
mouse wheel is already handled there, at least on my system.

On a horizontal scroll-bar, if I use this:

  (global-set-key [horizontal-scroll-bar wheel-up] 'foo-mouse-message)

I get the expected result on my system.

What do you see Emacs say if you turn the wheel on the horizontal
scroll-bar in "emacs -Q"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sun, 16 Aug 2020 13:42:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sun, 16 Aug 2020 06:41:32 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> First, you don't need to do anything for vertical-scroll-bar, as the
> mouse wheel is already handled there, at least on my system.

Not here, unfortunately.  Tried emacs -Q with both GTK and Lucid: no
message from foo-mouse-message.

On GTK, I see this:

    "[The] 'bar' (inside the scroll bar) that indicates the current
    position strangely moves downwards slowly.  I get no error message,
    and the window doesn't scroll."

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5557#28

On Lucid, nothing at all happens for the mouse wheel.  (Which is
actually better than the odd behaviour I see on GTK.)

> On a horizontal scroll-bar, if I use this:
>
>   (global-set-key [horizontal-scroll-bar wheel-up] 'foo-mouse-message)
>
> I get the expected result on my system.
>
> What do you see Emacs say if you turn the wheel on the horizontal
> scroll-bar in "emacs -Q"?

Same here: no message with the binding.  Instead:

On GTK, the horizontal scroll bar moves, but the window doesn't update.
The behaviour is similar to the vertical case: the 'bar' portion moves,
and when I then drag it with mouse-1, the window jumps to the position.

On Lucid, I see the same as for the vertical scroll bar: nothing happens.

So it's starting to sound like we have at least two separate bugs to
handle.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sun, 16 Aug 2020 14:50:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sun, 16 Aug 2020 17:48:57 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 16 Aug 2020 06:41:32 -0700
> Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> On GTK, the horizontal scroll bar moves, but the window doesn't update.
> The behaviour is similar to the vertical case: the 'bar' portion moves,
> and when I then drag it with mouse-1, the window jumps to the position.
> 
> On Lucid, I see the same as for the vertical scroll bar: nothing happens.

What about a no-toolkit version?

> So it's starting to sound like we have at least two separate bugs to
> handle.

Sounds like that, yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sun, 16 Aug 2020 15:58:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sun, 16 Aug 2020 08:57:50 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> What about a no-toolkit version?

The vertical-scroll-bar works as expected; I see the message in the
minibuffer from 'foo-mouse-message' and for other mouse wheel buttons it
says they are not bound.

M-x horizontal-scroll-bar-mode says:

   "Horizontal scroll bars are not implemented on this system"

>> So it's starting to sound like we have at least two separate bugs to
>> handle.
>
> Sounds like that, yes.

I will open two new bugs to track that (one for each toolkit), and
mention this bug report and the relevant findings.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Mon, 17 Aug 2020 13:31:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Mon, 17 Aug 2020 13:30:37 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I have attached a patch which implements this functionality.
>> Any comments?
>
> I have some:

Please find attached a new patch which should fix the issues you pointed
out.

Best regards,
Stefan Kangas
[0001-Bind-mwheel-scroll-in-more-places.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sat, 22 Aug 2020 07:33:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sat, 22 Aug 2020 10:32:10 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Mon, 17 Aug 2020 13:30:37 +0000
> Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> Please find attached a new patch which should fix the issues you pointed
> out.

Thanks.

> +*** Mouse wheel scrolling less sensitive to positioning.

I'd suggest

 Mouse-wheel scrolling now works on more parts of frame's display.

> +When using 'mwheel-mode' (enabled by default), the mouse wheel will
> +now scroll also when the mouse cursor is on the fringe, margin, header
> +line, and mode line.

The code also arranges for the scroll bars, no?  Also, please use
"fringes" and "margins", in plural.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sat, 22 Aug 2020 11:49:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sat, 22 Aug 2020 07:48:31 -0400
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> +*** Mouse wheel scrolling less sensitive to positioning.
>
> I'd suggest
>
>  Mouse-wheel scrolling now works on more parts of frame's display.
>
>> +When using 'mwheel-mode' (enabled by default), the mouse wheel will
>> +now scroll also when the mouse cursor is on the fringe, margin, header
>> +line, and mode line.
>
> The code also arranges for the scroll bars, no?  Also, please use
> "fringes" and "margins", in plural.

Thanks for the review.  Fixed your comments in the attached patch.

Best regards,
Stefan Kangas
[0001-Bind-mwheel-scroll-on-more-parts-of-frame-s-display.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sat, 22 Aug 2020 12:00:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sat, 22 Aug 2020 14:59:40 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 22 Aug 2020 07:48:31 -0400
> Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 5557 <at> debbugs.gnu.org, 
> 	lennart.borgman <at> gmail.com
> 
> Thanks for the review.  Fixed your comments in the attached patch.

LGTM, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5557; Package emacs. (Sat, 22 Aug 2020 12:12:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5557 <at> debbugs.gnu.org, rudalics <at> gmx.at, larsi <at> gnus.org,
 lennart.borgman <at> gmail.com
Subject: Re: bug#5557: <left-margin> <double-wheel-down> is undefined
Date: Sat, 22 Aug 2020 08:11:04 -0400
close 5557 28.1
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

> LGTM, thanks.

Thanks, pushed to master as commit 61fc4bf286.  Closing.

Best regards,
Stefan Kangas




bug marked as fixed in version 28.1, send any further explanations to 5557 <at> debbugs.gnu.org and Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sat, 22 Aug 2020 12:12: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, 20 Sep 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 212 days ago.

Previous Next


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