GNU bug report logs - #14793
23.4; Cannot bind a function to a sequence of two mouse keys

Previous Next

Package: emacs;

Reported by: Stefano Lodi <regularclockwork <at> gmail.com>

Date: Thu, 4 Jul 2013 18:29:02 UTC

Severity: normal

Tags: confirmed

Found in versions 25.1, 23.4

Full log


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

From: npostavs <at> users.sourceforge.net
To: control <at> debbugs.gnu.org
Subject: Re: bug#14793: 23.4;
 Cannot bind a function to a sequence of two mouse keys
Date: Fri, 05 Aug 2016 19:35:38 -0400
tags 14793 confirmed
found 14793 25.1
quit

Stefano Lodi <regularclockwork <at> gmail.com> writes:

>> emacs -Q
>
> inside the *scratch* buffer, evaluate:
>
> (defun go-backwards ()
>             "Go backward one word."
>             (interactive)
>             (backward-word 1))
> (global-unset-key [mouse-3])
> (global-set-key [mouse-3 mouse-2] 'go-backwards)
>
> Now, pressing the right mouse button gives the message
>
> Empty menu
>
> at the bottom of the Emacs screen.
>
> If I evaluate
>
> (setq debug-on-error t)
>
> and press the right button again I get just
>
> Debugger entered--Lisp error: (error "Empty menu")
>
> However, after evaluating
>
> (global-set-key [mouse-3] 'go-backwards)
>
> pressing the right mouse button does indeed move the point backward one
> word; therefore binding a single mouse key works.
>
> Another way to obtain the same result is the following.
>
> Evaluate
>
> (defun go-backwards ()
>             "Go backward one word."
>             (interactive)
>             (backward-word 1))
> (global-unset-key [mouse-3])
> (defvar my-map (make-sparse-keymap))
> (define-key my-map [mouse-2] 'go-backwards)
>
> Now, C-h v my-map gives clearly
>
> my-map's value is (keymap
>  (mouse-2 . go-backwards))
>
> Then evaluating
>
> (define-key global-map [mouse-3] my-map)
>
> gives
>
> (keymap (mouse-2 . go-backwards))
>
> at the bottom of the Emacs screen. However, again the right button gives
> "Empty menu".




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

Previous Next


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