all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: List all bindings in a keymap
Date: Mon, 24 Sep 2012 23:13:43 +0200	[thread overview]
Message-ID: <87ehlr6s54.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: 87txun8w9j.fsf@yandex.ru

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 {}.




  parent reply	other threads:[~2012-09-24 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 12:01 List all bindings in a keymap Dmitry Gutov
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 [this message]
  -- 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=87ehlr6s54.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --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.