From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: add-face-text-property destructively modified properties Date: Sat, 12 Oct 2019 23:32:46 +0200 Message-ID: <878sppir9d.fsf@gnus.org> References: <87a7a97pml.fsf@gnus.org> <87zhi7n291.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="66324"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 12 23:33:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJP0W-000H63-Vn for ged-emacs-devel@m.gmane.org; Sat, 12 Oct 2019 23:33:01 +0200 Original-Received: from localhost ([::1]:36180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJP0V-0004gG-Qs for ged-emacs-devel@m.gmane.org; Sat, 12 Oct 2019 17:32:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJP0P-0004eT-0R for emacs-devel@gnu.org; Sat, 12 Oct 2019 17:32:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJP0N-000795-P6 for emacs-devel@gnu.org; Sat, 12 Oct 2019 17:32:52 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:35124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJP0N-00078K-HP for emacs-devel@gnu.org; Sat, 12 Oct 2019 17:32:51 -0400 Original-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 1iJP0I-0000HU-IC; Sat, 12 Oct 2019 23:32:49 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 11 Oct 2019 09:25:01 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:240934 Archived-At: Stefan Monnier writes: >> When I added add-face-text-property, it was for shr, which only uses it >> for buffers where this isn't a problem (I think...?), > > I'm pretty sure the problem can occur in buffers as well. > E.g. if you (put-text-property X Y 'face '(a b c d)) at variable places > (hence using the exact same list object as `face` property at various > places) and then use add-face-text-property on some of those places. > [ both within a given buffer and between different buffers. ] Ah, yes, that's true. Mixing and matching put-text-property with add-face-text-property could also lead to similar problems as in strings. But can `buffer-substring' give us the same problems, or are the text properties deep-copied in that case? (I've now changed add-face-text-property to be non-destructive when changing buffer face properties, too.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no