bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13276: 24.2.50; apropos-variable


From: Drew Adams
Subject: bug#13276: 24.2.50; apropos-variable
Date: Sat, 5 Jan 2013 09:52:23 -0800

> >> I suggest renaming `apropos-variable' to `apropos-option' and to
> >> use `apropos-variable' for 
> > That sounds right.
> The attached patch does this.

Glad to see this finally happening.

> It renames `apropos-variable' to `apropos-option' and define a new
> `apropos-variable' command.  C-u M-x apropos-variable RET shows only
> user options, and C-u M-x apropos-option RET shows all variables.
> 
> The patch also introduces a new button for user options so that
> users can immediately see which variables are options in the apropos
> buffer.

IOW, essentially the code I pointed to last month (as well as years ago):
http://www.emacswiki.org/emacs/download/apropos-fn%2bvar.el


FWIW, this doc line is not too good:

 With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also
show
-normal variables."
+variables, not just user options."

User options _are_ variables.  The line should say something like "also show
variables that are not user options."


Question (not particularly related to this patch):

Why do we treat the faces differently for, say, `apropos-symbol' and
`apropos-variable'?

apropos.el defines faces for these buttons:

apropos-function-button
apropos-variable-button
apropos-option-button
apropos-misc-button

But it defines faces for these things - not for their buttons:

apropos-symbol
apropos-keybinding
apropos-property

Why don't we handle the following the same way we handle `apropos-symbol' (or
vice versa):

apropos-function
apropos-variable
apropos-option
apropos-misc

E.g., when defining their button types, just include both `button' and the
thing's face for property `face'?  E.g.,

(defface apropos-option '((t (:inherit font-lock-variable-name-face)))
  "Face used for option names in Apropos buffers."
  :group 'apropos)

(define-button-type 'apropos-option
  'apropos-label "Option"
  'apropos-short-label "o"
  'face '(apropos-option button)  ; <======================
  'help-echo "mouse-2, RET: Display more help on this user option (variable)"
  'follow-link t
  'action (lambda (button)
            (describe-variable (button-get button 'apropos-symbol))))

Just wondering.  Why do we treat these differently?  In all cases the faces are
used only for buttons.  Is there some advantage to using one or the other
treatment?  Thx.






reply via email to

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