Subject: bug#53294: 29.0.50; Indirect font changes incorrectly affecting original buffer

From: Andrew Hyatt <[email-masked]>
Date: Sun, 16 Jan 2022 10:28:40 -0500

On Sun, Jan 16, 2022 at 05:00 PM Eli Zaretskii <[email-masked]> 
wrote: 

>> From: Andrew Hyatt <[email-masked]> Cc: [email-masked] 
>> Date: Sun, 16 Jan 2022 09:43:16 -0500  Yes, the non-nil CLONE 
>> argument is essential to reproduce. But  that just means the 
>> indirect buffer will inherit the state from  the direct buffer. 
>> It doesn't imply that changes made to the  indirect buffer's 
>> state will affect the original buffer, which is  what is 
>> happening here. 
> 
> But "inheriting" the state means the indirect buffer gets the 
> copy of the variables of the original buffer, and that is not a 
> deep copy, AFAIU. 
> 
> Stefan, any comments on this issue? 

Sorry, I may have been unclear. I'm not disagreeing - what you 
just said is correct. But, because of that, it's a bug for code to 
make an indirect buffer, then perform operations on it via setcdr 
or setf like things, which then will affect the original buffer's 
variables.

Alternatively, it'd perhaps would be a better fix to make the 
indirect buffer's copy a deep copy instead of the shallow copy it 
is now, so that these situations don't arise. I don't have a patch 
for that, though, but could create one if you thought it was a 
good idea.