From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Revilak Newsgroups: gmane.emacs.devel Subject: (kbd) for key bindings (was: editor for large xml files?) Date: Wed, 17 Feb 2010 22:29:48 -0500 Message-ID: <20100218032947.GB21339@srevilak.net> References: <87fx50fcc7.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eJnRUKwClWJh1Khz" X-Trace: ger.gmane.org 1266463815 29433 80.91.229.12 (18 Feb 2010 03:30:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Feb 2010 03:30:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 18 04:30:12 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhx5b-0006Ru-6I for ged-emacs-devel@m.gmane.org; Thu, 18 Feb 2010 04:30:07 +0100 Original-Received: from localhost ([127.0.0.1]:58148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhx5V-00069Q-4d for ged-emacs-devel@m.gmane.org; Wed, 17 Feb 2010 22:30:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nhx5Q-00069K-78 for emacs-devel@gnu.org; Wed, 17 Feb 2010 22:29:56 -0500 Original-Received: from [140.186.70.92] (port=39747 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhx5O-00069C-Bj for emacs-devel@gnu.org; Wed, 17 Feb 2010 22:29:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nhx5N-0007t1-In for emacs-devel@gnu.org; Wed, 17 Feb 2010 22:29:54 -0500 Original-Received: from mail1.sea5.speakeasy.net ([69.17.117.3]:47461) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhx5N-0007sr-9W for emacs-devel@gnu.org; Wed, 17 Feb 2010 22:29:53 -0500 Original-Received: (qmail 8087 invoked from network); 18 Feb 2010 03:29:50 -0000 Original-Received: from pool-71-184-159-98.bstnma.fios.verizon.net (HELO srevilak.net) (srevilak@[71.184.159.98]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 18 Feb 2010 03:29:50 -0000 Content-Disposition: inline In-Reply-To: <87fx50fcc7.fsf@thinkpad.tsdh.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121178 Archived-At: --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline >From: Tassilo Horn >IMO, the recommended style for making keybindings should be `kbd', which >is available in Emacs, XEmacs, and SXEmacs. > >So your 2 definitions would become: > > (global-set-key (kbd "") 'My-Command) > (global-set-key (kbd "C-x c") 'My-Other-Command) > >That's quite easy to read and write (you can simply insert the string >describe-key outputs as argument to `kbd'), and it hides how an >implementation represents the key sequences internally. I'd never heard of (kbd) before, but I like that representation a lot. It's the same syntax that describe-key outputs, and it's also the same syntax that people use when writing about emacs key bindings (e.g., the emacs tutorial). If you understand what "C-x C-f" means, then you basically know how to supply arguments to kbd. Steve (who just re-wrote all of his custom key bindings) --eJnRUKwClWJh1Khz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iEYEARECAAYFAkt8tCsACgkQX7YJI4BuyDTjsQCguMkOyg9vM/8m8if/38tUmYnf Qb4AoLDFHp6Ifai6Gr8wNyzljLug/JuM =pkK9 -----END PGP SIGNATURE----- --eJnRUKwClWJh1Khz--