Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion List all bindings in a keymap

Received: by 10.180.75.197 with SMTP id e5mr677730wiw.1.1348968677231;
        Sat, 29 Sep 2012 18:31:17 -0700 (PDT)
Path: q11ni102681177wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin3!goblin1!goblin2!goblin.stu.neva.ru!novso.com!news.he.net!news.snarked.org!newsfeed.news.ucla.edu!usenet.stanford.edu!not-for-mail
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Newsgroups: gnu.emacs.help
Subject: Re: List all bindings in a keymap
Date: Mon, 24 Sep 2012 23:13:43 +0200
Organization: Informatimago
Lines: 28
Approved: help-gnu-em...@gnu.org
Message-ID: <mailman.9674.1348521241.855.help-gnu-emacs@gnu.org>
References: <87txun8w9j.fsf@yandex.ru>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1348521242 12285 208.118.235.17 (24 Sep 2012 21:14:02 GMT)
X-Complaints-To: action@cs.stanford.edu
To: help-gnu-em...@gnu.org
Envelope-to: help-gnu-em...@gnu.org
X-Injected-Via-Gmane: http://gmane.org/
X-Gmane-NNTP-Posting-Host: 81.202.16.46.dyn.user.ono.com
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA
	oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9
	033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac
	l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR
	mV+hO/VvFAAAAABJRU5ErkJggg==
X-Accept-Language: fr, es, en
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock: sha1:OWViMjZiNWJiNDA5MWY3YzQ1OWJhMjdjMmNlYmU4NGYxNmE5YmI0YQ==
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: help-gnu-em...@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
	<mailto:help-gnu-emacs-requ...@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-em...@gnu.org>
List-Help: <mailto:help-gnu-emacs-requ...@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-requ...@gnu.org?subject=subscribe>
Content-Type: text/plain; charset=us-ascii

Dmitry Gutov <dgu...@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 {}.