[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: List all bindings in a keymap
From: |
Pascal J. Bourguignon |
Subject: |
Re: List all bindings in a keymap |
Date: |
Mon, 24 Sep 2012 23:13:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Dmitry Gutov <dgutov@yandex.ru> writes:
> Hi all,
>
> How do I do that, short of traversing the keymap structure manually?
>
> The doc recommends to use `map-keymap', but it doesn't exactly do what I
> want, and if I try to use it recursively, it reliably blows up with
> "max-lisp-eval-depth exceeded". Example snippet:
>
> (defun scan-keymap (map)
> (map-keymap (lambda (event binding)
> (if (consp binding)
> (progn (message "cdadr %s" (cdadr binding))
> (scan-keymap (cdadr binding)))
> (message "%s" binding))) diff-hl-mode-map))
>
> (require 'js)
> (scan-keymap js-mode-map)
Check
https://gitorious.org/com-informatimago/emacs/blobs/blame/256fae6797241e707b3bc79cc7812a82074948a1/pjb-emacs.el#line1750
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.