help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elisp question


From: Seweryn Kokot
Subject: Re: elisp question
Date: Mon, 13 Oct 2008 21:09:25 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Niels Giesen <address@hidden> writes:

> 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))
>    ^^^^^^^^^^^^^^
>
> ;)

Thanks for the hint. This is what I wanted.

Now the following function

(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))))
          (insert keyb)
          (insert (format "  %s\n" (key-binding (read-kbd-macro keyb))))
          )))

gives

C-x C-a  nil
C-x C-b  bs-show
C-x C-c  save-buffers-kill-emacs
C-x C-d  ffap-list-directory
C-x C-e  eval-last-sexp
C-x C-f  ffap
C-x C-g  nil
C-x C-h  nil
C-x C-i  dabbrev-expand
C-x C-j  dired-jump
... etc.

-- 
regards,
Seweryn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]