Didier Verna <didier(a)xemacs.org> writes:
+/*
+ * A face's background pixmap will override the face's
+ * background color. But the background pixmap of the
+ * default face should not override the background color of
+ * a face if the background color has been specified or
+ * inherited.
+ *
+ * To accomplish this we remove the background pixmap of the
+ * cachel and mark it as having been specified so that cachel
+ * merging won't override it later.
Didier, if you're working on this, you might want to fix the code.
The above comment, as it stands, does not cover all the cases.
Imagine the default face having a background pixmap. Say face A
exists and specifies its own background color. The color prevails
over the background inherited from default, which is good. But now
imagine a face B which inherits from face A (and specifies something
inconsequential, such as its foreground color.) You would expect the
face B to display exactly as the face A, except for the different
foreground color?
What happens is that face B gets displayed incorrectly, because the
MAYBE_UNFROB_BACKGROUND_PIXMAP sees that B doesn't specify its own
background color and concludes that the inherited background pixmap
should win.
Substitute modeline for A and modeline-mousable for B, and you'll
understand what's wrong with this picture:
What happens here is that my default face has a nearly black
background pixmap. However, I prefer my modeline to look like a
widget, and have this statement in my .emacs:
(set-face-background 'modeline "gray80")
But modeline-mousable and modeline-buffer-id faces *inherit* from
modeline, and for them the default background wins, as explained
above.
The correct way to resolve this conflict is like this:
The cachel needs to have either a background or a background
pixmap.
Instead of examining only the specifications of one face, the code
should go upward in the face inheritance hierarchy, and stop at
the level where either `background' or `background-pixmap' is
specified, and make that one the winner for the cachel. If they
are specified on the same level, `background' wins.
This was originally formulated by Ben, and I believe it would work
correctly in all cases. The current code would be the special case of
it, where the `background' is specified for the current case and no
upward examination is necessary.