GNU bug report logs - #30955
27.0.50; Mouse clicks on header-line in Info are broken

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Mon, 26 Mar 2018 14:55:01 UTC

Severity: normal

Found in version 27.0.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 30955 <at> debbugs.gnu.org
Cc: Colin Baxter <m43cap <at> yandex.com>, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#30955: 27.0.50; Mouse clicks on header-line in Info are broken
Date: Tue, 27 Mar 2018 14:46:01 -0400
> To reproduce:
>
>   emacs -Q
>   C-u C-h i /path/to/info/elisp.info RET
>   2
>   3
>   4
>   Click mouse-1 on the "Up: Programming Types" link on the header-line

Hmm... I reduced it to

    src/emacs -Q --eval '(info "(elisp)Numbers")'
    Click mouse-1 on the "Up" link on the header-line
    
and I fixed the "obvious" problem (see patch below), but now that just
gives me:

   <header-line> <mouse-2> is undefined

instead of

   <header-line> <header-line> <mouse-2> is undefined

So now the event-rewrite gives the expected result (i.e. "<header-line>
<mouse-2>"), but for some reason it decides it's unbound even tho it
clearly is.  IOW it seems to be looking in the wrong keymap(s).


        Stefan "not looking forward to debug sessions in read_key_sequence"


diff --git a/lisp/mouse.el b/lisp/mouse.el
index 6a98ee7353..fe8b76e953 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -135,7 +137,12 @@ mouse--click-1-maybe-follows-link
                (unless (get newup 'event-kind)
                  (put newup 'event-kind
                       (get (car last-input-event) 'event-kind)))
-               (vector (cons newup (cdr last-input-event)))))))))
+               ;; Modify the event in-place, otherwise we can get a prefix
+               ;; added again, so a click on the header-line turns
+               ;; into a [header-line header-line mouse-2] :-(.
+               ;; See fake_prefixed_keys in src/keyboard.c's.
+               (setf (car last-input-event) newup)
+               (vector last-input-event)))))))
 
 (define-key key-translation-map [down-mouse-1]
   #'mouse--down-1-maybe-follows-link)




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

Previous Next


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