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

From: Óscar Fuentes <[email-masked]>
Date: Fri, 08 Aug 2025 18:43:51 +0200

emacs -Q

write in *scratch* some lines with random words:

arins
arseina
aierni

iosrn nioni
ionugfw

sronuf

Now undo a few of those lines (C-_), move the cursor and C-_ again to
redo.

C-h v buffer-undo-list

shows a content like this:

(nil (#("sreint" 0 6 (fontified t)) . 164)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6)
     (#<marker at 164 in *scratch*> . -6) nil (#("
"
						 0 1 (fontified t))
					       . 170)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker in no buffer> . -1) nil
     (#("aor" 0 3 (fontified t)) . 171)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3)
     (#<marker at 164 in *scratch*> . -3) nil (#("
"
						 0 1 (fontified t))
					       . 174)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
     (#<marker at 164 in *scratch*> . -1)
etc.

On a long-lived session, those elements are so abundant and they are
added so fast that exhaust the capacity for undo info. On certain
circunstances, while undoing, "No further undo information" is shown
after just four undos affecting a few lines each.

On those sessions, eventually, a warning like this is displayed:

  Warning (undo): Buffer ‘blah.el’ undo info was 36040665 bytes long.
  The undo info was discarded because it exceeded `undo-outer-limit'.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.4) of 2025-08-08 built on zen
Repository revision: 12354bcfdc288f111c411c87e8bdebe6dcb41a4d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Debian GNU/Linux 13 (trixie)

Configured using:
 'configure 'CPPFLAGS=-O2 -fno-omit-frame-pointer -g3'
 --with-native-compilation --with-tree-sitter
 --without-toolkit-scroll-bars --with-x-toolkit=lucid --with-modules
 --without-imagemagick'

Configured features:
CAIRO FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBOTF
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XAW3D XDBE XIM
XPM LUCID ZLIB

Important settings:
  value of $LANG: C
  locale-coding-system: nil

Major mode: Help

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  isearch-fold-quotes-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr dabbrev emacsbug lisp-mnt message mailcap
yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc6068 epg-config gnus-util time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
cl-extra pp cl-print compile text-property-search comint subr-x ansi-osc
ansi-color ring comp-run comp-common rx thingatpt help-fns byte-opt gv
bytecomp byte-compile radix-tree help-mode cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads inotify dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty move-toolbar make-network-process
tty-child-frames native-compile emacs)

Memory information:
((conses 16 110423 18017) (symbols 48 7340 0) (strings 32 32932 3183)
 (string-bytes 1 1000000) (vectors 16 20389)
 (vector-slots 8 227284 7471) (floats 8 56 60) (intervals 56 438 16)
 (buffers 1064 12))