GNU bug report logs -
#79200
31.0.50; Duplicated elements for '#<marker at' in buffer-undo-list
Previous Next
Full log
View this message in rfc822 format
Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:
> Well, compact_undo_list is a nop with HAVE_MPS:
>
> static Lisp_Object
> compact_undo_list (Lisp_Object list)
> {
> #ifndef HAVE_MPS
> Lisp_Object tail, *prev = &list;
>
> for (tail = list; CONSP (tail); tail = XCDR (tail))
> {
> if (CONSP (XCAR (tail))
> && MARKERP (XCAR (XCAR (tail)))
> && !vectorlike_marked_p (&XMARKER (XCAR (XCAR (tail)))->header))
> *prev = XCDR (tail);
> else
> prev = xcdr_addr (tail);
> }
> #endif
> return list;
> }
>
> We still truncate undo lists, but we don't "compact" them, i.e. treat
> them as weak structures and remove markers that are referred to only in
> undo lists. Correct?
I think you are correct. buffer_step -> compact_buffer ->
truncate_undo_list, but no compact.
> The "obvious" fix would be to use a weak hash table to associate undo
> information with markers rather than keeping them in the undo
> list. However, that sounds quite hard to do, and it might make undo a
> lot more expensive.
Hm, yes that sounds hard. Hm.
Do you think we could, in compact, locally keep track of markers already
seen, and coalesce their entries somehow? My memory of the undo stuff is
pretty hazy, alas, and probably outdated, too.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.