From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Questions about text properties Date: Sun, 21 Oct 2018 18:27:30 +0300 Message-ID: <83lg6rtj4t.fsf@gnu.org> References: <87pnw46l2z.fsf@portable.galex-713.eu> <83r2gjtrwx.fsf@gnu.org> <87mur75so2.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1540135556 8361 195.159.176.226 (21 Oct 2018 15:25:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2018 15:25:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Garreau\, Alexandre" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 21 17:25:52 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEFbz-0001zh-Rx for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2018 17:25:51 +0200 Original-Received: from localhost ([::1]:59239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEFe1-0004g9-6t for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2018 11:27:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEFdu-0004aV-Hr for emacs-devel@gnu.org; Sun, 21 Oct 2018 11:27:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEFdr-0006ha-7B for emacs-devel@gnu.org; Sun, 21 Oct 2018 11:27:50 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEFdr-0006hU-1o; Sun, 21 Oct 2018 11:27:47 -0400 Original-Received: from [176.228.60.248] (port=1690 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gEFdq-0007c2-Kt; Sun, 21 Oct 2018 11:27:46 -0400 In-reply-to: <87mur75so2.fsf@portable.galex-713.eu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230544 Archived-At: > From: "Garreau\, Alexandre" > 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" > >> 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.