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

From: Gerd Möllmann <[email-masked]>
Date: Wed, 13 Aug 2025 08:39:11 +0200

Gerd Möllmann <[email-masked]> writes:

> Helmut Eller <[email-masked]> writes:
>
>> On Tue, Aug 12 2025, Gerd Möllmann wrote:
>>
>>> Like so, I think:
>>
>> I think the DEFVAR_INT is not needed. Something like this:
>>
>> static ptrdiff_t next_marker_id;
>>
>> static ptrdiff_t
>> next_marker_id (void)
>> {
>>   return next_marker_id++;
>> }
>>
>> and in syms_of_alloc
>>
>>   PDUMPER_REMEMBER_SCALAR(next_marker_id);
>>
>> should also work.
>
> That's true.
>
> I've made it a DEFVAR mainly because I wanted to be able to see it
> easily :-).
>
> Don't know if the wrap-around check in next_marker_id is really
> necessary; that's just paranoia, I guess, or maybe laziness, not wanting
> to calculate :-).

BTW, C-h v next--marker-id and 'g' to refresh is somwwhat interesting.
In my mac GUI session each 'g' shows 472 markers have been made.
Whatever that means.