GNU bug report logs - #28732
flymake mouse-wheel portability fix

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Sat, 7 Oct 2017 15:33:01 UTC

Severity: minor

Tags: patch

Done: charles <at> aurox.ch (Charles A. Roelli)

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 28732 in the body.
You can then email your comments to 28732 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#28732; Package emacs. (Sat, 07 Oct 2017 15:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to charles <at> aurox.ch (Charles A. Roelli):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Oct 2017 15:33:03 GMT) Full text and rfc822 format available.

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

From: charles <at> aurox.ch (Charles A. Roelli)
To: bug-gnu-emacs <at> gnu.org
Subject: flymake mouse-wheel portability fix
Date: Sat, 07 Oct 2017 17:31:36 +0200
The flymake mode line mouse-wheel scroll thing needs the following fix
to be more portable.

This change also removes an extra newline at the end of the tooltip,
which doesn't have to be there as far as I can see.

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 45f0adf..007de8f 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -951,11 +951,13 @@ flymake--mode-line-format
                      keymap
                      ,(let ((map (make-sparse-keymap))
                             (type type))
-                        (define-key map [mode-line mouse-4]
+                        (define-key map (vector 'mode-line
+                                                mouse-wheel-down-event)
                           (lambda (_event)
                             (interactive "e")
                             (flymake-goto-prev-error 1 (list type) t)))
-                        (define-key map [mode-line mouse-5]
+                        (define-key map (vector 'mode-line
+                                                mouse-wheel-up-event)
                           (lambda (_event)
                             (interactive "e")
                             (flymake-goto-next-error 1 (list type) t)))
@@ -967,7 +969,9 @@ flymake--mode-line-format
                                                   'face face)
                                       (propertize (format "%s" type)
                                                   'face face))
-                              "mouse-4/mouse-5: previous/next of this type\n"))
+                              (format "%s/%s: previous/next of this type"
+                                      mouse-wheel-down-event
+                                      mouse-wheel-up-event)))
            into forms
            finally return
            `((:propertize "[")




Reply sent to charles <at> aurox.ch (Charles A. Roelli):
You have taken responsibility. (Sat, 21 Oct 2017 13:07:01 GMT) Full text and rfc822 format available.

Notification sent to charles <at> aurox.ch (Charles A. Roelli):
bug acknowledged by developer. (Sat, 21 Oct 2017 13:07:01 GMT) Full text and rfc822 format available.

Message #10 received at 28732-done <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: 28732-done <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Sat, 21 Oct 2017 15:06:28 +0200
> Date: Sat, 07 Oct 2017 17:31:36 +0200
> From: charles <at> aurox.ch (Charles A. Roelli)
> 
> The flymake mode line mouse-wheel scroll thing needs the following fix
> to be more portable.
> 
> This change also removes an extra newline at the end of the tooltip,
> which doesn't have to be there as far as I can see.
> 
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 45f0adf..007de8f 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -951,11 +951,13 @@ flymake--mode-line-format
>                       keymap
>                       ,(let ((map (make-sparse-keymap))
>                              (type type))
> -                        (define-key map [mode-line mouse-4]
> +                        (define-key map (vector 'mode-line
> +                                                mouse-wheel-down-event)
>                            (lambda (_event)
>                              (interactive "e")
>                              (flymake-goto-prev-error 1 (list type) t)))
> -                        (define-key map [mode-line mouse-5]
> +                        (define-key map (vector 'mode-line
> +                                                mouse-wheel-up-event)
>                            (lambda (_event)
>                              (interactive "e")
>                              (flymake-goto-next-error 1 (list type) t)))
> @@ -967,7 +969,9 @@ flymake--mode-line-format
>                                                    'face face)
>                                        (propertize (format "%s" type)
>                                                    'face face))
> -                              "mouse-4/mouse-5: previous/next of this type\n"))
> +                              (format "%s/%s: previous/next of this type"
> +                                      mouse-wheel-down-event
> +                                      mouse-wheel-up-event)))
>             into forms
>             finally return
>             `((:propertize "[")

It's pushed, closing.

  commit 75bb4827637111a210c79583f45dd1c5d59a745f
  Date:   Sat Oct 21 14:56:59 2017 +0200

  Make flymake's mouse-wheel interaction portable (Bug#28732)

  * lisp/progmodes/flymake.el (flymake--mode-line-format): Bind
  'mouse-wheel-down-event' and 'mouse-wheel-up-event' instead of
  'mouse-4' and 'mouse-5'.  Update the tooltip text accordingly, and
  remove a stray newline in it.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Nov 2017 12:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 26 Feb 2018 21:40:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Mon, 26 Feb 2018 21:45:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Mon, 26 Feb 2018 16:38:50 -0500
Hi,

This change causes errors in without-x builds.
At compile-time:
    
    In flymake--mode-line-format:
    progmodes/flymake.el:1086:49:Warning: reference to free variable
        `mouse-wheel-down-event'
    progmodes/flymake.el:1092:49:Warning: reference to free variable
        `mouse-wheel-up-event'

At run-time:
   Error during redisplay: (eval (flymake--mode-line-format)) signaled
   (void-variable mouse-wheel-down-event)


Charles A. Roelli wrote:

> The flymake mode line mouse-wheel scroll thing needs the following fix
> to be more portable.
>
> This change also removes an extra newline at the end of the tooltip,
> which doesn't have to be there as far as I can see.
>
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 45f0adf..007de8f 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -951,11 +951,13 @@ flymake--mode-line-format
>                       keymap
>                       ,(let ((map (make-sparse-keymap))
>                              (type type))
> -                        (define-key map [mode-line mouse-4]
> +                        (define-key map (vector 'mode-line
> +                                                mouse-wheel-down-event)
>                            (lambda (_event)
>                              (interactive "e")
>                              (flymake-goto-prev-error 1 (list type) t)))
> -                        (define-key map [mode-line mouse-5]
> +                        (define-key map (vector 'mode-line
> +                                                mouse-wheel-up-event)
>                            (lambda (_event)
>                              (interactive "e")
>                              (flymake-goto-next-error 1 (list type) t)))
> @@ -967,7 +969,9 @@ flymake--mode-line-format
>                                                    'face face)
>                                        (propertize (format "%s" type)
>                                                    'face face))
> -                              "mouse-4/mouse-5: previous/next of this type\n"))
> +                              (format "%s/%s: previous/next of this type"
> +                                      mouse-wheel-down-event
> +                                      mouse-wheel-up-event)))
>             into forms
>             finally return
>             `((:propertize "[")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Tue, 27 Feb 2018 19:19:01 GMT) Full text and rfc822 format available.

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

From: charles <at> aurox.ch (Charles A. Roelli)
To: Glenn Morris <rgm <at> gnu.org>
Cc: 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Tue, 27 Feb 2018 20:28:42 +0100
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: 28732 <at> debbugs.gnu.org
> Date: Mon, 26 Feb 2018 16:38:50 -0500
> 
> Hi,
> 
> This change causes errors in without-x builds.
> At compile-time:
>     
>     In flymake--mode-line-format:
>     progmodes/flymake.el:1086:49:Warning: reference to free variable
>         `mouse-wheel-down-event'
>     progmodes/flymake.el:1092:49:Warning: reference to free variable
>         `mouse-wheel-up-event'
> 
> At run-time:
>    Error during redisplay: (eval (flymake--mode-line-format)) signaled
>    (void-variable mouse-wheel-down-event)
> 
> 
> Charles A. Roelli wrote:
> 
> > The flymake mode line mouse-wheel scroll thing needs the following fix
> > to be more portable.
> >
> > This change also removes an extra newline at the end of the tooltip,
> > which doesn't have to be there as far as I can see.
> >
> > diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> > index 45f0adf..007de8f 100644
> > --- a/lisp/progmodes/flymake.el
> > +++ b/lisp/progmodes/flymake.el
> > @@ -951,11 +951,13 @@ flymake--mode-line-format
> >                       keymap
> >                       ,(let ((map (make-sparse-keymap))
> >                              (type type))
> > -                        (define-key map [mode-line mouse-4]
> > +                        (define-key map (vector 'mode-line
> > +                                                mouse-wheel-down-event)
> >                            (lambda (_event)
> >                              (interactive "e")
> >                              (flymake-goto-prev-error 1 (list type) t)))
> > -                        (define-key map [mode-line mouse-5]
> > +                        (define-key map (vector 'mode-line
> > +                                                mouse-wheel-up-event)
> >                            (lambda (_event)
> >                              (interactive "e")
> >                              (flymake-goto-next-error 1 (list type) t)))
> > @@ -967,7 +969,9 @@ flymake--mode-line-format
> >                                                    'face face)
> >                                        (propertize (format "%s" type)
> >                                                    'face face))
> > -                              "mouse-4/mouse-5: previous/next of this type\n"))
> > +                              (format "%s/%s: previous/next of this type"
> > +                                      mouse-wheel-down-event
> > +                                      mouse-wheel-up-event)))
> >             into forms
> >             finally return
> >             `((:propertize "[")
> 

Thanks.  Is the following change (ignoring whitespace differences)
good for emacs-26?

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 58bad8f..d58c5943 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1078,7 +1078,9 @@
                      face ,face
                      mouse-face mode-line-highlight
                      keymap
-                     ,(let ((map (make-sparse-keymap))
+                     ,(when (and (boundp 'mouse-wheel-down-event)
+                                 (boundp 'mouse-wheel-up-event))
+                        (let ((map (make-sparse-keymap))
                             (type type))
                         (define-key map (vector 'mode-line
                                                 mouse-wheel-down-event)
@@ -1092,9 +1094,11 @@
                             (interactive "e")
                             (with-selected-window (posn-window (event-start event))
                               (flymake-goto-next-error 1 (list type) t))))
-                        map)
+                          map))
                      help-echo
-                     ,(concat (format "%s diagnostics of type %s\n"
+                     ,(when (and (boundp 'mouse-wheel-down-event)
+                                 (boundp 'mouse-wheel-up-event))
+                        (concat (format "%s diagnostics of type %s\n"
                                       (propertize (format "%d"
                                                           (length diags))
                                                   'face face)
@@ -1102,7 +1106,7 @@
                                                   'face face))
                               (format "%s/%s: previous/next of this type"
                                       mouse-wheel-down-event
-                                      mouse-wheel-up-event)))
+                                        mouse-wheel-up-event))))
            into forms
            finally return
            `((:propertize "[")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Tue, 27 Feb 2018 19:32:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: rgm <at> gnu.org, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Tue, 27 Feb 2018 21:31:33 +0200
> Date: Tue, 27 Feb 2018 20:28:42 +0100
> From: charles <at> aurox.ch (Charles A. Roelli)
> Cc: 28732 <at> debbugs.gnu.org
> 
> Thanks.  Is the following change (ignoring whitespace differences)
> good for emacs-26?
> 
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 58bad8f..d58c5943 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -1078,7 +1078,9 @@
>                       face ,face
>                       mouse-face mode-line-highlight
>                       keymap
> -                     ,(let ((map (make-sparse-keymap))
> +                     ,(when (and (boundp 'mouse-wheel-down-event)
> +                                 (boundp 'mouse-wheel-up-event))
> +                        (let ((map (make-sparse-keymap))

Is there any reason you cannot simply require mwheel in flymake?  Or
does loading mwheel in a --without-x build fail?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Wed, 28 Feb 2018 18:53:02 GMT) Full text and rfc822 format available.

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

From: charles <at> aurox.ch (Charles A. Roelli)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Wed, 28 Feb 2018 20:02:22 +0100
> Date: Tue, 27 Feb 2018 21:31:33 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Tue, 27 Feb 2018 20:28:42 +0100
> > From: charles <at> aurox.ch (Charles A. Roelli)
> > Cc: 28732 <at> debbugs.gnu.org
> > 
> > Thanks.  Is the following change (ignoring whitespace differences)
> > good for emacs-26?
> > 
> > diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> > index 58bad8f..d58c5943 100644
> > --- a/lisp/progmodes/flymake.el
> > +++ b/lisp/progmodes/flymake.el
> > @@ -1078,7 +1078,9 @@
> >                       face ,face
> >                       mouse-face mode-line-highlight
> >                       keymap
> > -                     ,(let ((map (make-sparse-keymap))
> > +                     ,(when (and (boundp 'mouse-wheel-down-event)
> > +                                 (boundp 'mouse-wheel-up-event))
> > +                        (let ((map (make-sparse-keymap))
> 
> Is there any reason you cannot simply require mwheel in flymake?  Or
> does loading mwheel in a --without-x build fail?

Good point.  Can someone with a "--without-x" build handy check that?
"mwheel.elc" is in src/lisp.mk, so it confuses me that it would not be
immediately available.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Wed, 28 Feb 2018 20:33:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: rgm <at> gnu.org, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Wed, 28 Feb 2018 22:32:48 +0200
> Date: Wed, 28 Feb 2018 20:02:22 +0100
> From: charles <at> aurox.ch (Charles A. Roelli)
> CC: rgm <at> gnu.org, 28732 <at> debbugs.gnu.org
> 
> "mwheel.elc" is in src/lisp.mk, so it confuses me that it would not be
> immediately available.

You will see in loadup.el that it is not preloaded in --without-x
builds.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Thu, 01 Mar 2018 19:33:01 GMT) Full text and rfc822 format available.

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

From: charles <at> aurox.ch (Charles A. Roelli)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Thu, 01 Mar 2018 20:43:20 +0100
> > "mwheel.elc" is in src/lisp.mk, so it confuses me that it would not be
> > immediately available.
> 
> You will see in loadup.el that it is not preloaded in --without-x
> builds.

Thanks.  As you suggested, explicitly requiring `mwheel' is probably
the best solution then.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Fri, 02 Mar 2018 02:11:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: rgm <at> gnu.org, Eli Zaretskii <eliz <at> gnu.org>, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Thu, 01 Mar 2018 21:10:50 -0500
charles <at> aurox.ch (Charles A. Roelli) writes:

>> Is there any reason you cannot simply require mwheel in flymake?  Or
>> does loading mwheel in a --without-x build fail?
>
> Good point.  Can someone with a "--without-x" build handy check that?
> "mwheel.elc" is in src/lisp.mk, so it confuses me that it would not be
> immediately available.

mwheel loads without errors for me in a --without-x build.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28732; Package emacs. (Sat, 03 Mar 2018 10:44:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: rgm <at> gnu.org, charles <at> aurox.ch, 28732 <at> debbugs.gnu.org
Subject: Re: bug#28732: flymake mouse-wheel portability fix
Date: Sat, 03 Mar 2018 12:43:02 +0200
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  rgm <at> gnu.org,  28732 <at> debbugs.gnu.org
> Date: Thu, 01 Mar 2018 21:10:50 -0500
> 
> charles <at> aurox.ch (Charles A. Roelli) writes:
> 
> >> Is there any reason you cannot simply require mwheel in flymake?  Or
> >> does loading mwheel in a --without-x build fail?
> >
> > Good point.  Can someone with a "--without-x" build handy check that?
> > "mwheel.elc" is in src/lisp.mk, so it confuses me that it would not be
> > immediately available.
> 
> mwheel loads without errors for me in a --without-x build.

Thanks, I pushed the required change.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 31 Mar 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 83 days ago.

Previous Next


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