[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-M-x on defface doesn't always work
From: |
Juri Linkov |
Subject: |
Re: C-M-x on defface doesn't always work |
Date: |
Mon, 20 Jun 2005 08:48:56 +0300 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
> I think a good solution here is to reset `saved-face' property to nil
> before evaluating the defface form, and to restore its original value
> afterwards.
>
> Why restore it afterwards? What result is that meant to have?
Customize would still know what face specifications are really saved.
> Now in a new frame this face appears as merged with customized
> non-saved background and saved foreground.
>
> I don't think that is correct.
To be sure, I want to point out that this sentence describes the
situation before my fix.
> When you evaluate a defcustom with C-M-x, it gets rid of the user's
> customizations and installs the default value. Likewise, evaluating a
> defface with C-M-x should install the default value and discard the
> user's customizations.
With defface this doesn't work quite right. For example, a new frame
uses the saved face specification instead of the face default
set by C-M-x (the cause of this is visible in the cited code below)
> (defsubst face-user-default-spec (face)
> "Return the user's customized face-spec for FACE, or the default if
> none.
> If there is neither a user setting nor a default for FACE, return nil."
> - (or (get face 'saved-face)
> + (or (get face 'customized-face)
> + (get face 'saved-face)
> (face-default-spec face)))
>
> What's the motive for that change?
It fixed the situation you named above as not correct.
--
Juri Linkov
http://www.jurta.org/emacs/