all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: List all bindings in a keymap
@ 2012-09-25  0:09 Dmitry Gutov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Gutov @ 2012-09-25  0:09 UTC (permalink / raw)
  To: pjb; +Cc: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

 > Dmitry Gutov <dgutov@yandex.ru> writes:
 >> How do I do that, short of traversing the keymap structure manually?
 >
 > Check
 > 
https://gitorious.org/com-informatimago/emacs/blobs/blame/256fae6797241e707b3bc79cc7812a82074948a1/pjb-emacs.el#line1750

Thanks, but I got a simpler solution with `map-keymap' working, see:

https://github.com/dgutov/diff-hl/blob/a01d2917a07d91269c13901bb65fd7ef54766fd4/diff-hl.el#L327



^ permalink raw reply	[flat|nested] 7+ messages in thread
* List all bindings in a keymap
@ 2012-09-24 12:01 Dmitry Gutov
  2012-09-24 13:59 ` Doug Lewan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dmitry Gutov @ 2012-09-24 12:01 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-25  0:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25  0:09 List all bindings in a keymap Dmitry Gutov
  -- strict thread matches above, loose matches on Subject: below --
2012-09-24 12:01 Dmitry Gutov
2012-09-24 13:59 ` 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

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.