From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#4478: 23.1; key bindings for mouse wheel - unclear Date: Fri, 18 Sep 2009 00:48:12 -0700 Message-ID: <625E5DF5465B4A1CBF3FBB6015CBB87D@us.oracle.com> Reply-To: Drew Adams , 4478@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253261253 1494 80.91.229.12 (18 Sep 2009 08:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Sep 2009 08:07:33 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 18 10:07:26 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MoYV3-0002PK-Al for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Sep 2009 10:07:25 +0200 Original-Received: from localhost ([127.0.0.1]:45606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoYV2-0002FD-M7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Sep 2009 04:07:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoYUm-0002Bm-JT for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 04:07:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoYUi-0002AG-Il for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 04:07:08 -0400 Original-Received: from [199.232.76.173] (port=33146 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoYUi-0002AC-EY for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 04:07:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:49900) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MoYUh-0001Gc-QL for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 04:07:04 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8I8711n003015; Fri, 18 Sep 2009 01:07:01 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8I7t6hc000525; Fri, 18 Sep 2009 00:55:06 -0700 Resent-Date: Fri, 18 Sep 2009 00:55:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 18 Sep 2009 07:55:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4478 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125326010232175 (code B ref -1); Fri, 18 Sep 2009 07:55:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 18 Sep 2009 07:48:22 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8I7mLtB032172 for ; Fri, 18 Sep 2009 00:48:22 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoYCa-0003DX-P0 for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 03:48:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoYCV-00039m-Co for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 03:48:19 -0400 Original-Received: from [199.232.76.173] (port=56979 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoYCV-00039j-6m for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 03:48:15 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:50941) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MoYCU-0006xb-Mp for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 03:48:14 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MoYCT-0001M3-VI for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 03:48:14 -0400 Original-Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8I7lPxv020644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 18 Sep 2009 07:47:26 GMT Original-Received: from abhmt010.oracle.com (abhmt010.oracle.com [141.146.116.19]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8I7mXHh004663 for ; Fri, 18 Sep 2009 07:48:34 GMT Original-Received: from dradamslap1 (/141.144.80.110) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Sep 2009 00:48:08 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Aco4NF/AtQTgg3q3Qs+b3BAchiZxTg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt010.oracle.com [141.146.116.19] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.4AB33B39.00FD:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 18 Sep 2009 04:07:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31207 Archived-At: 1. Doc bug: The doc is not clear about how to bind the mouse wheel (rotations). 2. Code bug / enhancement request: Have a shorter way to bind wheel actions. -- I've been using bindings such as this: (define-key map [wheel-down] 'aaa) (define-key map [wheel-down] 'bbb) (define-key map [C-wheel-down] 'ccc) (define-key map [C-wheel-down] 'ddd) Reading some mail on (I think) help-gnu-emacs got me a bit confused, however. It gave me the impression that such bindings were only for MS Windows and that on GNU/Linux `mouse-4' and `mouse-5' must be used instead of `wheel-down' and `wheel-up'. (That sounds odd; I'd expect `mouse-4' and `mouse-5' to be a fourth and fifth mouse button, as they are on Windows.) I looked in the Elisp manual, but I didn't find anything specifically recommending how one should bind mouse wheel events. I was assuming that `wheel-down' was platform independent, but now I have a doubt. The Elisp doc (node Misc Events) speaks about events such as (wheel-up POSITION), but it doesn't speak about just what to use when binding such keys. Further, it says that events such as (wheel-up POSITION) are not generated on some systems and that on those systems "`mouse-4' and `mouse-5' are used instead". (Why is that?) It does say this, however: "For portable code, use the variables `mouse-wheel-up-event' and `mouse-wheel-down-event'", and then it goes on to say where those variables are defined (why does it say where they are defined?). So after a bit of fiddling I switched to this: (define-key map (vector mouse-wheel-down-event) 'aaa) (define-key map (vector mouse-wheel-up-event) 'bbb) (define-key map (vector (list 'control mouse-wheel-down-event)) 'ccc) (define-key map (vector (list 'control mouse-wheel-up-event)) 'ddd) I haven't tested on GNU/Linux, but I'm assuming this is what to use for portable code. Is there a shorter or better way to say this and still be portable? 1. If there is not, there should be (a shorter way to do this). 2. Until then, whatever is the current best way should at least be documented clearly as the way to bind mouse wheel events. I would even expect the Emacs manual to tell you how to bind mouse-wheel key sequences... But AFAICT the Emacs manual isn't too helpful for even the basics about key binding. I filed a separate bug (#4472) about that. In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-29 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4)'