From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: greenwaters Newsgroups: gmane.emacs.help Subject: Re: Binding mouse key sequences Date: Thu, 4 Jul 2013 02:50:48 -0700 (PDT) Message-ID: <1372931448427-291164.post@n5.nabble.com> References: <1372805323230-291017.post@n5.nabble.com> <87fvvw1or9.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1372931473 10243 80.91.229.3 (4 Jul 2013 09:51:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jul 2013 09:51:13 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 11:51:14 2013 Return-path: Envelope-to: geh-help-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 1UugC1-0005Ty-JJ for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 11:51:13 +0200 Original-Received: from localhost ([::1]:41362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UugC1-0002Bh-4Y for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 05:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UugBh-00024U-Uu for Help-gnu-emacs@gnu.org; Thu, 04 Jul 2013 05:51:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UugBe-0001Ah-Fj for Help-gnu-emacs@gnu.org; Thu, 04 Jul 2013 05:50:53 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:39698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UugBe-0001AG-AI for Help-gnu-emacs@gnu.org; Thu, 04 Jul 2013 05:50:50 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UugBc-0005RJ-E7 for Help-gnu-emacs@gnu.org; Thu, 04 Jul 2013 02:50:48 -0700 In-Reply-To: <87fvvw1or9.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.139.236.26 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91924 Archived-At: Thank you for answering Michael. I'll try to answer your questions adding some new facts. 1. Yes, it happens with emacs -Q. 2. After calling emacs -Q, C-h k mouse-8 gives (translated from ) at that spot is undefined Similar behaviour for C-h k mouse-9. After binding with (global-set-key [mouse-8 mouse-9] 'write-file) C-h k mouse-8 gives byte-code: Empty menu 3. However, after binding with (global-set-key [mouse-8] 'write-file) C-h k mouse-8 gives the usual info (translated from ) at that spot runs the command write-file, which is an interactive compiled Lisp function. It is bound to , C-x C-w, . etc. and mouse-8 pops up the file selector window. 4. Now, setting (global-set-key [mouse-8 mouse-9] 'write-file) and executing (progn (push 'mouse-9 unread-command-events) (push 'mouse-8 unread-command-events)) does indeed call write-file. 5. I used xev to catch mouse key press events in Xorg: both mouse-8 and mouse-9 are recognized. This does not tell me much, however, because the test used xev's own window. When I tell xev to monitor any other window, e.g., emacs, mouse clicks are not catched by xev. 6. Setting the debug variable to true gives simply Debugger entered--Lisp error: (error "Empty menu") I replicated the tests above using mouse-3 instead of mouse-8 and mouse-2 instead of mouse-9. Therefore I doubt there's any relation with high numbered mouse buttons in Xorg. This is all I was able to find out, with one addition: double-mouse-8 or drag-mouse-8 always pops up a menu with just two entries, "tool bar" and "Menu bar", both giving access to submenus. The former has entries for all the buttons in the emacs tool bar, but all entries seem disabled. The latter equals the Lisp-Interaction menu (I am performing tests inside the scratch buffer). Same using mouse-3 and mouse-2, or using S-mouse-3 and mouse-2; therefore it looks definitely as an effect of using global-set-key, and not some predefined undocumented behavior. Moreover, globally unsetting double-mouse-8 leaves that menu still functional. BTW I am using GNU Emacs 23.4.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10) GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) on Debian Wheezy. Any further hint is welcomed. -- View this message in context: http://emacs.1067599.n5.nabble.com/Binding-mouse-key-sequences-tp291017p291164.html Sent from the Emacs - Help mailing list archive at Nabble.com.