[Top][All Lists]

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

Re: Questions about text properties

From: Eli Zaretskii
Subject: Re: Questions about text properties
Date: Sun, 21 Oct 2018 18:27:30 +0300

> From: "Garreau\, Alexandre" <address@hidden>
> Cc: address@hidden
> Date: Sun, 21 Oct 2018 15:35:25 +0200
> Le 21/10/2018 à 15h17, Eli Zaretskii a écrit :
> >> From: "Garreau\, Alexandre" <address@hidden>
> >> Date: Sun, 21 Oct 2018 05:21:40 +0200
> >> 
> >> – how about adding stuff to a *value* of property, be it a list, or
> >>   anything that could inherit, such as an alist, a keymap, etc.? it
> >>   seems there are no functions for that;
> >
> > Not sure I understand why you need something special: modifying a Lisp
> > value, whether to add something or otherwise, is rather trivial, no?
> It is.  But the same way, add text-properties using put*/set* functions
> (put-text-property, set-text-properties) is rather trivial too

No, they aren't: you could, for example, add-text-properties to a
substring of the characters that have the existing properties.  By
contrast, a value doesn't have this complication.

> there are add-* functions (add-text-properties, add-face-text-property)
> because that makes them more standard and because they’re convenient I
> guess, and the fact you can use put*/set* functions instead of add*
> functions doesn’t make the add* functions useless.

They exist because they require non-trivial transformation of the
underlying data structures, which are not exposed to Lisp.

> > you can have already, by using the 'keymap' property, and perhaps a
> > few others.
> But these don’t trigger a face or special properties that will keep
> being true for a specified and definite amount of time.  A key is
> instantaneous.

A key can be bound to a function that can do anything, including
changing the face of the underlying characters.

> >> – why can it only affects face rather than other properties so that to
> >>   extend its behavior?
> >
> > By "it" you mean, mouse-face?  Because it's a face.
> Erm, yes.  So why is it only a face and not a full plist

Because it needs a non-trivial support from the display engine.

> Both help-echo and mouse-face can take a function, so its value will be
> more dynamic than with a fixed constant value.  Why only them while other
> properties could have them so to be more dynamic?

Each property has its own purpose, and they were designed mostly one
by one.

reply via email to

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