Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can an overlay have a non-overriding face?

0 views
Skip to first unread message

Alex

unread,
Sep 12, 2016, 2:06:29 AM9/12/16
to help-gn...@gnu.org
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?

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.


Eli Zaretskii

unread,
Sep 12, 2016, 1:03:13 PM9/12/16
to help-gn...@gnu.org
> From: Alex <agra...@gmail.com>
> 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.

0 new messages