Subject: 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 19:50:31 +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 :-).

gmake -C test undo-tests
  ELC      src/undo-tests.elc
  GEN      src/undo-tests.log
Running 19 tests (2025-08-12 19:45:59+0200, selector `(not (or (tag :unstable) (tag :nativecomp)))')
Undo
   passed   1/19  undo-test-buffer-modified (0.000154 sec)
   passed   2/19  undo-test-combine-change-calls-1 (0.002497 sec)
   passed   3/19  undo-test-combine-change-calls-2 (0.002259 sec)
   passed   4/19  undo-test-combine-change-calls-3 (0.003523 sec)
Undo
   passed   5/19  undo-test-file-modified (0.002142 sec)
Undo
   passed   6/19  undo-test-marker-adjustment-moved (0.000036 sec)
Undo
   passed   7/19  undo-test-marker-adjustment-nominal (0.000037 sec)
Undo in region
   passed   8/19  undo-test-region-deletion (0.000045 sec)
Undo
Undo in region
   passed   9/19  undo-test-region-eob (0.000045 sec)
Undo in region
Undo in region
   passed  10/19  undo-test-region-example (0.000053 sec)
Undo
Undo in region
   passed  11/19  undo-test-region-mark-adjustment (0.000053 sec)
Undo in region
   passed  12/19  undo-test-region-not-most-recent (0.000038 sec)
Undo in region
   passed  13/19  undo-test-region-t-marker (0.000035 sec)
Undo
   passed  14/19  undo-test-skip-invalidated-markers (0.000083 sec)
Undo
   passed  15/19  undo-test0 (0.000069 sec)
Undo
Undo
   passed  16/19  undo-test1 (0.000045 sec)
Undo
Undo
   passed  17/19  undo-test2 (0.000047 sec)
Undo
Undo
   passed  18/19  undo-test4 (0.435426 sec)
Undo
   passed  19/19  undo-test5 (0.000120 sec)

Ran 19 tests, 19 results as expected, 0 unexpected (2025-08-12 19:46:00+0200, 0.447184 sec)