From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Niels Giesen Newsgroups: gmane.emacs.help Subject: Re: elisp question Date: Mon, 13 Oct 2008 20:11:24 +0200 Organization: A noiseless patient Spider Message-ID: <87hc7g2wmr.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223923242 21236 80.91.229.12 (13 Oct 2008 18:40:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2008 18:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 13 20:41:41 2008 Return-path: Envelope-to: geh-help-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 1KpSMK-0001O7-H7 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2008 20:41:36 +0200 Original-Received: from localhost ([127.0.0.1]:53567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KpSLF-0005iE-QL for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2008 14:40:29 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: feeder.motzarella.org U2FsdGVkX1962aEnkQnJ6VGone54jTlx+vmtzJAWjKTqriKOrKlUtSp1tklAp44Fy6/logKDovjjQkuF4auS+qZZTe/24meRScYb7a3vTeDQ7oIpzQzaij4nSEA7xt0G3gQgTMkg+gQ= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Mon, 13 Oct 2008 18:11:25 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+Ln5GFZBqme3wCkYaUaLiG Cancel-Lock: sha1:rHVl1cQ6cTcI8KmsNng8GpyggYQ= sha1:UEaudFDB3fHoXLUioprFRj5QxrY= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:163397 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58740 Archived-At: Seweryn Kokot writes: > Hello, > > I would like to get a list of functions for keybindings from C-x C-a to > C-x C-z etc. > > Since (key-binding (kbd "C-x C-f")) gives find-file > > I try to write something like this: > > (defun my-list-keybindings () > (interactive) > (let* (keyb > (char-a 97) > (char-z 122) > (n (- char-z char-a))) > (dotimes (i n) > (setq keyb (concat "C-x C-" (char-to-string (+ char-a i)))) > (key-binding (kbd keyb))))) > > but unfortunately it doesn't work because kbd doesn't accept variable > string. How to modify this function to get it work? Dig harder: (defmacro kbd (keys) "Convert KEYS to the internal Emacs key representation. KEYS should be a string constant in the format used for saving keyboard macros (see `edmacro-mode')." (read-kbd-macro keys)) ^^^^^^^^^^^^^^ ;)