help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Font lock changes (v20.7 to v21.2)


From: Jason Rumney
Subject: Re: [h-e-w] Font lock changes (v20.7 to v21.2)
Date: 19 Mar 2002 22:02:37 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Bill Pringlemeir <address@hidden> writes:

> I decided to upgrade to v21, when I learned that v21.2 has come out.
> It appears that something changed with font-lock.

Faces can now inherit from each other. A full explanation of why this
causes a change in behaviour in this case follows.

>      (copy-face 'default 'font-lock-string-face)
....
>      (set-background-color "black")

> For some reason v21 sets the backgroud face for
> `font-lock-string-face' to be white.

In 20.7, face inheritance was not supported, so when
set-background-color was called, all the faces were examined to see if
they had the same background as the previous default, and if so their
background was changed.  In most cases this produces the expected
results, but there are cases where the background or foreground color
of a face should not be changed.

Now that inheritance is supported, only the properties of the "default"
face are changed by set-background-color.  By default, all faces
inherit from "default", so everything should work as before.  The
problem in your case is that you explicitly copied the properties
of "default" to "font-lock-string-face", including the property that
"default" does not inherit from any other face.  You then change the
background color, which does not apply to font-lock-string-face,
because it no longer inherits from default.

I recommend deleting the lines that set faces from your .emacs, and
using customize to set them.  If you really want to do it by hand,
rather than copying "default" face, create a new face to copy:

(make-empty-face 'empty-face)
(copy-face 'empty-face 'font-lock-string-face)


-- 
Jason Rumney




reply via email to

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