From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: List all bindings in a keymap Date: Mon, 24 Sep 2012 23:13:43 +0200 Organization: Informatimago Message-ID: <87ehlr6s54.fsf@kuiper.lan.informatimago.com> References: <87txun8w9j.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1348521244 22514 80.91.229.3 (24 Sep 2012 21:14:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2012 21:14:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 23:14:10 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TGFyj-0008NX-BM for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 23:14:09 +0200 Original-Received: from localhost ([::1]:44991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGFye-0004L2-DN for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 17:14:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGFyY-0004JW-Vc for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 17:13:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGFyX-00063X-NI for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 17:13:58 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGFyX-00063R-GT for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 17:13:57 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TGFyZ-0008Jl-Tz for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 23:13:59 +0200 Original-Received: from 81.202.16.46.dyn.user.ono.com ([81.202.16.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 23:13:59 +0200 Original-Received: from pjb by 81.202.16.46.dyn.user.ono.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 23:13:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.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-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86902 Archived-At: Dmitry Gutov 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 {}.