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

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

Re: Can an overlay have a non-overriding face?


From: Eli Zaretskii
Subject: Re: Can an overlay have a non-overriding face?
Date: Mon, 12 Sep 2016 20:03:08 +0300

> From: Alex <address@hidden>
> Date: Sun, 11 Sep 2016 20:21:22 -0600
> 
> Suppose there are two overlays A and B. Is it possible for overlay A to
> have a higher priority than B yet for the face (or any arbitrary
> property) property to not override B's?

As the ELisp manual says, faces do not override each other, they are
merged:

     The priority matters when two or more overlays cover the same
     character and both specify the same property; the one whose
     ‘priority’ value is larger overrides the other.  For the ‘face’
     property, the higher priority overlay’s value does not completely
     override the other value; instead, its face attributes override the
     face attributes of the lower priority ‘face’ property.

IOW, only the same attributes in the lower-priority overlay's face are
overridden, the rest of that face's attributes are kept.

> If not, would that be a reasonable feature request? Currently I made a
> workaround where I copy overlay A, lower its priority, and then put the
> face on that overlay.
> 
> It would be nice if that wasn't necessary.

Depends on the use case.  Please file a feature request, and please
describe your use cases there.

Thanks.



reply via email to

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