[Top][All Lists]

[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: Eli Zaretskii
Subject: Re: Faces: How to clear an attribute while continuing to inherit other attributes?
Date: Thu, 10 Oct 2019 21:39:08 +0300

> From: Dave Goel <address@hidden>
> Date: Thu, 10 Oct 2019 14:26:02 -0400
> Cc: address@hidden
> > 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:

That's because you expect the attribute to magically change after you
set it.  That won't happen; what I meant was to set your face's
foreground _after_ the default changes.

Like I said: I don't have a clear idea of what you are trying to do,
so it's little wonder I'm suggesting things that don't work for you.

> 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. 

There's no way to "clear" inheritance.  What you can do is override
the attributes of the parent face in the inheriting face.  That's
_override_, not _clear_.  IOW, you have to supply a value for the
attribute, and there's no value that "clears" the attribute.

I suggest to take a step back and describe in more detail the problem
you are trying to solve, for which you wanted to "clear" the
foreground color of an inheriting face.  It sounds like you somehow
zeroed in on a particular solution that cannot work.  So please
describe the problem this was supposed to solve, and let us propose a
solution that does work.

reply via email to

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