GNU bug report logs - #8962
24.0.50; do not simply reuse (hard-code) font-lock faces for apropos

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 29 Jun 2011 21:04:02 UTC

Severity: wishlist

Merged with 11139

Found in versions 24.0.50, 24.0.94

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; do not simply reuse (hard-code) font-lock faces for apropos
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'






This bug report was last modified 13 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.