Subject: Re: bug#16789: 24.3; load-theme ignores some faces the value of a attribute is nil

From: Alex Kost <[email-masked]>
Date: Wed, 19 Feb 2014 09:56:57 +0400

kuanyui (2014-02-18 09:40 +0400) wrote:

> load-theme is invalid if a value of a attribute in defface is nil.
> Or more accurately, it seems to ignore some faces under some situation.
>
>
> Define a theme, for example, OUR-THEME.el
>
> Magit inherit its diff faces from diff.el, like this:
>
>     (defface magit-diff-add
>       '((t :inherit diff-added))
>       "Face for lines in a diff that have been added."
>       :group 'magit-faces)
>
> If you've defined a face for `diff-added` like this:
>
> `(diff-added ((((class color) (min-colors 89))
>            (:foreground "#008700" :background "#d7ff5f" :bold t))))
>
> But now you want to *remove* the :background of `magit-diff-add`,
> so add a nil on :background :
>
>     `(magit-diff-add ((((class color) (min-colors 89))
>             (:foreground "#008700" :background nil :bold t))))
>
> Then, restart Emacs (to ensure Emacs would be "clean"), `require 'magit`
> and `load-theme OUR-THEME`; you will found load-theme IGNORES the whole 
> line defination of magit-diff-add, And magit-diff-add still only
> inherits diff-added.
>
> * Most strange is, if you `find-file` OUR-THEME.el and M-x eval-buffer,
> the :background nil TAKE EFFECT. *
>
> I ask this issue because this strange behavior is an obstacle on 
> defining theme.

It is so in 24.3.1, but it works OK in 24.3.50.

You may look at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16658> for details.