From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Input events and (interactive "e") Date: Sat, 23 Jun 2012 18:04:48 +0300 Message-ID: <83lijeax2n.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1340463900 13617 80.91.229.3 (23 Jun 2012 15:05:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2012 15:05:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 23 17:04:58 2012 Return-path: Envelope-to: ged-emacs-devel@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 1SiRtL-0003mm-CX for ged-emacs-devel@m.gmane.org; Sat, 23 Jun 2012 17:04:51 +0200 Original-Received: from localhost ([::1]:40254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiRtL-0006Gi-8m for ged-emacs-devel@m.gmane.org; Sat, 23 Jun 2012 11:04:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiRtI-0006GT-Le for emacs-devel@gnu.org; Sat, 23 Jun 2012 11:04:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiRtG-0006W9-Tb for emacs-devel@gnu.org; Sat, 23 Jun 2012 11:04:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiRtG-0006VU-L5 for emacs-devel@gnu.org; Sat, 23 Jun 2012 11:04:46 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M6200000SHS6000@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 23 Jun 2012 18:04:44 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M6200NJXSJW2Z70@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 23 Jun 2012 18:04:44 +0300 (IDT) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151112 Archived-At: Am I the only one, or do we indeed fail to document that (interactive "e") is not just for mouse events? The ELisp manual consistently talks about mouse events only, when it discusses how to access non-keyboard input events and how to define functions that are run by these events. By just reading the manual, you might think that only mouse events have meaningful parameters in the event list, and only commands bound to mouse events can access them using the event-* functions But in fact, it looks like _any_ event generated by the command loop can be bound to a command, and that command can access the event parameters by treating its argument as a list, using (interactive "e") to get that argument. For example, on Windows I can do this: (defun my-lang-change (event) "" (interactive "e") (message "%S" event)) (global-set-key [language-change] 'my-lang-change) and the pressing Alt-Shift to switch keyboard layout will show in the echo area the contents of the event list produced for the language-change event. Also, the way to bind such events to commands is not documented at all, AFAICS. Is all of this omitted from the documentation on purpose, or should we add that? And btw, what is the story behind special-event-map, and why should events be put on that map? E.g., is it bad that language-change event is not on that map?