help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Overriding inherited face attributes


From: Boris Buliga
Subject: Re: Overriding inherited face attributes
Date: Wed, 28 Nov 2018 10:42:26 +0200

Eli,

> Isn't the second example simply wrong syntax-wise?  Why did you use an
> extra level of parentheses?

No, it's totally valid. Built Emacs from the master a month ago.

I did it to replicate the exact result of add-face-text-property example.

On Wed, 28 Nov 2018 at 09:51, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Boris Buliga <boris@d12frosted.io>
> > Date: Wed, 28 Nov 2018 09:39:29 +0200
> > Cc: help-gnu-emacs@gnu.org
> >
> >   > (propertize "hello" 'face '(:foreground "red" :inherit (:foreground
> > "orange")))
> >   #("hello" 0 5 (face (:foreground "red" :inherit (:foreground
> "orange"))))
> >   ;; results in an orange text
> >
> >   > (propertize "hello" 'face '((:foreground "red") (:inherit
> (:foreground
> > "orange"))))
> >   #("hello" 0 5 (face ((:foreground "red") (:inherit ...))))
> >   ;; results in a red text
> >
> > To me, it's still confusing. Why in the first example I have an orange
> text
> > and
> > in the second one - red?
>
> Isn't the second example simply wrong syntax-wise?  Why did you use an
> extra level of parentheses?
>
> > 2. And there is a part saying something I don't quite understand about
> > inheritance.
> >
> > > Attributes from inherited faces are merged into the face like an
> > underlying
> > > face would be, with higher priority than underlying faces.
> >
> > This one looks good to me. If I understand this correctly - inherited
> face
> > attributes behave as usual face attributes.
>
> They behave the same as attributes of the underlying face, but they
> override the underlying face where both specify the same attributes.
>
>

-- 
Cheers,
Boris


reply via email to

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