GNU bug report logs - #79200
31.0.50; Duplicated elements for '#<marker at' in buffer-undo-list

Previous Next

Package: emacs;

Reported by: Óscar Fuentes <oscarfv <at> eclipso.eu>

Date: Fri, 8 Aug 2025 16:45:03 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Óscar Fuentes <oscarfv <at> eclipso.eu>
Cc: pipcet <at> protonmail.com, Helmut Eller <eller.helmut <at> gmail.com>, monnier <at> iro.umontreal.ca, Alan Mackenzie <acm <at> muc.de>, 79200 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#79200: 31.0.50; Duplicated elements for '#<marker at' in buffer-undo-list
Date: Thu, 14 Aug 2025 13:25:39 +0200
[Message part 1 (text/plain, inline)]
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> Alan Mackenzie <acm <at> muc.de> writes:
>
>> I more wonder why those limits are so low.  It's a long time since PCs'
>> RAM capacity was measured in mere megabytes.
>
> That, and then the fact that I can produce very long undo list, as long
> as they don't exceed the size in bytes limits. And these lists can
> contain a lot of markers.
>
> (defun my-test-undo-list ()
>   (interactive)
>   (with-current-buffer (get-buffer-create "undo-list-test.txt")
>     (erase-buffer)
>     (setf buffer-undo-list nil)
>     (dotimes (i 1000)
>       (dotimes (j 10)
> 	(insert "abcd")
> 	(dotimes (i 5) (point-marker))
> 	(backward-delete-char 1)
> 	(undo-boundary)
> 	(insert "\n")))
>     '(igc-collect)
>     (message "undo-list length %d (%d)" (length buffer-undo-list) n-compacted)
>     '(kill-buffer (current-buffer))))
>
> The above produces an undo list with length 80000.
>
> I think it might make sense to limit that to some reasonable number.

@Oscar: the patch below adds such a variable. My gut feeling is that
might well resolve the whole problem, without the other stuff, i.e.
applied directly to feature/igc. Sorry for the back and forth.

[0001-New-variable-undo-group-limit.patch (text/x-patch, attachment)]

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.