emacs-devel
[Top][All Lists]
Advanced

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

Re: Faces: How to clear an attribute while continuing to inherit other a


From: Dave Goel
Subject: Re: Faces: How to clear an attribute while continuing to inherit other attributes?
Date: Thu, 10 Oct 2019 14:26:02 -0400

> Not if your code does
>   (set-face-foreground FACE (face-foreground 'default))
> With this, if the default face changes the color, FACE will follow
suit.


I don't see that at all here in my emacs24:

 (progn
   (defface a nil "")
   (defface b nil "")
   (set-face-attribute  'b nil :foreground "yellow")
   (set-face-attribute 'a nil :inherit 'b)
   (set-face-foreground 'a (face-foreground 'default))
   ;; let's chase how 'a would render:
   (let
       ((init (face-attribute 'a :foreground nil t))
        final)
        (set-face-foreground 'default "pink")
        (setq final (face-attribute 'a :foreground nil t))
        (message "%S %S" init final)))

"\"white\" \"white\""
Per your assertion, the message should have been: white, pink.

Also, your point seems to be: We shouldn't allow nil (to clear inheritances) for :fg and :bg (unlike for other faces) because: "we only allow strings". I don't get that logic. 





reply via email to

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