From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Binding mouse key sequences Date: Wed, 03 Jul 2013 02:16:42 +0200 Message-ID: <87fvvw1or9.fsf@web.de> References: <1372805323230-291017.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372810629 1744 80.91.229.3 (3 Jul 2013 00:17:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2013 00:17:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 03 02:17:10 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 1UuAkw-0007zV-4B for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Jul 2013 02:17:10 +0200 Original-Received: from localhost ([::1]:49272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuAkv-0004aL-Kx for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jul 2013 20:17:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuAkl-0004aC-Pt for help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 20:17:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuAkj-0007t1-QO for help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 20:16:59 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuAkj-0007pm-K7 for help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 20:16:57 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UuAkh-0007nY-K8 for help-gnu-emacs@gnu.org; Wed, 03 Jul 2013 02:16:55 +0200 Original-Received: from ip-2-201-243-232.web.vodafone.de ([2.201.243.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jul 2013 02:16:55 +0200 Original-Received: from michael_heerdegen by ip-2-201-243-232.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jul 2013 02:16:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-2-201-243-232.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:rhwuOrCHvWCfyZStnD+3vN1d69c= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:91910 Archived-At: greenwaters writes: > I tried unsuccesfully to bind a sequence of two mouse keys. For example > > (global-set-key [mouse-8 mouse-9] 'write-file) > > after unsetting mouse-8 globally. Pressing mouse-8 gives a message "Empty > menu" at the bottom of the screen. Does this happen with emacs -Q (i.e., without loading your init file)? What does C-h k mouse-8 tell you? Does it even work when you do (global-set-key [mouse-8] 'write-file) ? > Section > > 48.3.10 Rebinding Mouse Buttons > > in the manual mentions, at the end, the possibility of binding mouse > sequences. > > What is the right way to do this? IMHO this is the right way. If I eval (global-set-key [mouse-8 mouse-9] 'write-file) and then (progn (push 'mouse-9 unread-command-events) (push 'mouse-8 unread-command-events)) I get `write-file' called (sorry, I don't have a mouse with mouse-8 to test, that's why I pushed events to `unread-command-events'). Are you sure Emacs is really receiving a mouse-8 event? Also (setq debug-on-error t) should help you to see what's going on, because you seem to get an error. Regards, Michael.