Subject: bug#8962: 24.0.50; do not simply reuse (hard-code) font-lock faces for apropos

From: "Drew Adams" <[email-masked]>
Date: Wed, 29 Jun 2011 14:02:47 -0700

In the past, the same, hard-coded face (`(italic variable-pitch)') was
used for the `Command', `Variable', `Option', and `Properties' links in
apropos output buffers.

At least this had the advantage of not being horribly ugly.  But it had
the disadvantage of not distinguishing the various types of thing by
appearance.

The problem with the current situation is that you have simply reused
font-lock faces, instead of creating new faces (that perhaps inherit
from the same font-lock faces).

Faces that a user might have customized for font-lock, and which work
well for code (e.g. Lisp code), do not necessarily work well for
apropos.

For instance, I use red for `font-lock-function-name-face'.  That is
horrible in apropos output.  But I have no way to customize it for
apropos, without also changing it for code etc.

This is very unwise design.  If you want to use a customizable face
instead of hard-coding the face, great.  But in that case create faces
for apropos itself, so a user can customize the appearance of apropos
without also affecting the appearance of font-lock in general.

You can always make the apropos faces inherit from any faces you like.
But please do not couple things this way, making it hard on users.

This kind of thing is hard-coding - a no-no:

(define-button-type 'apropos-function
  'apropos-label "Function"
  'apropos-short-label "f"
  'face '(font-lock-function-name-face button)
;;      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;;      NO NO ----------

  'help-echo "mouse-2, RET: Display more help on this function"
  'follow-link t
  'action (lambda (button)
     (describe-function (button-get button 'apropos-symbol))))

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-06-27 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt --cflags
-Ic:/build/include'