emacs-devel
[Top][All Lists]
Advanced

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

Re: Idea: Be able to use text properties as face attributes


From: Stefan Monnier
Subject: Re: Idea: Be able to use text properties as face attributes
Date: Tue, 28 Mar 2017 11:26:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> for the 'keymap' property.  There's nothing we could do with these
> attributes during processing of faces by the display engine, except
> record those attributes somewhere, for future use by their respective
> features.

It's worse: the rest of the code can't assume that the display rendering
has propagated the info from the fact attributes to that
"to-be-defined-other-place" since redisplay may not have happened yet or
may not have looked at that part of the buffer yet.

This said, Drew's feature doesn't have to require changes all over
the place.  It might be possible to limit those changes to a few core
place like Fget_text_property.

This said, I think using face attributes is a bad idea.

Instead, we should consider adding some more general system of
indirection.  Drew suggests using `face` as a special meta-property.
Current code already supports such a feature but using the name
`category` and only for overlays (and with some problems linked to the
fact that modifying that meta-property is done via `get` and `put` which
are very generic operations used for many other things, so it's
hard/impossible to detect when those meta-properties are changed, which
is a fairly serious problem.  The only reason why we don't suffer too
much from that problem is because those `category` properties aren't
used very often).

My proposal for "property planes" is somewhat related to Drew's
proposal: my "property planes" allow merging various properties into one
(font-lock can place the (font-lock face) property, and some other
package can add the (mypkg face) property and they then get merged into
the one-and-only `face` property), i.e. many-to-one.  Drew wants the
reverse: adding a single meta-property which then affects several
other properties, i.e. one-to-many.

>From a more general point of view, the shared desire is to have
"abstract text properties" from which "actual text properties"
get computed.


        Stefan




reply via email to

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