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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Aug 2025 16:46:11 +0300

> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> From: Gerd Möllmann <[email-masked]>
> Date: Sat, 09 Aug 2025 15:18:39 +0200
> 
> Another thought: the format_mode_line_unwind is only called from
> display_mode_line (redisplay) and format-mode-line. Why does soemthing
> land in the undo list at all? DOes that make sense at all?

Because it creates a marker:

      ASET (vector, 11, build_marker (current_buffer, PT, PT_BYTE));

And then, when you delete text at point, Emacs adjusts all the
markers, and puts the relevant elements into buffer-undo-list.  So if
you have many markers there, you will have many elements in
buffer-undo-list, one element for each marker.