From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivanov Dmitry Newsgroups: gmane.emacs.devel Subject: Emacs attach an action to any key pressed Date: Wed, 5 Jun 2013 09:26:02 +0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0149d29001479504de616f20 X-Trace: ger.gmane.org 1370409978 15436 80.91.229.3 (5 Jun 2013 05:26:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2013 05:26:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 05 07:26:19 2013 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 1Uk6Ek-0001Yx-Sp for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 07:26:19 +0200 Original-Received: from localhost ([::1]:56600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk6Ek-0004ut-Fa for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 01:26:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk6Eb-0004tw-KS for emacs-devel@gnu.org; Wed, 05 Jun 2013 01:26:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uk6EV-0005Sb-CJ for emacs-devel@gnu.org; Wed, 05 Jun 2013 01:26:09 -0400 Original-Received: from mail-oa0-x22e.google.com ([2607:f8b0:4003:c02::22e]:40822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk6EV-0005SO-7H for emacs-devel@gnu.org; Wed, 05 Jun 2013 01:26:03 -0400 Original-Received: by mail-oa0-f46.google.com with SMTP id h2so794226oag.19 for ; Tue, 04 Jun 2013 22:26:02 -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=2aGuIlBx25lSisRdLxpj6ymGToBhubn3uNuJxQPIBGA=; b=H1erevt0J3O3a8cSuT43X6yK6hp72trMGJgLqIqmT6m4yMjhKAY5UK6L8cM+RUHj3H ITSzAnrSiLvNrE/ivLD47W76C6poHmwOkC08O5YBOWI+Uwo+x6jc9VGOCgkHZUoSC252 l+7Vr2v8N5/yWfkWoC+IuQDi6xmhiIy58W9syImWhWnRX4mUWpfxgTUdU7YQrVx5GKmj WfYb8mu3yu9y9wnGEhqA7JB6wle9C0iCgsRuR4sTzwU3UlNIMIKusnfgT+8QfeALX7P8 JTb19OqKRcudq4+xL25bosR3bjGW+T6KB2K5UXtFY47o+jFbe7DYdDvxhc32K3HbmZKS 0qsQ== X-Received: by 10.182.108.230 with SMTP id hn6mr13942164obb.25.1370409962389; Tue, 04 Jun 2013 22:26:02 -0700 (PDT) Original-Received: by 10.76.167.38 with HTTP; Tue, 4 Jun 2013 22:26:02 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22e 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:160096 Archived-At: --089e0149d29001479504de616f20 Content-Type: text/plain; charset=ISO-8859-1 Suppose, I have the code: (defun dummy () (interactive) (message "aaa")) (local-set-key (kbd "") 'dummy) When you click key in the current buffer, it will print "aaa". Is it possible to attach this action to any key pressed? I looked into "Format of Keymaps" and "Searching Keymaps" in Emacs info pages, but found no code examples. --089e0149d29001479504de616f20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Suppose, I have the code:

(defun du= mmy ()
=A0=A0=A0=A0=A0 (interactive)
=A0=A0=A0=A0=A0 (message "a= aa"))

(local-set-key (kbd "<left>") 'dummy)=

When you click <left> key in the current buffer, it will prin= t "aaa".

Is it possible to attach this action to any key pressed?

I looke= d into "Format of Keymaps" and "Searching Keymaps" in E= macs info pages, but found no code examples.
--089e0149d29001479504de616f20--