emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: completion-list-mode keymap in docstring


From: Drew Adams
Subject: RE: completion-list-mode keymap in docstring
Date: Tue, 22 Jan 2008 15:31:31 -0800

> I'd be nice to have completion-list-mode-map shown in the
> completion-list-mode docstring.  Despite using completion all the time I
> only lately wanted to go beyond just pressing Ret, and hoped C-h m would
> tell me all the keys (Ret is described in words), or at least such as
> they are.

FWIW (not an argument against) -

You can go to buffer *Completions* and hit `C-h b'.

Or you can use this (which I proposed that we add to Emacs):

(defun describe-keymap (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-name-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-keymap keymap)
                     (interactive-p))
    (with-output-to-temp-buffer "*Help*"
      (princ name) (terpri)
      (princ (make-string (length name) ?-)) (terpri) (terpri)
      (princ (documentation-property keymap 'variable-documentation))
(terpri) (terpri)
      (princ (substitute-command-keys (concat "\\{" name "}"))))))

I bind that to `C-h M-k'. Then `C-h M-k co TAB RET' gives you a
user-friendly listing of `completion-list-mode-map'.

http://www.emacswiki.org/cgi-bin/wiki/HelpPlus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]