emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add-face-text-property destructively modified properties


From: Lars Ingebrigtsen
Subject: Re: add-face-text-property destructively modified properties
Date: Sat, 12 Oct 2019 23:32:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]