emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: problems with face-spec-reset-face and set-face-attribute


From: Richard M. Stallman
Subject: Re: problems with face-spec-reset-face and set-face-attribute
Date: Sun, 23 Oct 2005 00:42:48 -0400

    > My comment about a possible bug specific to :inherit was because
    > evaluating the same expression, namely
    >
    >   (set-face-attribute 'completions-first-difference nil ATTR 'unspecified)
    >
    > when ATTR is different from :inherit, e.g. :background or :slant, does
    > work as Drew expected, and as the doc strings say it should.

    In my tests this doesn't work for other attributes too.  Using

    (set-face-attribute 'highlight nil :background 'unspecified)
    (set-face-attribute 'italic nil :slant 'unspecified)

    in the above recipe produces the same result, i.e. doesn't change the
    default for new frames.

I think I understand why.  

Emacs actually has two places to get the face specifications
for new frames.  There is face-new-frame-defaults, and there
is whatever the defface specified.

The face-new-frame-defaults are merged in by
Finternal_merge_in_global_face, and normally override what
the defface specified.  But this happens only when the value
in face-new-frame-defaults is not `unspecified'.

In other words, setting an attribute to `unspecified' 
has an inconsistent meaning.  For an existing frame, it overrides
both the face-new-frame-defaults and the defface.  But when
applied to the "default for new frames", it really means that
face-new-frame-defaults should no longer override the defface.

This is rather ugly, but I am not sure what to clean it up with.




reply via email to

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