all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: help-gnu-emacs@gnu.org
Subject: List all bindings in a keymap
Date: Mon, 24 Sep 2012 16:01:44 +0400	[thread overview]
Message-ID: <87txun8w9j.fsf@yandex.ru> (raw)

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)

--Dmitry




             reply	other threads:[~2012-09-24 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 12:01 Dmitry Gutov [this message]
2012-09-24 12:53 ` how to use gud buffer together with io buffer? horse_rivers
2012-09-24 13:59 ` List all bindings in a keymap Doug Lewan
2012-09-24 14:25   ` Dmitry Gutov
2012-09-24 14:22 ` Drew Adams
2012-09-24 20:05   ` Dmitry Gutov
2012-09-24 21:13 ` Pascal J. Bourguignon
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25  0:09 Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txun8w9j.fsf@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.