all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
Subject: describe-bindings-in-map
Date: Thu, 22 Nov 2007 16:20:04 -0800	[thread overview]
Message-ID: <DHEEKFAFJEFOJHLCFPFDCEHNCCAA.drew.adams@oracle.com> (raw)

Any interest in adding something like this to Emacs?
I use it quite often, especially since I often work with
minibuffer keymaps, which are a bit less accessible than most.

(defun describe-bindings-in-map (keymap)
  "Describe bindings in KEYMAP, a variable whose value is a keymap.
Completion is available for the keymap name."
  (interactive
   (list (intern
          (completing-read
           "Keymap: " obarray
           (lambda (m) (and (boundp m) (keymapp (symbol-value m))))
           t nil 'variable-history))))
  (unless (and (symbolp keymap)
               (boundp keymap)
               (keymapp (symbol-value keymap)))
    (error "`%S' is not a keymapp" keymap))
  (let ((name (symbol-name keymap)))
    (help-setup-xref (list #'describe-bindings-in-map keymap)
                     (interactive-p))
    (with-output-to-temp-buffer "*Help*"
      (princ name) (terpri)
      (princ (make-string (length name) ?-)) (terpri) (terpri)
      (princ (substitute-command-keys (concat "\\{" name "}"))))))


[BTW, I would also be interested in a command that pretty-prints a keymap,
showing its tree structure (inheritance etc.) but with character values
replaced by their human-readable strings. I haven't coded that, but if
someone has, please send it along.]

             reply	other threads:[~2007-11-23  0:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23  0:20 Drew Adams [this message]
2007-11-28 12:20 ` describe-bindings-in-map Johan Bockgård
2007-11-28 17:21   ` describe-bindings-in-map Drew Adams

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=DHEEKFAFJEFOJHLCFPFDCEHNCCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@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.