all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Garreau\, Alexandre" <galex-713@galex-713.eu>
Cc: emacs-devel@gnu.org
Subject: Re: Questions about text properties
Date: Sun, 21 Oct 2018 18:27:30 +0300	[thread overview]
Message-ID: <83lg6rtj4t.fsf@gnu.org> (raw)
In-Reply-To: <87mur75so2.fsf@portable.galex-713.eu>

> From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
> Cc: emacs-devel@gnu.org
> Date: Sun, 21 Oct 2018 15:35:25 +0200
> 
> Le 21/10/2018 à 15h17, Eli Zaretskii a écrit :
> >> From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
> >> 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	other threads:[~2018-10-21 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-21  3:21 Questions about text properties Garreau, Alexandre
2018-10-21  3:55 ` Daniele Nicolodi
2018-10-21 14:39   ` Stefan Monnier
2018-10-21 12:17 ` Eli Zaretskii
2018-10-21 13:35   ` Garreau, Alexandre
2018-10-21 15:27     ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lg6rtj4t.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=galex-713@galex-713.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.