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

From: Gerd Möllmann <[email-masked]>
Date: Sun, 10 Aug 2025 17:06:12 +0200

Pip Cet <[email-masked]> writes:

> I think the Lisp part is easy: we can simply capture a backtrace and
> attach it when creating the marker.

For the markers made in C maybe one could use a trick I've used in other
situations. Something like this

1. Add paramaters to build_marker and rename it.

  Lisp_Object
  build_marker_ (struct buffer *buf, ptrdiff_t charpos, const char *file,
  int line)

2. Add a define

  #define bufer_marker(b, p) build_marker((b), (p), __FILE__, __LINE__)

3. Do something with file and line in build_marker. One could store them
   in new fields in Lisp_Marker for example, but such a change easily
   ripples through. If one does that, one could print the file an line
   in print.c for markers.

Pretty involved.