How to unset an inherited face attribute while continuing to inherit other attributes?
Face 'a inherits from 'b, which sets foreground to yellow. How do I keep 'a inheriting from 'b, but set the foreground to (nothing), so that actually rendering 'a goes to the default foreground (white) instead of yellow?
Emacs allows us to set a's foreground to nil (instead of 'unspecified), but it magically becomes 'unspecified when queried. That's not what I was aiming for. That is because 'unspecified means actually rendering face 'a would yield yellow, the color inherited from 'b instead of the default foreground.
Here's a test:
(progn
(defface a nil "")
(defface b nil "")
(set-face-attribute 'b nil :foreground "yellow")
(set-face-attribute 'a nil :inherit 'b)
(set-face-attribute 'a nil :foreground nil)
;; let's chase how 'a would render:
(face-attribute 'a :foreground nil t))
=> "yellow"
We expected either "white", the default foreground.
So, unfortunately, setting a's foreground to nil seems to be equivalent to setting a's foreground to 'unspecified.
Once I set it to nil, I edebugged (face-attribute), and it calls ' internal-get-lisp-face-attribute which yields 'unspecified instead of the expected nil.
(Please cc replies if you can. I tested all this with emacs24.)
Thanks
Dave