From unknown Mon Jun 23 11:01:41 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#20153 <20153@debbugs.gnu.org> To: bug#20153 <20153@debbugs.gnu.org> Subject: Status: 24.4.91; destructive add-face-text-property and string deep copying Reply-To: bug#20153 <20153@debbugs.gnu.org> Date: Mon, 23 Jun 2025 18:01:41 +0000 retitle 20153 24.4.91; destructive add-face-text-property and string deep c= opying reassign 20153 emacs submitter 20153 Oleh Krehel severity 20153 minor tag 20153 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 20 08:32:52 2015 Received: (at submit) by debbugs.gnu.org; 20 Mar 2015 12:32:52 +0000 Received: from localhost ([127.0.0.1]:58859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYw6e-0004bd-9e for submit@debbugs.gnu.org; Fri, 20 Mar 2015 08:32:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37467) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYw6b-0004bN-Gs for submit@debbugs.gnu.org; Fri, 20 Mar 2015 08:32:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYw6V-00072M-9m for submit@debbugs.gnu.org; Fri, 20 Mar 2015 08:32:44 -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.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYw6V-00072I-6i for submit@debbugs.gnu.org; Fri, 20 Mar 2015 08:32:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYw6U-0007yI-5q for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 08:32:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYw6R-000711-Bn for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 08:32:42 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:37609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYw6R-00070u-5n for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 08:32:39 -0400 Received: by wixw10 with SMTP id w10so19086068wix.0 for ; Fri, 20 Mar 2015 05:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=KFi0siMjo6bwfl5YMc00DhmKQL9fO3X2YirA5dwYSa0=; b=F8lq/walk5cntbT6yem4PSmQ4fysPsSyJgPLDDiX7uDYmMAl2ekYamUzxmN9sKbi9r sgcM4WXzkkBasDUo3YbzpJsQEI+E6LfG61QuWVROOstVKDBS4/8iNw0SB1QxXu+leb4A uacEXiOgsTQ6bFBW1mICWte6rcfQLOCLmIy751GF0vLoz73eTcO5eDt9aF+a+v51qZeb KMc6FouiHOtCyOptGrX5XVse8DB09w0UnSXZEQ/a7TTGXYUIt/+QlkthZ34sJyCCSDec TYaRe087oVafnveP1V3rUFk3dSQ9x/BWgmLGxl3Ex3RVcewXtVo4MIbsfThf1Yjoz199 gTgw== X-Received: by 10.180.90.166 with SMTP id bx6mr4842510wib.65.1426854758475; Fri, 20 Mar 2015 05:32:38 -0700 (PDT) Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by mx.google.com with ESMTPSA id ax10sm6179222wjc.26.2015.03.20.05.32.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 20 Mar 2015 05:32:37 -0700 (PDT) From: Oleh Krehel To: bug-gnu-emacs@gnu.org Subject: 24.4.91; destructive add-face-text-property and string deep copying Date: Fri, 20 Mar 2015 13:28:00 +0100 Message-ID: <87bnjnyhtb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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 (----) Here's an example of what I'm trying to do: (setq test-str-1 #(";; This `is' a test" 0 3 (fontified nil face font-lock-comment-delimiter-face) 3 9 (fontified nil face font-lock-comment-face) 9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face)) 11 19 (fontified nil face font-lock-comment-face))) (setq test-str-2 (concat test-str-1)) (add-face-text-property 0 (length test-str-2) 'foobar t test-str-2) I would like to modify `test-str-2' without touching `test-str-1'. For that, I either need `add-face-text-property' to be non-destructive, either w.r.t. the string or at least w.r.t. the properties of the string, or a way to deep-copy a string. Here's the result of evaling the code above: test-str-2 ;; => #(";; This `is' a test" 0 3 (fontified nil face (font-lock-comment-delimiter-face foobar)) 3 9 (fontified nil face (font-lock-comment-face foobar)) 9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face foobar)) 11 19 (fontified nil face (font-lock-comment-face foobar))) test-str-1 ;; => #(";; This `is' a test" 0 3 (face font-lock-comment-delimiter-face fontified nil) 3 9 (face font-lock-comment-face fontified nil) 9 11 (face (font-lock-constant-face font-lock-comment-face foobar) ; <= foobar is here fontified nil) 11 19 (face font-lock-comment-face fontified nil)) As you see, `test-str-1' was modified. I'd like to know a straightforward solution to the problem itself, I'm fine with either way of implementation. Oleh From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 16 10:15:29 2017 Received: (at control) by debbugs.gnu.org; 16 Jul 2017 14:15:30 +0000 Received: from localhost ([127.0.0.1]:42554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWkKX-0000QT-PO for submit@debbugs.gnu.org; Sun, 16 Jul 2017 10:15:29 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:36524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWkKW-0000Km-GD for control@debbugs.gnu.org; Sun, 16 Jul 2017 10:15:28 -0400 Received: by mail-io0-f176.google.com with SMTP id z62so32492844ioi.3 for ; Sun, 16 Jul 2017 07:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=969d8hirthwsrG5Ypi2uo6SVRkLi/ug7LTTFXJ/8Szk=; b=L6tHxYP29HLptafl5NYBjpS+TrgR4pfhqPg542k7oVE1WvudIfCb8ea7IUrqBcZQ8J Lv6g6ssMlW9GuxZllgzkywdw+/WQG7bZ2vaajB0DU1QHd44YWdd3EKM/mVh07YOfYgel 7BAKEmjpuRNklSCbvshC2n85IXxR39IxWfVUCJZxUNrXlSR/m/XiZHwlze8zuPA5iSw8 BroYdGIc12FUN0qas3aQQ9x6uj+T/YRTx9w+FIvWPSUo3q9ipo4FPNkuyS5+0MU8QXPe DnTb8SbDwiFwB0Otg1tkoIP1Wz2vpQgLUoArbS6MfYgpOuZcrbYxcwqwv08X0AjObWZ2 KJiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=969d8hirthwsrG5Ypi2uo6SVRkLi/ug7LTTFXJ/8Szk=; b=BmupSy8RYXmLnCPl2iaTVFhIz1AU+YZ+To0C3V7Ou74p9eQi2aVsKqaCcrmzpZL49p aDZvRIbY0yQExdBjBc5unnp+2Htz/jcmcM5kSYWAVpOxoKV5PZCXeud7v9rkgbQ0ED6s armIy61AbYfjHvRx+TKyR8AXqKMMYafq2wqXWiL6zV+xgV6eFXBpaPH7ALF4grRbGwzr LyDhNlQUxVcoAO7OfdcqWGvOFPkXzDg3oEcKcKjef1pSAd4A+zZ4qTHYVegFpcj7eeq6 gj3dQA7yiWBH4IyGgEwYmpHUVwufQN5JVrkpSe96a3DXsGjKDpy5+kbD9KH71A9kKaVl OuGg== X-Gm-Message-State: AIVw110bySHlYxCk+3OjonykorEXkwAP4MApEoyQUGKnHpjlXwvo6k+1 DJ6XAlJXN8PgpOU0 X-Received: by 10.107.133.200 with SMTP id p69mr930776ioi.200.1500214522840; Sun, 16 Jul 2017 07:15:22 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l87sm7645796iod.33.2017.07.16.07.15.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jul 2017 07:15:22 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #20153 Date: Sun, 16 Jul 2017 10:16:56 -0400 Message-ID: <87fudwcvqf.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) 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: -2.1 (--) forcemerge 27433 20153 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 22:25:09 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 02:25:09 +0000 Received: from localhost ([127.0.0.1]:51749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI1f3-0000NZ-9M for submit@debbugs.gnu.org; Tue, 08 Oct 2019 22:25:09 -0400 Received: from quimby.gnus.org ([80.91.231.51]:50858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI1f2-0000NS-2d for 20153@debbugs.gnu.org; Tue, 08 Oct 2019 22:25:08 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iI1ey-0001QF-NU; Wed, 09 Oct 2019 04:25:07 +0200 From: Lars Ingebrigtsen To: Oleh Krehel Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> Date: Wed, 09 Oct 2019 04:25:04 +0200 In-Reply-To: <87bnjnyhtb.fsf@gmail.com> (Oleh Krehel's message of "Fri, 20 Mar 2015 13:28:00 +0100") Message-ID: <87a7aawt8f.fsf@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: Oleh Krehel writes: > Here's an example of what I'm trying to do: > > (setq test-str-1 > #(";; This `is' a test" > 0 3 (fontified nil face font-lock-comment-delimiter-face) > 3 9 (fontified nil face font-lock-comment-fac [...] 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: 20153 Cc: 20153@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 (-) Oleh Krehel writes: > Here's an example of what I'm trying to do: > > (setq test-str-1 > #(";; This `is' a test" > 0 3 (fontified nil face font-lock-comment-delimiter-face) > 3 9 (fontified nil face font-lock-comment-face) > 9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face)) > 11 19 (fontified nil face font-lock-comment-face))) > (setq test-str-2 (concat test-str-1)) > (add-face-text-property 0 (length test-str-2) 'foobar t test-str-2) > > I would like to modify `test-str-2' without touching `test-str-1'. > For that, I either need `add-face-text-property' to be non-destructive, > either w.r.t. the string or at least w.r.t. the properties of the > string, or a way to deep-copy a string. It's this code (in add_properties): /* The previous value is a list, so prepend (or append) the new value to this list. */ if (set_type == TEXT_PROPERTY_PREPEND) Fsetcar (this_cdr, Fcons (val1, Fcar (this_cdr))); else nconc2 (Fcar (this_cdr), list1 (val1)); But changing that would have pretty far-reaching consequences. I wonder whether instead Fadd_face_text_property should just (when called with a string parameter) just copy the `face' property list first? That should avoid the problem and not lead to any general slowdown. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 23:04:10 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 03:04:10 +0000 Received: from localhost ([127.0.0.1]:51761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI2Gn-0001Ia-T1 for submit@debbugs.gnu.org; Tue, 08 Oct 2019 23:04:10 -0400 Received: from quimby.gnus.org ([80.91.231.51]:51404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI2Gl-0001IK-Mf for 20153@debbugs.gnu.org; Tue, 08 Oct 2019 23:04:08 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iI2Gh-0001lj-JA; Wed, 09 Oct 2019 05:04:05 +0200 From: Lars Ingebrigtsen To: Oleh Krehel Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> Date: Wed, 09 Oct 2019 05:04:03 +0200 In-Reply-To: <87bnjnyhtb.fsf@gmail.com> (Oleh Krehel's message of "Fri, 20 Mar 2015 13:28:00 +0100") Message-ID: <874l0iwrfg.fsf@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: I've never really worked with the interval internals before, so I thought this was going to be easy to fix. :-/ But the problem is that copy_intervals doesn't do a "deep" copy of the text properties, [...] 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: 20153 Cc: 20153@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 (-) I've never really worked with the interval internals before, so I thought this was going to be easy to fix. :-/ But the problem is that copy_intervals doesn't do a "deep" copy of the text properties, so this has no effect, really. (Patch included for reference.) Instead I've now changed add_properties (and add_text_properties_1) to take a bool parameter to say whether they're allowed to be destructive or not, and make the add-face-text-property call that with false as the parameter if the object is a string. This fixes the test case for me and should hopefully have no measurable performance impact. diff --git a/src/textprop.c b/src/textprop.c index d36b9e14a6..dcd3284209 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1334,6 +1334,18 @@ face(s) are retained. This is done by setting the `face' property to Lisp_Object append, Lisp_Object object) { AUTO_LIST2 (properties, Qface, face); + + /* If we're adding face properties to a string, and the face + property is already a list, then copy the list first to avoid + destructively altering it. */ + if (STRINGP (object)) + { + INTERVAL copy = copy_intervals (string_intervals (object), + 0, SCHARS (object)); + set_interval_object (copy, object); + set_string_intervals (object, copy); + } + add_text_properties_1 (start, end, properties, object, (NILP (append) ? TEXT_PROPERTY_PREPEND -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 23:08:11 2019 Received: (at control) by debbugs.gnu.org; 9 Oct 2019 03:08:11 +0000 Received: from localhost ([127.0.0.1]:51774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI2Kh-0001PD-DG for submit@debbugs.gnu.org; Tue, 08 Oct 2019 23:08:11 -0400 Received: from quimby.gnus.org ([80.91.231.51]:51524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI2Kf-0001P4-GR for control@debbugs.gnu.org; Tue, 08 Oct 2019 23:08:09 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iI2Kc-0001pC-PU for control@debbugs.gnu.org; Wed, 09 Oct 2019 05:08:08 +0200 Date: Wed, 09 Oct 2019 05:08:06 +0200 Message-Id: <8736g2wr8p.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #20153 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 20153 fixed close 20153 27.1 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 20153 fixed close 20153 27.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 04:24:58 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 08:24:58 +0000 Received: from localhost ([127.0.0.1]:52086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7HG-0006fm-Ca for submit@debbugs.gnu.org; Wed, 09 Oct 2019 04:24:58 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:37243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7HF-0006fW-5h for 20153@debbugs.gnu.org; Wed, 09 Oct 2019 04:24:57 -0400 Received: by mail-pf1-f175.google.com with SMTP id y5so1144591pfo.4 for <20153@debbugs.gnu.org>; Wed, 09 Oct 2019 01:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xLD1xUQ90GPQLAC5i+HYZTyOtWK5WKvAWIRvpJwd3SE=; b=aY6jlozirtQdC70szNnr0PK1XI97NaWm8qWfvmdPxjwVcEn9AZ3XT8twt5iWJawn3U SlqrLJBjkVbd6zfigANFjJ+VhM2AdjMDV/htOF9XFpRzMUxvvXpqcXLaKSZVBO5BOCS5 F4DS68QeW8Lch0IO2T4GK8RagI49LPQx8WcoeKaOCLyYvPY62dMJdjiZ5ygat+aLCa05 l2ZSA0dOqLOaE12Y6982y9hiApsKundw7O2A764tdQ7qH5J5TdpCBprMfhpf7vjj4if2 P75bAn3ghGBghV7vULZqwCjhNEhtks87Wh670ZUhkmhNQ7qDzKaL7F6osJ+5LlETVYvn HVSA== 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=xLD1xUQ90GPQLAC5i+HYZTyOtWK5WKvAWIRvpJwd3SE=; b=uWFrJ+uJotsAJK87gW79MFtmIAV+4HE6rmTvwvMKGvk5aZgjWWn9OmpRyahaE4jUCS eB6MGz0QmCOpfkXOyjAKZqINZSriNjgP6eAf8o7epmMCIqpI/Up16p9Hzoh/W6Vvz7pD /r/UFbRPlhHodtTyt7gSirH2C4CjSjXcm8KZ56RMfB3xmgP5MkmC3xqqJ3f6bTa/9f/C qT3A6pkXa17S9I9LKOLD+/EKReY42EQ3MdevGpaJj2eE9A0Al+FmWY7R9ED1dh867czH nhVhBaiLrppi/o6la1+hjoR6wOY0N8TfhrVRvXr1SlDyaDxsz87t/S+3hz820MXy+IN2 OF7g== X-Gm-Message-State: APjAAAXZPcYvy7JftBKUlpgdbKhe4MugmoS20ZwJCixCR0jF4RmjaMLX 2r4nGWCdioAh9cBCH8AFcWoxq3ruijHaOGAwp9w= X-Google-Smtp-Source: APXvYqyBAdyF6OgVGy31IFqgYHHSulIlje7O/EjvyJLYQyC5nvMp6HKNSEsgWORsri5VJKC0qWr+4xiGJN71++5ZICk= X-Received: by 2002:a63:5918:: with SMTP id n24mr3007183pgb.362.1570609491332; Wed, 09 Oct 2019 01:24:51 -0700 (PDT) MIME-Version: 1.0 References: <87bnjnyhtb.fsf@gmail.com> <874l0iwrfg.fsf@gnus.org> In-Reply-To: <874l0iwrfg.fsf@gnus.org> From: Oleh Krehel Date: Wed, 9 Oct 2019 10:24:40 +0200 Message-ID: Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20153 Cc: 20153@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 (-) Thanks for your work, Lars. Oleh From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 13:10:52 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 17:10:52 +0000 Received: from localhost ([127.0.0.1]:53993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIFUB-0002f2-Ql for submit@debbugs.gnu.org; Wed, 09 Oct 2019 13:10:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIFUA-0002em-2B for 20153@debbugs.gnu.org; Wed, 09 Oct 2019 13:10:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iIFU4-0007dV-PU; Wed, 09 Oct 2019 13:10:44 -0400 Received: from [176.228.60.248] (port=2710 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iIFU2-0002TS-7R; Wed, 09 Oct 2019 13:10:43 -0400 Date: Wed, 09 Oct 2019 20:10:16 +0300 Message-Id: <83blupvo93.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <874l0iwrfg.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 09 Oct 2019 05:04:03 +0200) Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> <874l0iwrfg.fsf@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: 20153 Cc: 20153@debbugs.gnu.org, ohwoeowho@gmail.com 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 > Date: Wed, 09 Oct 2019 05:04:03 +0200 > Cc: 20153@debbugs.gnu.org > > Instead I've now changed add_properties (and add_text_properties_1) to > take a bool parameter to say whether they're allowed to be destructive > or not, and make the add-face-text-property call that with false as the > parameter if the object is a string. This fixes the test case for me > and should hopefully have no measurable performance impact. Isn't that a backward-incompatible change? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 13:46:03 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 17:46:03 +0000 Received: from localhost ([127.0.0.1]:54031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIG2E-0003Xy-UE for submit@debbugs.gnu.org; Wed, 09 Oct 2019 13:46:03 -0400 Received: from quimby.gnus.org ([80.91.231.51]:40042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIG2D-0003XU-CT for 20153@debbugs.gnu.org; Wed, 09 Oct 2019 13:46:01 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIG27-0002bd-6f; Wed, 09 Oct 2019 19:46:00 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> <874l0iwrfg.fsf@gnus.org> <83blupvo93.fsf@gnu.org> Date: Wed, 09 Oct 2019 19:45:54 +0200 In-Reply-To: <83blupvo93.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 09 Oct 2019 20:10:16 +0300") Message-ID: <871rvl95il.fsf@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: >> Instead I've now changed add_properties (and add_text_properties_1) to >> take a bool parameter to say whether they're allowed to be destructive >> or not, and make the add-face-text-property call [...] 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: 20153 Cc: 20153@debbugs.gnu.org, ohwoeowho@gmail.com 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: >> Instead I've now changed add_properties (and add_text_properties_1) to >> take a bool parameter to say whether they're allowed to be destructive >> or not, and make the add-face-text-property call that with false as the >> parameter if the object is a string. This fixes the test case for me >> and should hopefully have no measurable performance impact. > > Isn't that a backward-incompatible change? It is, but the previous behaviour was a bug. If you have a copy of a string and modify the copy, the original string shouldn't change. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 14:07:26 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 18:07:26 +0000 Received: from localhost ([127.0.0.1]:54054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIGMw-000455-1q for submit@debbugs.gnu.org; Wed, 09 Oct 2019 14:07:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIGMu-00044r-Mh for 20153@debbugs.gnu.org; Wed, 09 Oct 2019 14:07:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iIGMn-0000T9-UX; Wed, 09 Oct 2019 14:07:19 -0400 Received: from [176.228.60.248] (port=2394 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iIGMm-0005p5-W0; Wed, 09 Oct 2019 14:07:17 -0400 Date: Wed, 09 Oct 2019 21:06:54 +0300 Message-Id: <8336g1vlmp.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <871rvl95il.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 09 Oct 2019 19:45:54 +0200) Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> <874l0iwrfg.fsf@gnus.org> <83blupvo93.fsf@gnu.org> <871rvl95il.fsf@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: 20153 Cc: 20153@debbugs.gnu.org, ohwoeowho@gmail.com 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: ohwoeowho@gmail.com, 20153@debbugs.gnu.org > Date: Wed, 09 Oct 2019 19:45:54 +0200 > > Eli Zaretskii writes: > > >> Instead I've now changed add_properties (and add_text_properties_1) to > >> take a bool parameter to say whether they're allowed to be destructive > >> or not, and make the add-face-text-property call that with false as the > >> parameter if the object is a string. This fixes the test case for me > >> and should hopefully have no measurable performance impact. > > > > Isn't that a backward-incompatible change? > > It is, but the previous behaviour was a bug. If you have a copy of a > string and modify the copy, the original string shouldn't change. AFAIU, the string didn't change, only its plist did. Right? Please bring this up on emacs-devel, and if no one objects to the change, we should at least mention it in NEWS. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 14:09:18 2019 Received: (at 20153) by debbugs.gnu.org; 9 Oct 2019 18:09:19 +0000 Received: from localhost ([127.0.0.1]:54071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIGOk-00049B-I0 for submit@debbugs.gnu.org; Wed, 09 Oct 2019 14:09:18 -0400 Received: from quimby.gnus.org ([80.91.231.51]:40584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIGOj-000493-AT for 20153@debbugs.gnu.org; Wed, 09 Oct 2019 14:09:17 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIGOf-0002sL-W9; Wed, 09 Oct 2019 20:09:16 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#20153: 24.4.91; destructive add-face-text-property and string deep copying References: <87bnjnyhtb.fsf@gmail.com> <874l0iwrfg.fsf@gnus.org> <83blupvo93.fsf@gnu.org> <871rvl95il.fsf@gnus.org> <8336g1vlmp.fsf@gnu.org> Date: Wed, 09 Oct 2019 20:09:13 +0200 In-Reply-To: <8336g1vlmp.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 09 Oct 2019 21:06:54 +0300") Message-ID: <87eezl7pva.fsf@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: > AFAIU, the string didn't change, only its plist did. Right? Yes. 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: 20153 Cc: 20153@debbugs.gnu.org, ohwoeowho@gmail.com 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: > AFAIU, the string didn't change, only its plist did. Right? Yes. > Please bring this up on emacs-devel, and if no one objects to the > change, we should at least mention it in NEWS. Will do. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Jun 23 11:01:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Nov 2019 12:24:07 +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