[Top][All Lists]

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

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

From: Drew Adams
Subject: RE: Idea: Be able to use text properties as face attributes
Date: Mon, 27 Mar 2017 07:01:22 -0700 (PDT)

> (I can't check this right now, but) I wonder if it might not
> be as simple as changing `get-text-property' to check whether
> the character at the given POSITION either has the given PROP
> or has a face property (`face', `font-lock-face', `mouse-face')
> that has the given PROP as one of its attributes, and if so
> to return the PROP value.

I sent that quickly, without qualification or explanation.
I was talking only about reading the `face' property and
determining the effect to be given by the display engine.

I didn't really mean to imply that `get-text-property'
would itself be changed in any way.  It should not be.
(But perhaps it would be useful to have another function,
`get-text-property-implied', which does give you such a

In my view, the effect of a applying a face whose spec
contains non-face properties to some text would not
change the text properties of that text (other than its
`face', `font-lock-face', or `mouse-face' property).
It would change only the rendered _effect_, i.e., what
the display engine does.  The text would appear as if
the non-face properties were applied directly to the
text, but in fact they would remain encapsulated within
the `face' etc. property.

There would thus be a difference between applying a
non-face property directly to the text and "applying"
it indirectly by adding it as a face attribute for a
`face' etc. property that is applied to it.  That keeps
things clean and lets you change or undo the effect of
that property _for that face_ only, by changing its
face spec.

> Priority should be given to the latter (PROP on the face) if
> both exist, in my view.  Dunno about priority among `face',
> `font-lock-face', and `mouse-face', if more than one of them
> has the PROP and those PROP values differ.

reply via email to

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