Subject: Re: bug#1501: Emacs 22 loses undo buffer

From: Eli Zaretskii <[email-masked]>
Date: Wed, 20 Oct 2021 15:05:34 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Tue, 19 Oct 2021 18:01:43 -0700
> Cc: Emerick Rogul <[email-masked]>, [email-masked],
>  Chong Yidong <[email-masked]>
> 
> +  /* Remove the `face' property to save space.  (Bug1501)  */
> +  if (!NILP (string))
> +    Fremove_list_of_text_properties (make_fixnum (0),
> +				     make_fixnum (SCHARS (string)),
> +				     CALLN (Flist, Qface),
> +				     string);

This modifies the text properties of STRING, which you don't own.

Also, it will do unnecessary non-trivial processing when undo is
turned off.

I definitely think that with the enlarged undo-limit we should leave
this obscure situation alone.  It isn't worth making such significant
low-level changes due to such obscure problems, which are arguably
cockpit errors.