Subject: Re: bug#79200: 31.0.50; Duplicated elements for '#<marker at' in buffer-undo-list

From: Óscar Fuentes <[email-masked]>
Date: Tue, 12 Aug 2025 13:02:22 +0200

Stefan Monnier <[email-masked]> writes:

>> I still don't understand why these marker entries in the undo list are
>> made. Maybe someone else knows?
>
> The automatic update of markers is insufficiently precise when the we
> undo a text deletion, because all the markers that were anywhere within
> the deleted text end up with the same position after the deletion.
> So we have to record the offset for those markers that were in the
> middle of the deleted text such that when we re-insert the text we can
> put those markers back to where they were.

Yeah, I was suspecting that and expecting some breakage due to my
barbaric workaround.

However, the fact that still no breakage was observed makes me think
that those markers are created for a very brief use (within the
execution span of a single command, for instance.)