emacs-devel
[Top][All Lists]
Advanced

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

RE: [PATCH] Unify fn and var help to make learning elisp a littleeasier


From: Drew Adams
Subject: RE: [PATCH] Unify fn and var help to make learning elisp a littleeasier
Date: Fri, 7 Dec 2012 11:32:02 -0800

> I'm not completely sure we want to use "C-h o" for its
>  binding, tho I don't see any obvious reasons not to.

FWIW, I bind `C-h o' to `describe-option' (in help-fns+.el):

(defun describe-option (variable &optional buffer)
  "Describe an Emacs user variable (option).
Same as using a prefix arg with `describe-variable'."
  (interactive
   (let ((symb  (or (and (fboundp 'symbol-nearest-point)
                         (symbol-nearest-point))
                    (and (symbolp (variable-at-point))
                         (variable-at-point))))
         (enable-recursive-minibuffers  t))
     (list (intern
            (completing-read
             "Describe user option: "
             obarray 'user-variable-p t nil nil
             (and symb  (symbol-name symb)) t)))))
  (describe-variable variable buffer t))

FWIW2, I also have a command `describe-option-of-type', which I bind
to `C-h C-o':

,----
| describe-option-of-type is an interactive compiled Lisp function in
| `help-fns+.el'.
| 
| It is bound to help C-o, menu-bar help-menu describe
| describe-option-of-type.
| 
| (describe-option-of-type TYPE OPTION)
| 
| Describe an Emacs user OPTION (variable) of a given `defcustom' TYPE.
| A prefix argument determines the type-checking behavior:
|  - None:         OPTION is defined with TYPE or a subtype of TYPE.
|  - Plain `C-u':  OPTION is defined with TYPE or a subtype of TYPE,
|                  or its current value is compatible with TYPE.
|  - Negative:     OPTION is defined with TYPE (exact match).
|  - Non-negative: OPTION is defined with TYPE (exact match),
|                  or its current value is compatible with TYPE.
| 
| If TYPE is nil (default value) then *all* `defcustom' variables are
| potential candidates.  That is different from using `describe-option',
| because `describe-option' includes user-variable candidates not
| defined with `defcustom' (with `*'-prefixed doc strings).
`----




reply via email to

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