From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.devel Subject: Re: Questions about text properties Date: Sun, 21 Oct 2018 15:35:25 +0200 Message-ID: <87mur75so2.fsf@portable.galex-713.eu> References: <87pnw46l2z.fsf@portable.galex-713.eu> <83r2gjtrwx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540129291 7967 195.159.176.226 (21 Oct 2018 13:41:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2018 13:41:31 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 21 15:41:27 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 1gEDyw-00020x-W1 for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2018 15:41:27 +0200 Original-Received: from localhost ([::1]:58987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEE13-0002Lw-Gw for ged-emacs-devel@m.gmane.org; Sun, 21 Oct 2018 09:43:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEDtE-00046a-MX for emacs-devel@gnu.org; Sun, 21 Oct 2018 09:35:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEDtC-00028k-NA for emacs-devel@gnu.org; Sun, 21 Oct 2018 09:35:32 -0400 Original-Received: from portable.galex-713.eu ([2a00:5884:8305::1]:32968) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEDtA-00026n-Vj; Sun, 21 Oct 2018 09:35:30 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gEDt8-0005Qc-7W; Sun, 21 Oct 2018 15:35:26 +0200 X-GPG-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F X-Accept-Language: fr, en, it, eo In-Reply-To: <83r2gjtrwx.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 21 Oct 2018 15:17:50 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8305::1 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:230541 Archived-At: Le 21/10/2018 =C3=A0 15h17, Eli Zaretskii a =C3=A9crit=C2=A0: >> From: "Garreau\, Alexandre" >> Date: Sun, 21 Oct 2018 05:21:40 +0200 >>=20 >> =E2=80=93=C2=A0how 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, but there are add-* functions (add-text-properties, add-face-text-property) because that makes them more standard and because they=E2=80=99re convenien= t I guess, and the fact you can use put*/set* functions instead of add* functions doesn=E2=80=99t make the add* functions useless. >> =E2=80=93=C2=A0why are properties rear-sticky by default rather than the= opposite? > > Because the other alternative is rarely needed. E.g., if you modify a > string that has a face, you want the appended characters to inherit > the same face. By contrast, inserting before the string rarely needs > such inheritance. Ah ok, I didn=E2=80=99t feel like it=E2=80=99s the case, but maybe it is th= at my editing is more chaotic than most others=E2=80=99 then. >> =E2=80=93=C2=A0why is there only a mouse-face property, rather than a ho= ver, click, >> pressed, active, focus, etc. > > The usual reason: low demand and/or low motivation to develop features > that are in low demand. Ok. > Another possible reason is that at least some > of those (click and press -- what's the difference, btw?) they were examples as not all interfaces name these the same. CSS use =E2=80=9Cactive=E2=80=9D, which may be less familiar than click (used in js= ) or pressed, which is used by I-don=E2=80=99t-recall-which other interface. > you can have already, by using the 'keymap' property, and perhaps a > few others. But these don=E2=80=99t trigger a face or special properties that will keep being true for a specified and definite amount of time. A key is instantaneous. >> =E2=80=93=C2=A0why 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, that might also contain a face? potentially also forbidding properties that may change the size of the text, too, as mouse-face already does for face attributes. >> =E2=80=93=C2=A0sometimes most text properties can take a hook (that will= be called >> lazily to compute a valid value), sometimes not (like for a display >> prop space); > > Not sure what this is about. In general, only functions have hooks, > not properties. How about a couple of examples? I should have been more precise as now I don=E2=80=99t recall precisely what details did triggered in me this feeling after ending my reading. 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? >> =E2=80=94=C2=A0is the recenter thing about overlays related to the fact = buffers are >> implemented with a buffer gap, or is it just something similar to >> fasten stuff? > > It makes overlay access faster. Ok so it=E2=80=99s a separate optimization ok.