emacs-devel
[Top][All Lists]
Advanced

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

why do we hard-code faces?


From: Drew Adams
Subject: why do we hard-code faces?
Date: Wed, 8 Dec 2004 11:06:32 -0800

I don't understand why we hard-code faces, instead of using new, specific
faces that users can customize. In particular, most of the occurrences of
property mouse-face are hard-coded to the highlight face. Why don't we
supply specific faces (or face variables) for each specific use of the
mouse-face property?

Why not do things more or less as in info-look.el: define a variable or a
face that is _initialized_ to highlight for mouse-face, but which users can
change independently, without affecting all other uses of the highlight
face.

In some contexts, especially where hot spots are small, I want them to stand
out on mouseover, so I use (set-face-background 'highlight "Cyan"). In other
contexts, like buffer-menu and dired, I put mouse-face on whole lines, to
make it easier to select (click anywhere on the line). In some of those
contexts, I use just underline as the mouse-face (which requires changing
the code).

A user might also have different frame backgrounds (light vs dark) for
specific contexts, requiring different mouse-face highlighting to make one
or the other visible or otherwise suitable.

I'm not saying that most users will want to do things like this. But why not
make it easy for users to adapt mouse-face properties? For users who are
unaware of the properties or don't care, there would be little added cost to
using a new face for each context, and initializing all such faces to
highlight would give the same effect as now, but with more flexibility.

 - Drew

P.S. A question - Is there way to somehow merge face/mouse-face properties,
to, for instance, use underline as a mouse-face property but still have
font-lock highlighting (plus the underline) during mouseover? That is, not
have mouse-face lose the face highlighting?





reply via email to

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