From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: List all bindings in a keymap Date: Mon, 24 Sep 2012 16:01:44 +0400 Message-ID: <87txun8w9j.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1348488136 12162 80.91.229.3 (24 Sep 2012 12:02:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2012 12:02:16 +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 14:02:21 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 1TG7Mh-0007nR-5Z for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 14:02:19 +0200 Original-Received: from localhost ([::1]:58134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG7Mc-0006H6-D8 for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2012 08:02:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG7MU-0006Gy-6v for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 08:02:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG7MK-00036P-Ro for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 08:02:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG7MK-00036E-Kk for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 08:01:56 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TG7MM-0007YH-6t for help-gnu-emacs@gnu.org; Mon, 24 Sep 2012 14:01:58 +0200 Original-Received: from 176.214.37.153 ([176.214.37.153]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 14:01:58 +0200 Original-Received: from dgutov by 176.214.37.153 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 14:01:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 176.214.37.153 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (windows-nt) Cancel-Lock: sha1:N4BDFhzQgcyvSeQ9HtSjqvEfSpY= 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:86890 Archived-At: 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