From unknown Mon Jun 23 18:30:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17507 <17507@debbugs.gnu.org> To: bug#17507 <17507@debbugs.gnu.org> Subject: Status: Documentation for `add-text-property' and relatives Reply-To: bug#17507 <17507@debbugs.gnu.org> Date: Tue, 24 Jun 2025 01:30:50 +0000 retitle 17507 Documentation for `add-text-property' and relatives reassign 17507 emacs submitter 17507 Eli Barzilay severity 17507 wishlist tag 17507 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 16 02:25:56 2014 Received: (at submit) by debbugs.gnu.org; 16 May 2014 06:25:56 +0000 Received: from localhost ([127.0.0.1]:36647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WlBab-0003ki-44 for submit@debbugs.gnu.org; Fri, 16 May 2014 02:25:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47106) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WlBaV-0003kL-Tm for submit@debbugs.gnu.org; Fri, 16 May 2014 02:25:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlBaJ-0005Ey-LR for submit@debbugs.gnu.org; Fri, 16 May 2014 02:25:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlBaJ-0005Eq-HP for submit@debbugs.gnu.org; Fri, 16 May 2014 02:25:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlBaD-0000Ny-DV for bug-gnu-emacs@gnu.org; Fri, 16 May 2014 02:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlBa6-0005Bp-BW for bug-gnu-emacs@gnu.org; Fri, 16 May 2014 02:25:29 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:42128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlBa6-0005BY-7r for bug-gnu-emacs@gnu.org; Fri, 16 May 2014 02:25:22 -0400 Received: by mail-qg0-f47.google.com with SMTP id j107so3460048qga.6 for ; Thu, 15 May 2014 23:25:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:subject; bh=gviJym2jmJAYO8fAo0F4tKrEnuwSoUnIFqEQE1mCx7g=; b=HsH8GmEZCBPeexuZlupV4Co84wJA5JvqiamTKQPTdu+eyvXqatbNpNv73WsTbyvdzA d+LpIAfidyqnWl+7Pnl0cNaeHjYoHE9R+8HmnEg9KELRw6rFoZS/06iox6GwatsfVIuF PIYC5Em1J4Fgidqr6qmblzqiWtvsNW38X86BAgql1CORQH/0oFSJVwIXR+3lLn7A30zE 1J6FGDNr7m3bioVMUG2mTH3xU1SwsEAwciUuC56wkEeDNSR1srRAHGe2j899F4jJk30j dH5MHMnfKJgP/9fC/gbnq7LWK+/hddEEK0KyHiPqNk6l9DgvfgDCrzHAULROHdqZyHQf lTlg== X-Gm-Message-State: ALoCoQmJsbPrGACx318E0+nD9NYPCFo7Zfnz8W4SIDPhmD7u6ggrGdNFEIBnCqFzedX5fPA/DcXH X-Received: by 10.224.47.130 with SMTP id n2mr20004572qaf.26.1400221520907; Thu, 15 May 2014 23:25:20 -0700 (PDT) Received: from home.barzilay.org (c-24-60-254-179.hsd1.ma.comcast.net. [24.60.254.179]) by mx.google.com with ESMTPSA id r6sm11556365qab.40.2014.05.15.23.25.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 May 2014 23:25:20 -0700 (PDT) From: Eli Barzilay MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21365.44878.936634.958813@home.barzilay.org> Date: Fri, 16 May 2014 02:25:18 -0400 To: bug-gnu-emacs@gnu.org Subject: Documentation for `add-text-property' and relatives X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-redhat-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) It was unclear to me how to use `add-text-property' and its relatives (I actually started with `font-lock-append-text-property') with strings, since they don't return the string. It also looks like it won't be practical to ask for a change where they do return the string (if given one) since `add-text-properties' actually has a specified return value (which is arguably not as useful as getting back a string...). In any case, I eventually found out what I need to do, but it took me a while because I was confused. This is a bit verbose, but please bear with me... What I was surprised to find out is that (let ((s "foo")) (put-text-property 0 3 'foo 'bar s) s) works. It's probably obvious for elisp hackers, but coming from most other lisps/schemes, I kind of assumed that the #("foo" ...) thing is made of the "foo" string in some vector-like container that holds the properties. Given that unconscious assumption, I assumed that it wouldn't work, and that I'll need some uglier hack like (let ((s (propertize "foo" 'foo nil))) (put-text-property 0 3 'foo 'bar s) s) so that `s' points to an object that can be mutated inside. So I think that it would be a good idea to add a comment in the docs (of all of these functions) that notes that when given a string, they mutate it, and it works even if the input is property-less. Or just make it easier with showing a example as the above. (Hopefully the above makes sense -- I wonder how many lispers who are not native e-lispers have that assumption...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 14 19:57:53 2019 Received: (at 17507) by debbugs.gnu.org; 14 Aug 2019 23:57:53 +0000 Received: from localhost ([127.0.0.1]:49874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy39M-0007zF-Pz for submit@debbugs.gnu.org; Wed, 14 Aug 2019 19:57:53 -0400 Received: from quimby.gnus.org ([80.91.231.51]:58030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy39L-0007z8-43 for 17507@debbugs.gnu.org; Wed, 14 Aug 2019 19:57:52 -0400 Received: from 24-104-73-23-ip-static.hfc.comcastbusiness.net ([24.104.73.23] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hy39G-0005YA-Jp; Thu, 15 Aug 2019 01:57:49 +0200 From: Lars Ingebrigtsen To: Eli Barzilay Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> Date: Wed, 14 Aug 2019 16:57:44 -0700 In-Reply-To: <21365.44878.936634.958813@home.barzilay.org> (Eli Barzilay's message of "Fri, 16 May 2014 02:25:18 -0400") Message-ID: <87a7cbti4n.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Barzilay writes: > What I was surprised to find out is that > > (let ((s "foo")) (put-text-property 0 3 'foo 'bar s) s) > > works. It's probably obvious for elisp hackers, but coming from > most other lisps/schemes, I [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Barzilay writes: > What I was surprised to find out is that > > (let ((s "foo")) (put-text-property 0 3 'foo 'bar s) s) > > works. It's probably obvious for elisp hackers, but coming from > most other lisps/schemes, I kind of assumed that the #("foo" ...) > thing is made of the "foo" string in some vector-like container that > holds the properties. Given that unconscious assumption, I assumed > that it wouldn't work, and that I'll need some uglier hack like > > (let ((s (propertize "foo" 'foo nil))) > (put-text-property 0 3 'foo 'bar s) s) > > so that `s' points to an object that can be mutated inside. > > So I think that it would be a good idea to add a comment in the docs > (of all of these functions) that notes that when given a string, they > mutate it, and it works even if the input is property-less. Or just > make it easier with showing a example as the above. > > (Hopefully the above makes sense -- I wonder how many lispers who are > not native e-lispers have that assumption...) (I'm going through old bug reports that have unfortunately gotten no responses yet.) Hm... I think the doc string is pretty clear here: --- If the optional fifth argument OBJECT is a buffer (or nil, which means the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. --- I understand that if you come from a C background (or something like that) your assumption may be that a string is just a bunch of bytes with a null at the end, so you can't add any properties to it -- but that's not the case in most languages, where a string is an object with lots of different qualities in addition to the text itself. So I don't think this is something that's desirable to explain in this specific context, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 14 19:57:59 2019 Received: (at control) by debbugs.gnu.org; 14 Aug 2019 23:57:59 +0000 Received: from localhost ([127.0.0.1]:49877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy39T-0007za-4K for submit@debbugs.gnu.org; Wed, 14 Aug 2019 19:57:59 -0400 Received: from quimby.gnus.org ([80.91.231.51]:58044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy39R-0007zR-69 for control@debbugs.gnu.org; Wed, 14 Aug 2019 19:57:57 -0400 Received: from 24-104-73-23-ip-static.hfc.comcastbusiness.net ([24.104.73.23] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hy39O-0005YH-62 for control@debbugs.gnu.org; Thu, 15 Aug 2019 01:57:56 +0200 Date: Wed, 14 Aug 2019 16:57:51 -0700 Message-Id: <878srvti4g.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #17507 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 17507 notabug close 17507 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 17507 notabug close 17507 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 14 23:41:37 2019 Received: (at 17507) by debbugs.gnu.org; 15 Aug 2019 03:41:38 +0000 Received: from localhost ([127.0.0.1]:50243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy6dt-00082F-JO for submit@debbugs.gnu.org; Wed, 14 Aug 2019 23:41:37 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:34292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy6dr-000822-4f for 17507@debbugs.gnu.org; Wed, 14 Aug 2019 23:41:36 -0400 Received: by mail-vs1-f65.google.com with SMTP id b20so758544vso.1 for <17507@debbugs.gnu.org>; Wed, 14 Aug 2019 20:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barzilay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KSsM395OuRB75NChzxwaJtEolB4By6m9gn3wU9IRN6U=; b=VUiq6TXkYX6YBNW9sn+be01w4AlnbxFxqk69TeoSzL78yc0hIi+fbn38dInXT6bF6A IoAkNnObJtNhbSSU0EcLTaoN/ARWVaykO/GznS/g6l6D2mkKvBt54sxq81LwHw20qYIR W3amSr340hM/5BcYDE33oPilQxiRhT7Q17vTeHKKhYqHNpDqbSjSJ/5bC6ecz5PzrQLB ODOKapneplOlKE1AFiuizDdZKbxud3uQ18Be3EsQBlKibezswa2imIfnzTkbMaz63gFc i5lZ4mA0brMWFVVElEulCc+22foSnB5802GYuCB+adwXoOPFiaPJ3rBhOYi4t6oNZ5I2 B++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KSsM395OuRB75NChzxwaJtEolB4By6m9gn3wU9IRN6U=; b=jtSgR4ydpfc4n+tgPuxZaMzWDkMevMalfm43kRkpG0tFY8YfqMABbnSIyqnLFFFjIi j3bZiJFRLu4O3PhO89AbPiadsLVpE4kwJBBnRygRFucVtebeyuD1DoYQ5dXDym1BlVbZ 5q8/d+1aB68ldbrX2Bjze9asdxqgtG9jU1zpj3KKm207q+UfrVaUKC9z9reKpt7uWPfb s2kT2Q1lsHoHPgJ8olZMhYTzHuqPmEL9eDPJjfu0Y1vbYeDKxUUyuyl4li0VghGjr+8I w67nKhYNvApsmZijmtaLG77CrwMuBs42bmuwWEAXf7tIymN3W1ZJ+qaV/q/AfEL2yKWy nqOg== X-Gm-Message-State: APjAAAV8WvqYJrjR+euL7wggvTVNGMExIY0L8griNYfelbVg3ZSM7pw3 3ewegEsNPanU1c3fvG39vgdwv+o79VHGq0wT9p5vjk/QAgA= X-Google-Smtp-Source: APXvYqzoXAhNK0vAEZgCU/iYoJLgXUReGU84JoAHJjFq7IYNpxlmMthYPWv4GXX3rShgiIyd/5JSeB1fpSBK51Qfkgg= X-Received: by 2002:a67:e8c3:: with SMTP id y3mr2039016vsn.94.1565840489037; Wed, 14 Aug 2019 20:41:29 -0700 (PDT) MIME-Version: 1.0 References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> In-Reply-To: <87a7cbti4n.fsf@mouse.gnus.org> From: Eli Barzilay Date: Thu, 15 Aug 2019 06:41:17 +0300 Message-ID: Subject: Re: bug#17507: Documentation for `add-text-property' and relatives To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) Um... Note that I referred *explicitly* to other lisps and schemes. The assumption that I'm talking about would hold for people who are used to CL too: a string is indeed more than just a pointer bytes with a NUL at the end, yet there is no way to change a *property* of "foo" and end up with #("foo" stuff...). On Thu, Aug 15, 2019 at 2:57 AM Lars Ingebrigtsen wrote: > > Eli Barzilay writes: > > > What I was surprised to find out is that > > > > (let ((s "foo")) (put-text-property 0 3 'foo 'bar s) s) > > > > works. It's probably obvious for elisp hackers, but coming from > > most other lisps/schemes, I kind of assumed that the #("foo" ...) > > thing is made of the "foo" string in some vector-like container that > > holds the properties. Given that unconscious assumption, I assumed > > that it wouldn't work, and that I'll need some uglier hack like > > > > (let ((s (propertize "foo" 'foo nil))) > > (put-text-property 0 3 'foo 'bar s) s) > > > > so that `s' points to an object that can be mutated inside. > > > > So I think that it would be a good idea to add a comment in the docs > > (of all of these functions) that notes that when given a string, they > > mutate it, and it works even if the input is property-less. Or just > > make it easier with showing a example as the above. > > > > (Hopefully the above makes sense -- I wonder how many lispers who are > > not native e-lispers have that assumption...) > > (I'm going through old bug reports that have unfortunately gotten no > responses yet.) > > Hm... I think the doc string is pretty clear here: > > --- > If the optional fifth argument OBJECT is a buffer (or nil, which means > the current buffer), START and END are buffer positions (integers or > markers). If OBJECT is a string, START and END are 0-based indices into it. > --- > > I understand that if you come from a C background (or something like > that) your assumption may be that a string is just a bunch of bytes with > a null at the end, so you can't add any properties to it -- but that's > not the case in most languages, where a string is an object with lots of > different qualities in addition to the text itself. > > So I don't think this is something that's desirable to explain in this > specific context, and I'm closing this bug report. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 10:30:18 2019 Received: (at 17507) by debbugs.gnu.org; 15 Aug 2019 14:30:18 +0000 Received: from localhost ([127.0.0.1]:52118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyGld-0001lO-Lk for submit@debbugs.gnu.org; Thu, 15 Aug 2019 10:30:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyGlZ-0001kC-0K for 17507@debbugs.gnu.org; Thu, 15 Aug 2019 10:30:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hyGlT-0006kx-QK; Thu, 15 Aug 2019 10:30:07 -0400 Received: from [176.228.60.248] (port=1790 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hyGlT-0002SE-5r; Thu, 15 Aug 2019 10:30:07 -0400 Date: Thu, 15 Aug 2019 17:30:00 +0300 Message-Id: <83k1beqz6f.fsf@gnu.org> From: Eli Zaretskii To: Eli Barzilay In-reply-to: (message from Eli Barzilay on Thu, 15 Aug 2019 06:41:17 +0300) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eli Barzilay > Date: Thu, 15 Aug 2019 06:41:17 +0300 > Cc: 17507@debbugs.gnu.org > > Um... Note that I referred *explicitly* to other lisps and schemes. > The assumption that I'm talking about would hold for people who are > used to CL too: a string is indeed more than just a pointer bytes with > a NUL at the end, yet there is no way to change a *property* of "foo" > and end up with #("foo" stuff...). Can you explain in more detail what did you think was missing from the manual? I've read the original report, and I admit I didn't understand what was the essence of your difficulty. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 21:20:44 2019 Received: (at 17507) by debbugs.gnu.org; 16 Aug 2019 01:20:44 +0000 Received: from localhost ([127.0.0.1]:52782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyQv6-0004dt-DG for submit@debbugs.gnu.org; Thu, 15 Aug 2019 21:20:44 -0400 Received: from quimby.gnus.org ([80.91.231.51]:50630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyQv4-0004dl-9d for 17507@debbugs.gnu.org; Thu, 15 Aug 2019 21:20:43 -0400 Received: from [50.225.213.182] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyQuz-0000Py-JH; Fri, 16 Aug 2019 03:20:40 +0200 From: Lars Ingebrigtsen To: Eli Barzilay Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> Date: Thu, 15 Aug 2019 18:20:33 -0700 In-Reply-To: (Eli Barzilay's message of "Thu, 15 Aug 2019 06:41:17 +0300") Message-ID: <875zmxsy72.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Barzilay writes: > Um... Note that I referred *explicitly* to other lisps and schemes. > The assumption that I'm talking about would hold for people who are > used to CL too: a string is indeed more than just a pointe [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Barzilay writes: > Um... Note that I referred *explicitly* to other lisps and schemes. > The assumption that I'm talking about would hold for people who are > used to CL too: a string is indeed more than just a pointer bytes with > a NUL at the end, yet there is no way to change a *property* of "foo" > and end up with #("foo" stuff...). If there were a way to put properties on string objects in a Common Lisp implementation, I would expect that it would work just as it does in Emacs: Not wrapping the string in some other object, but just extend the object itself. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 21:35:55 2019 Received: (at 17507) by debbugs.gnu.org; 16 Aug 2019 01:35:55 +0000 Received: from localhost ([127.0.0.1]:52801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyR9n-00051Z-0x for submit@debbugs.gnu.org; Thu, 15 Aug 2019 21:35:55 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:40022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyR9k-00051J-6p for 17507@debbugs.gnu.org; Thu, 15 Aug 2019 21:35:53 -0400 Received: by mail-ua1-f65.google.com with SMTP id s4so1502679uad.7 for <17507@debbugs.gnu.org>; Thu, 15 Aug 2019 18:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barzilay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iqYl/E/vBxO+ewgXoQstB3DOd6wihTBoYIod+AllclQ=; b=sz/rRRrE1YhGi1Ljiire1OlHg+Tc/PHnVC7l8n+qFXnfGrXfCz+Ct8n/XYN6wv1/ff TTuZ1o3qGLfnvM0vSW3EAd/v5sQSMhW+s9VQMOkVHT0by3/SrKpHB4LOymkUsj2vG8XC W9rvnq9jBiVkjvmpZv7YGPnHzXTvg/IKgsA2yyOo39ipmgAPdErEcyW12kHsFcB2nO81 SEMq1aaU6UnPME78BbTXjmr78OdMw5xL1NbcvwzzcNtQ4i+3YoZdikZWBE/y5vHPJOAq J8hejur4tk+YdgloFkh0N239UMTmhOudyaM6Ku62Yk4yAU0S8aDUIip1ij2hBd2dmhzn m7GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iqYl/E/vBxO+ewgXoQstB3DOd6wihTBoYIod+AllclQ=; b=L+eXRuP0hixmXtf/5yptSofW4kqIY6rSbdBKc5wM8DdP/UZnSVtxHjcoLBdIinwO5O M6h2mjGWN4YNHsAUmsmaIvQr+s56dH5kgjIz73LGxoEBjL6SnHV1tCoIt3avlNKkF9uv jkbjY/CndeQ3i08Ji8fkTJbk8GANU0R0kveQImm6qrVsuy3zcb6rOVhWO3JwSkwFKUwi 2HG+KUAqfKWBYHjsntR+kcBpPMl+ZAoJYbdfwKx0tG7R8l/wW46ses+4NlXhkuNXk7Ow /VXUPqQudtw6x7BdW1WvjIP2gkp3epLfsBU5BSYmznOC6bVDbnEBMYm/H1A9gX77HXG2 K8rw== X-Gm-Message-State: APjAAAWMAkJ6t0deFrLrI0fzSKZAJ89NjNzfbNjna/FDCLqzBPSefRlP J4JF5YSUZxoFTrQ3HHUAUck1bhEm0GXVPjO8TyQeFw== X-Google-Smtp-Source: APXvYqwxdOnur/JUmFoLuT1hAnhQrv2w5ML6+8pWSt6wPGUVXc3dnsVd+aSPEKypZY8M9YrI20ZtCHYP/t9wS11FfLE= X-Received: by 2002:ab0:7812:: with SMTP id x18mr5018448uaq.67.1565919346242; Thu, 15 Aug 2019 18:35:46 -0700 (PDT) MIME-Version: 1.0 References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> In-Reply-To: <83k1beqz6f.fsf@gnu.org> From: Eli Barzilay Date: Fri, 16 Aug 2019 04:35:35 +0300 Message-ID: Subject: Re: bug#17507: Documentation for `add-text-property' and relatives To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, Lars Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) In lisps you can mutate properties of an object, but you cannot change the pointer itself. I think that another way to clarify it would be to say that "foo" is actually shorthand for #("foo") but the #() is omitted for brevity. But at this point this is subjective enough to be ignorable... On Thu, Aug 15, 2019 at 5:30 PM Eli Zaretskii wrote: > > > From: Eli Barzilay > > Date: Thu, 15 Aug 2019 06:41:17 +0300 > > Cc: 17507@debbugs.gnu.org > > > > Um... Note that I referred *explicitly* to other lisps and schemes. > > The assumption that I'm talking about would hold for people who are > > used to CL too: a string is indeed more than just a pointer bytes with > > a NUL at the end, yet there is no way to change a *property* of "foo" > > and end up with #("foo" stuff...). > > Can you explain in more detail what did you think was missing from the > manual? I've read the original report, and I admit I didn't > understand what was the essence of your difficulty. > > Thanks. -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 04:46:23 2019 Received: (at 17507) by debbugs.gnu.org; 16 Aug 2019 08:46:23 +0000 Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyXsM-00053q-Ig for submit@debbugs.gnu.org; Fri, 16 Aug 2019 04:46:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyXsK-00053e-OS for 17507@debbugs.gnu.org; Fri, 16 Aug 2019 04:46:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hyXsF-0003Fz-Em; Fri, 16 Aug 2019 04:46:15 -0400 Received: from [176.228.60.248] (port=4739 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hyXsE-0001Wo-Nd; Fri, 16 Aug 2019 04:46:15 -0400 Date: Fri, 16 Aug 2019 11:46:08 +0300 Message-Id: <837e7dpkfj.fsf@gnu.org> From: Eli Zaretskii To: Eli Barzilay In-reply-to: (message from Eli Barzilay on Fri, 16 Aug 2019 04:35:35 +0300) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eli Barzilay > Date: Fri, 16 Aug 2019 04:35:35 +0300 > Cc: Lars Ingebrigtsen , 17507@debbugs.gnu.org > > In lisps you can mutate properties of an object, but you cannot change > the pointer itself. I think that another way to clarify it would be > to say that "foo" is actually shorthand for #("foo") but the #() is > omitted for brevity. But at this point this is subjective enough to > be ignorable... Sorry for prolonging this discussion, but I still don't think I understand the difficulty. Allow me to step back a notch and look at this from a higher-level perspective. In Emacs, text properties are stored separately from the text itself. In particular, text properties of a string are not part of the string text, they live in a separate structure, and a string only maintains a reference to that structure. When Emacs needs to display the string, it consults that structure and renders the string characters accordingly. When the Lisp interpreter needs to print the string, it prints the properties as well, to make them visible. It sounds like your mental model of a string was that it included the properties, and therefore you were surprised that add-text-property etc. appeared to modify the string by side effect. Is that what surprised you? If so, would saying that these functions modify the properties of a string without mutating the string itself resolve the difficulty? From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 16:04:46 2019 Received: (at 17507) by debbugs.gnu.org; 16 Aug 2019 20:04:46 +0000 Received: from localhost ([127.0.0.1]:54934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyiSs-0007WH-29 for submit@debbugs.gnu.org; Fri, 16 Aug 2019 16:04:46 -0400 Received: from quimby.gnus.org ([80.91.231.51]:36988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyiSq-0007W9-4S for 17507@debbugs.gnu.org; Fri, 16 Aug 2019 16:04:44 -0400 Received: from [50.225.213.182] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyiSk-0000LK-Me; Fri, 16 Aug 2019 22:04:41 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> Date: Fri, 16 Aug 2019 13:04:34 -0700 In-Reply-To: <837e7dpkfj.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Aug 2019 11:46:08 +0300") Message-ID: <87sgq0q3l9.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > In Emacs, text properties are stored separately from the text itself. > In particular, text properties of a string are not part of the string > text, they live in a separate structure, and a string [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, Eli Barzilay X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > In Emacs, text properties are stored separately from the text itself. > In particular, text properties of a string are not part of the string > text, they live in a separate structure, and a string only maintains a > reference to that structure. Well, isn't that the same thing conceptually as the properties being in the string object? However things are arranged internally (with a reference to a different struct or being in the in the same struct), from the Emacs Lisp side of thing, the string object has properties. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 19:50:15 2019 Received: (at 17507) by debbugs.gnu.org; 16 Aug 2019 23:50:15 +0000 Received: from localhost ([127.0.0.1]:55177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hylz4-0002jk-Mz for submit@debbugs.gnu.org; Fri, 16 Aug 2019 19:50:14 -0400 Received: from mail-ua1-f41.google.com ([209.85.222.41]:35944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hylz2-0002jT-75 for 17507@debbugs.gnu.org; Fri, 16 Aug 2019 19:50:12 -0400 Received: by mail-ua1-f41.google.com with SMTP id v20so2668697uao.3 for <17507@debbugs.gnu.org>; Fri, 16 Aug 2019 16:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barzilay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g2rF919KI/5m/mM+YVh9C8tf/4LSu+ZcBM3daakrC94=; b=Yojas9ye5BU++occyK+vMmK3mct6BZS43KCRIgDMYKgOUljzqSt8qq0TvaoAma8F/G A1thGvoOEHRrRXLiEf2JZmZRb3lSj6v0E16WWsublZ5hmctYuscqpakipQcikLSq3vFL ntBrZ4EudRxccTEWa4XNTL5M10RCg9nPrvkV6ksFRmFINU+gu1xHG+kO2XW9YrXs2C6c mC23Unrd+Jtro/gbM78yBTfeH7LF3vpRdjjsZ2BCahvHkr8CNTzpgmBCb/Iv8giueoT3 hSGUZPNq9TVeUBISXxGiu+K9McDbv2kgKc5tuWjZmXF5xu70/FTtoTSY4vsE9lK80eVL hfNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g2rF919KI/5m/mM+YVh9C8tf/4LSu+ZcBM3daakrC94=; b=Sgp1cWA7zLsO3hLeh1/OKOF4AlO8V6slatIT3ClXQGn63/mZyPU3r+lPnVi7K7vD27 Q/NLW8JMmoyWSYvpWnd+M5CkSZwMJJEobLWm65q2RqtypqTh/7/1kNayfLUylDkNqBnu HQS0J6CVTTUIqWnPHd0tSLfM8ni1xmdpTcuGH/tuoXGIoOytlk4ZzrdazB7+/PqS6JAG 1u+NNArvHgN4c7oO86FleBwpE1mQcJSLXa55O6DpYqhWqgUMmiavJ2SXwISEEQ6kP0Ud W7tyqwofk489FDD46JmbrQRzxsbExFfu4lXbhKx5jIw3a8Q5qq8Snr8S8wsRrPpZWrVf zwKg== X-Gm-Message-State: APjAAAXCdWjtgCC6TKZcsrxyJWETSkAgTF4jKQY2CiAL9TDujZ4mgsBK Fz3D28K8mC/Yuxq2BKvXlwln1lVzQnGI4gKpY6TWJg== X-Google-Smtp-Source: APXvYqwnzA3D8ThK9cCGBK/BzmYq4v5d7rFN05/pttcuxfyADtHv5FXkKpjxbY0XfmwC8PZzrinpcZbrLEiLLujYPQc= X-Received: by 2002:ab0:6656:: with SMTP id b22mr1456776uaq.112.1565999406050; Fri, 16 Aug 2019 16:50:06 -0700 (PDT) MIME-Version: 1.0 References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> In-Reply-To: <837e7dpkfj.fsf@gnu.org> From: Eli Barzilay Date: Sat, 17 Aug 2019 02:49:54 +0300 Message-ID: Subject: Re: bug#17507: Documentation for `add-text-property' and relatives To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, Lars Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) To clarify what I said, it sounds like a string is a tuple of the actual string *and* its properties, so it's always #("xyz" ...) where the quotes denote the raw string contents, except that when there's no properties, then you see just the "xyz" part -- but that's *not* a raw string, it just doesn't show the (empty) properties. Yet another way to show this is the fact that if you evaluate #("xyz"), the result is *displayed* as "xyz". Maybe adding some note to that effect (perhaps rephrased, to point at the fact that all strings have properties, there are no raw strings) would have resolved my original confusion. On Fri, Aug 16, 2019 at 11:46 AM Eli Zaretskii wrote: > > > From: Eli Barzilay > > Date: Fri, 16 Aug 2019 04:35:35 +0300 > > Cc: Lars Ingebrigtsen , 17507@debbugs.gnu.org > > > > In lisps you can mutate properties of an object, but you cannot change > > the pointer itself. I think that another way to clarify it would be > > to say that "foo" is actually shorthand for #("foo") but the #() is > > omitted for brevity. But at this point this is subjective enough to > > be ignorable... > > Sorry for prolonging this discussion, but I still don't think I > understand the difficulty. > > Allow me to step back a notch and look at this from a higher-level > perspective. > > In Emacs, text properties are stored separately from the text itself. > In particular, text properties of a string are not part of the string > text, they live in a separate structure, and a string only maintains a > reference to that structure. When Emacs needs to display the string, > it consults that structure and renders the string characters > accordingly. When the Lisp interpreter needs to print the string, it > prints the properties as well, to make them visible. > > It sounds like your mental model of a string was that it included the > properties, and therefore you were surprised that add-text-property > etc. appeared to modify the string by side effect. Is that what > surprised you? If so, would saying that these functions modify the > properties of a string without mutating the string itself resolve the > difficulty? -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 02:41:53 2019 Received: (at 17507) by debbugs.gnu.org; 17 Aug 2019 06:41:53 +0000 Received: from localhost ([127.0.0.1]:55281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hysPQ-0004TU-OS for submit@debbugs.gnu.org; Sat, 17 Aug 2019 02:41:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hysPO-0004TG-7R for 17507@debbugs.gnu.org; Sat, 17 Aug 2019 02:41:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hysPH-0000Nc-IF; Sat, 17 Aug 2019 02:41:43 -0400 Received: from [176.228.60.248] (port=1823 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hysPH-0004vI-22; Sat, 17 Aug 2019 02:41:43 -0400 Date: Sat, 17 Aug 2019 09:41:40 +0300 Message-Id: <83sgq0nviz.fsf@gnu.org> From: Eli Zaretskii To: Eli Barzilay In-reply-to: (message from Eli Barzilay on Sat, 17 Aug 2019 02:49:54 +0300) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eli Barzilay > Date: Sat, 17 Aug 2019 02:49:54 +0300 > Cc: Lars Ingebrigtsen , 17507@debbugs.gnu.org > > To clarify what I said, it sounds like a string is a tuple of the > actual string *and* its properties, so it's always #("xyz" ...) where > the quotes denote the raw string contents, except that when there's no > properties, then you see just the "xyz" part -- but that's *not* a raw > string, it just doesn't show the (empty) properties. That's not what the printed representation is trying to convey. It is simply trying to show you the properties, because that's useful in many situations. > Yet another way to show this is the fact that if you evaluate > #("xyz"), the result is *displayed* as "xyz". > > Maybe adding some note to that effect (perhaps rephrased, to point at > the fact that all strings have properties, there are no raw strings) > would have resolved my original confusion. I really don't see how this is related to what you originally wrote, sorry. Also, "all strings have properties" would be misleading because most strings have no properties. Can we please return to the original issue, which was the documentation of add-text-property? I don't see how the printed representation of a Lisp string is relevant to the documentation of that function (and similar functions that modify text properties of strings). Maybe that's what I'm missing, in which case please help me connect the dots. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 02:47:28 2019 Received: (at 17507) by debbugs.gnu.org; 17 Aug 2019 06:47:28 +0000 Received: from localhost ([127.0.0.1]:55285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hysUq-0004bu-FO for submit@debbugs.gnu.org; Sat, 17 Aug 2019 02:47:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hysUp-0004bi-0u for 17507@debbugs.gnu.org; Sat, 17 Aug 2019 02:47:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hysUj-0003mJ-N4; Sat, 17 Aug 2019 02:47:21 -0400 Received: from [176.228.60.248] (port=2173 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hysUj-0005El-CS; Sat, 17 Aug 2019 02:47:21 -0400 Date: Sat, 17 Aug 2019 09:47:18 +0300 Message-Id: <83pnl4nv9l.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <87sgq0q3l9.fsf@mouse.gnus.org> (message from Lars Ingebrigtsen on Fri, 16 Aug 2019 13:04:34 -0700) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> <87sgq0q3l9.fsf@mouse.gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, eli@barzilay.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Eli Barzilay , 17507@debbugs.gnu.org > Date: Fri, 16 Aug 2019 13:04:34 -0700 > > Eli Zaretskii writes: > > > In Emacs, text properties are stored separately from the text itself. > > In particular, text properties of a string are not part of the string > > text, they live in a separate structure, and a string only maintains a > > reference to that structure. > > Well, isn't that the same thing conceptually as the properties being in > the string object? It depends on your concepts. I'm trying to determine which part of the related concepts contributed to the confusion reported in the bug report. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 08:40:27 2019 Received: (at 17507) by debbugs.gnu.org; 17 Aug 2019 12:40:28 +0000 Received: from localhost ([127.0.0.1]:55396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyy0R-0000Jr-JD for submit@debbugs.gnu.org; Sat, 17 Aug 2019 08:40:27 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:42555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyy0P-0000Jb-8N for 17507@debbugs.gnu.org; Sat, 17 Aug 2019 08:40:26 -0400 Received: by mail-vs1-f65.google.com with SMTP id b187so222861vsc.9 for <17507@debbugs.gnu.org>; Sat, 17 Aug 2019 05:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=barzilay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VOVnyZ6x2z8wFb4ANWmyjX8W2B68hgoGANDFQzOV+Ss=; b=UFXngH/nzvzOBsLt9bqKHiSlSDTUgNLJGjg3zr48c9W9Sp+bsnwt70mdOyvbZGxc0H OBS4RjISOsMQ7iEvX5ryKUwVQOP9T1ie40veN64hovfBn9SfFk8avyx1BzwTOfhpX3Ga aq4O5vFgWnKGA5duFb38GRl8VhQhdijC1UG0kwBFlwMMZ1R746XtIv946t0DDCJ3HZVv fdo7ngBHDOo4XC7DvMWeUXuhdbO9a2o7HbCNQfH5AXME4n1EwY3FtjTiIQCwLUUpWQMS BzAUK2OVCZ88u4Dnt7joby4wQ22L8pXtVByXevND+nBmse+HZpyecAAMecV0Mo3pZeAn F3JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VOVnyZ6x2z8wFb4ANWmyjX8W2B68hgoGANDFQzOV+Ss=; b=jjw1tfm2d1YM9l/tH3g9xkJ8eBf/cD4+G0g9fDecDsl9aAJcgMicfgeg4143Gfoa43 MjjRgP2IXUr+D23So+AYVDgUmiWk5gmQQgQwFrsR/Jiv2R/2Ef0g+w/a9lshlZ0IQEE5 12Xz9Uo6a7nAQHYWA2j+BE4sHE2Y/xCdfAPPPG2Xi6q0pO4oBcPCadXY9J8RBKCS1Cmm eHYIQy3AZJK0sxfbXOWT2ZiG+OYQtfn0ycpASBrmxYOnBKBvpZ8eJSeZg5Unq51YX5M5 vXVL4e+iWqNqjChEuXXEf2omjqtVX0j6ZgnFI2LBINx9W03SE2v5h3QLy+kbY3VlSPpU 0Mew== X-Gm-Message-State: APjAAAVP/tYmeiE9EScssRI+SPVEMjVmLbFxiXvfh1Lt7hVFJyRclWq0 hcrvsDzToxMa4ocd7+4+sUlahfv1LEoVcD4+j8LrNg== X-Google-Smtp-Source: APXvYqymGbyrYvgn+UiemhLeMzYjVLC4Ssl0qRbtQl6V1IRou08CTggKCS0KEXLTwZr/l2orCJvNK1D+sSQxNTqL+bc= X-Received: by 2002:a67:6889:: with SMTP id d131mr861429vsc.93.1566045619439; Sat, 17 Aug 2019 05:40:19 -0700 (PDT) MIME-Version: 1.0 References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> <83sgq0nviz.fsf@gnu.org> In-Reply-To: <83sgq0nviz.fsf@gnu.org> From: Eli Barzilay Date: Sat, 17 Aug 2019 15:40:09 +0300 Message-ID: Subject: Re: bug#17507: Documentation for `add-text-property' and relatives To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, Lars Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) On Sat, Aug 17, 2019 at 9:41 AM Eli Zaretskii wrote: > > > From: Eli Barzilay > > Date: Sat, 17 Aug 2019 02:49:54 +0300 > > Cc: Lars Ingebrigtsen , 17507@debbugs.gnu.org > > > > To clarify what I said, it sounds like a string is a tuple of the > > actual string *and* its properties, so it's always #("xyz" ...) where > > the quotes denote the raw string contents, except that when there's no > > properties, then you see just the "xyz" part -- but that's *not* a raw > > string, it just doesn't show the (empty) properties. > > That's not what the printed representation is trying to convey. It is > simply trying to show you the properties, because that's useful in > many situations. > > > Yet another way to show this is the fact that if you evaluate > > #("xyz"), the result is *displayed* as "xyz". > > > > Maybe adding some note to that effect (perhaps rephrased, to point at > > the fact that all strings have properties, there are no raw strings) > > would have resolved my original confusion. > > I really don't see how this is related to what you originally wrote, > sorry. Also, "all strings have properties" would be misleading > because most strings have no properties. "All strings have a property list pointer." > Can we please return to the original issue, which was the > documentation of add-text-property? I don't see how the printed > representation of a Lisp string is relevant to the documentation of > that function (and similar functions that modify text properties of > strings). Maybe that's what I'm missing, in which case please help me > connect the dots. This is the issue: if "xyz" is a raw string in the sense that there is no plist pointer, then adding one looks confusing. But I'll just give up. -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 08:46:24 2019 Received: (at 17507) by debbugs.gnu.org; 17 Aug 2019 12:46:24 +0000 Received: from localhost ([127.0.0.1]:55400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyy6B-0000Sf-DD for submit@debbugs.gnu.org; Sat, 17 Aug 2019 08:46:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyy69-0000SO-Da for 17507@debbugs.gnu.org; Sat, 17 Aug 2019 08:46:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hyy64-0007PZ-4O; Sat, 17 Aug 2019 08:46:16 -0400 Received: from [176.228.60.248] (port=4962 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hyy63-0003Nk-FB; Sat, 17 Aug 2019 08:46:15 -0400 Date: Sat, 17 Aug 2019 15:46:13 +0300 Message-Id: <837e7cnene.fsf@gnu.org> From: Eli Zaretskii To: Eli Barzilay In-reply-to: (message from Eli Barzilay on Sat, 17 Aug 2019 15:40:09 +0300) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> <83sgq0nviz.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eli Barzilay > Date: Sat, 17 Aug 2019 15:40:09 +0300 > Cc: Lars Ingebrigtsen , 17507@debbugs.gnu.org > > But I'll just give up. Then so will I. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 18:22:17 2019 Received: (at 17507) by debbugs.gnu.org; 17 Aug 2019 22:22:17 +0000 Received: from localhost ([127.0.0.1]:57036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hz75V-0001QK-Ia for submit@debbugs.gnu.org; Sat, 17 Aug 2019 18:22:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hz75S-0001Q6-TG for 17507@debbugs.gnu.org; Sat, 17 Aug 2019 18:22:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hz75N-0006Hm-HR; Sat, 17 Aug 2019 18:22:09 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hz75M-00075x-CK; Sat, 17 Aug 2019 18:22:08 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Lars Ingebrigtsen In-Reply-To: <87sgq0q3l9.fsf@mouse.gnus.org> (message from Lars Ingebrigtsen on Fri, 16 Aug 2019 13:04:34 -0700) Subject: Re: bug#17507: Documentation for `add-text-property' and relatives References: <21365.44878.936634.958813@home.barzilay.org> <87a7cbti4n.fsf@mouse.gnus.org> <83k1beqz6f.fsf@gnu.org> <837e7dpkfj.fsf@gnu.org> <87sgq0q3l9.fsf@mouse.gnus.org> Message-Id: Date: Sat, 17 Aug 2019 18:22:08 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17507 Cc: 17507@debbugs.gnu.org, eliz@gnu.org, eli@barzilay.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Well, isn't that the same thing conceptually as the properties being in > the string object? However things are arranged internally (with a > reference to a different struct or being in the in the same struct), > from the Emacs Lisp side of thing, the string object has properties. The string object has properties. 20 years ago, that was not merely conceptually true: the tree of properties was stored in a slot in the string. I don't know whether the structure has changed since then, but the concept has not changed. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From unknown Mon Jun 23 18:30:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 Sep 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator