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

From: Gerd Möllmann <[email-masked]>
Date: Tue, 12 Aug 2025 17:24:11 +0200

Helmut Eller <[email-masked]> writes:

> On Tue, Aug 12 2025, Gerd Möllmann wrote:
>
>> +static ptrdiff_t
>> +next_marker_id (void)
>> +{
>> +  static ptrdiff_t next = 0;
>> +  return next++;
>> +}
> [...]
>>    DUMP_FIELD_COPY (out, marker, insertion_type);
>> +  DUMP_FIELD_COPY (out, marker, id);
>> +  out->id *= -1;
>
> I wonder if we shouldn't simply dump and restore the next id counter
> (with pdumper_remember_scalar).

Yeah, I think that's better.

The above isn't correct anyway if we dump an Emacs that has a dump
loaded. In that case the marker to be dumped could have a negative id
already, and so on.