From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefano Lodi Newsgroups: gmane.emacs.bugs Subject: bug#14793: 23.4; Cannot bind a function to a sequence of two mouse keys Date: Thu, 4 Jul 2013 19:14:35 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1132e5f66009f304e0b2b6f3 X-Trace: ger.gmane.org 1372962555 21835 80.91.229.3 (4 Jul 2013 18:29:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jul 2013 18:29:15 +0000 (UTC) To: 14793@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 20:29:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UuoHI-0005h4-La for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 20:29:12 +0200 Original-Received: from localhost ([::1]:48712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuoHI-0002CE-8T for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 14:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuoHC-0002B0-Is for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 14:29:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuoH9-0003XL-4C for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 14:29:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuoH9-0003Wl-0P for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 14:29:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UuoH8-0003BE-Hc for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 14:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefano Lodi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2013 18:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14793 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137296251012174 (code B ref -1); Thu, 04 Jul 2013 18:29:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2013 18:28:30 +0000 Original-Received: from localhost ([127.0.0.1]:57842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UuoGa-0003AH-Pa for submit@debbugs.gnu.org; Thu, 04 Jul 2013 14:28:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34435) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UunBl-0001DH-Ur for submit@debbugs.gnu.org; Thu, 04 Jul 2013 13:19:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UunBc-0003DT-Gz for submit@debbugs.gnu.org; Thu, 04 Jul 2013 13:19:20 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UunBc-0003DF-D9 for submit@debbugs.gnu.org; Thu, 04 Jul 2013 13:19:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UunBV-0006q4-H1 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 13:19:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uun76-0001My-0M for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 13:14:41 -0400 Original-Received: from mail-vb0-x230.google.com ([2607:f8b0:400c:c02::230]:49313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uun75-0001Mp-Py for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 13:14:35 -0400 Original-Received: by mail-vb0-f48.google.com with SMTP id w15so1096530vbf.21 for ; Thu, 04 Jul 2013 10:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=8NUKMTIz5ck0DWmiuujGtN+YVZ1DSXbuemG4Sp5lxDg=; b=TarYtY/2xoe62Nj5yaNA4KWptKHRsYb/6MphFVfKGxTkhgSXSd7PtD84jc/BVv+USR O+ahnTm4/1CdlFAct8W+pZpihYeDBq1epstz3fk60Ah6FtziOoWwuYvTY9Xo+UCCo8du +TfuSZj0csYeRApY9H7YU+Nd6M/Hhfb6veV/POWhY3WOZIWaTOwkym5pROZfdOGASi2j bwgKWBcJiEiKK9LNXNaqGWN0i4sq+9Ot58LjcBDud9Ft9zknTUDEj6OSjPyZGgWvdnpl 9iSTRM81l/Fz+zsITll8iby5q0Wc4RLADSbx4DMRpXYw1VQT+BaGL1GwoDzcAolrGRy+ lD5A== X-Received: by 10.220.163.72 with SMTP id z8mr3772572vcx.89.1372958075389; Thu, 04 Jul 2013 10:14:35 -0700 (PDT) Original-Received: by 10.220.14.2 with HTTP; Thu, 4 Jul 2013 10:14:35 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Thu, 04 Jul 2013 14:28:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75906 Archived-At: --001a1132e5f66009f304e0b2b6f3 Content-Type: text/plain; charset=ISO-8859-1 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your report will be posted to the bug-gnu-emacs@gnu.org mailing list and the gnu.emacs.bug news group, and at http://debbugs.gnu.org. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': The manual states at the end of Section 48.3.10 "Rebinding Mouse Buttons" says "You can put more than one mouse button in a key sequence, but it isn't usual to do so." I failed to bind a simple function to a sequence of two mouse keys. > 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". --001a1132e5f66009f304e0b2b6f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
This bug repo= rt will be sent to the Free Software Foundation,
not to your local site = managers!
Please write in English if possible, because the Emacs maintai= ners
usually do not have translators to read other languages for them.

Yo= ur report will be posted to the bu= g-gnu-emacs@gnu.org mailing list
and the gnu.emacs.bug news group, a= nd at http://debbugs.gnu.org.

Please describe exactly what actions triggered the bug
and the preci= se symptoms of the bug.=A0 If you can, give
a recipe starting from `emac= s -Q':

The manual states at the end of Section 48.3.1= 0 "Rebinding Mouse Buttons" says "You can put more than one = mouse button in a key sequence, but it isn't usual to do so."

I failed to bind a simple function to a = sequence of two mouse keys.

> emacs -Q

inside = the *scratch* buffer, evaluate:

(defun go-backwards ()
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 "Go backward one word."
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (interactive)
=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 (backward-word 1))
(global-unset-key [mouse-3])
(global-set= -key [mouse-3 mouse-2] 'go-backwards)

Now, pressing the ri= ght 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-back= wards)

pressing the right mouse button does indeed move t= he point backward one word; therefore binding a single mouse key works.

Another way to obtain the same result is the following.

Ev= aluate

(defun go-backwards ()
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = "Go backward one word."
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (int= eractive)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (backward-word 1))
(global-unset-key [mouse-3])
(defvar my-map (make-sparse-keymap))
(de= fine-key my-map [mouse-2] 'go-backwards)

Now, C-h v my-map= gives clearly

my-map's value is (keymap
=A0(mouse-2 . go-bac= kwards))

Then evaluating

(define-key global-map [mouse-3] my-ma= p)

gives

(keymap (mouse-2 . go-backwards))
at the bottom of the Emacs screen. However, again the right but= ton gives "Empty menu".





--001a1132e5f66009f304e0b2b6f3--