all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* describe-bindings-in-map
@ 2007-11-23  0:20 Drew Adams
  2007-11-28 12:20 ` describe-bindings-in-map Johan Bockgård
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2007-11-23  0:20 UTC (permalink / raw)
  To: Emacs-Devel

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.]

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

end of thread, other threads:[~2007-11-28 17:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-23  0:20 describe-bindings-in-map Drew Adams
2007-11-28 12:20 ` describe-bindings-in-map Johan Bockgård
2007-11-28 17:21   ` describe-bindings-in-map Drew Adams

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.