From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 08 12:44:15 2025 Received: (at submit) by debbugs.gnu.org; 8 Aug 2025 16:44:15 +0000 Received: from localhost ([127.0.0.1]:39074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukQCU-0000u5-Pq for submit@debbugs.gnu.org; Fri, 08 Aug 2025 12:44:15 -0400 Received: from lists.gnu.org ([2001:470:142::17]:51138) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukQCM-0000tI-0s for submit@debbugs.gnu.org; Fri, 08 Aug 2025 12:44:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukQCG-0001wN-4t for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2025 12:44:00 -0400 Received: from mail.eclipso.de ([217.69.254.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukQCB-0005s3-ES for bug-gnu-emacs@gnu.org; Fri, 08 Aug 2025 12:43:59 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754671432; bh=Cp0MYDzbClcqfD6Al04DPaNJDdUamNkVl50NBHyZuac=; h=From:To:Subject:Date:From; b=a0g9Mtc6/hYKhzBS0UE38jhLxPqTOjddH/lXh+EO1ZbxFtwSKaWxOtsd/0RXbwulQ 0NcudazzqHV69t1zdF1Ww0I9kIBBIlkAM7DCOCkXMbBDQJjrKQegARYb3F5gpK4uRt cur2UG00R1d/3Jf4dU7RYxs81qFj6NsYOGqgqR7kyMriEaqswX1YBmiOY38cqSimlk eiMnyUhTgENw0McHsUguepvsmu3AycLJAIay18Mr3by7WJUKIkVxvFmbOZwyyd3vdE YkClCWXKHq8uIhfYswJul3CC++NC0BXRtmJx82zSQNaJM6RuQqM8GaaeX9zhMfg2Gw qd1F4Zwfz8CeQ== To: bug-gnu-emacs@gnu.org Subject: 31.0.50; Duplicated elements for '# MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.69.254.104; envelope-from=oscarfv@eclipso.eu; helo=mail.eclipso.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) nil (#(" " 0 1 (fontified t)) . 170) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("aor" 0 3 (fontified t)) . 171) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) nil (#(" " 0 1 (fontified t)) . 174) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -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 =E2=80=98blah.el=E2=80=99 undo info was 36040665 b= ytes 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=3D-O2 -fno-omit-frame-pointer -g3' --with-native-compilation --with-tree-sitter --without-toolkit-scroll-bars --with-x-toolkit=3Dlucid --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)) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 04:29:27 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 08:29:27 +0000 Received: from localhost ([127.0.0.1]:40065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukexC-0002LN-S6 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 04:29:27 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:59900) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukex9-0002L7-4J for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 04:29:24 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3b78d337dd9so1738941f8f.3 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 01:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754728157; x=1755332957; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aOGkUxpDIcNemBuULVFrFVVMTHuOABuB7yikXjREY6w=; b=Xkbb89SCCQDqp1g6kBnyHn0MomNyOrkZqnJfeVDSCQt9NJ7prGM5An7ivB4ZnN7Thu vfGtG1jyKfP220LrDg8sEaDQyVdSg4HYYeQx6VSBsQrzPsWM+E4JMRbhPcrAb0REKS3J ZhH3NyZiigzHrxe9hgwGbA5DCZIj5xwKfn7a39Ym6aXzE+oFQJEKlIc6X17EQhgwq5+k IU2mgNvtf8gykxwdsuzb9qYvSsIfC9G73FCcrP+pKLh/A3h6rb18MpHR1zQ05p60jeTI Hafu/g9//Yvc70aR5/778f8BS42xoRVUV1+AN7x8mpiIdu/XCh8GnEf5uvDq8WYASWSo tEQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754728157; x=1755332957; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aOGkUxpDIcNemBuULVFrFVVMTHuOABuB7yikXjREY6w=; b=LrAIvZPg7+D/Dt+u35gFCOUtqx+AAk0XNCBnL6e3kcYAktROS97/9vPOZBwzmJEuJW i02KH8e1U5X2GVtFDgtKFTLlSD5u73Cz/1bjZZ74LAUYijUHHxpWrsS/gs3ymOvevj5E A0EOrCXdwKcAgqFPuXpLPY+UUC0F4iAxqqr8Lw/i9U6TTQE3dEnDtkqR5BKPsmY/0gD7 ypVfFXMaa192Gn1Zsne69+GTLXiyZqUX42oTQWt7utaisOMJxzat6yzO7f9zN9oMTN7g kpIiA1xWBtgGj+r/eUM6lLrYDF+mpRs5k00RmZ6085KGfhiSspCGVTB3FMad1JUugyAr MaRg== X-Gm-Message-State: AOJu0YyZcGOLvTI4Ic5A5T3QVcaGo9fDhmdxkonXJEBigyYpaI3UkbVN N4lRs0em9dHvIXeiKPBcOukFmwm4QJ9TSn5MWjJxxmPrCFRSMAPReoN3 X-Gm-Gg: ASbGncuUATr6hkdSlmJ83t5jZImzAsLBVk7iSXnofFY4gaOcvppdpA4HPeG2U3iGioK 3GqA59oiOZ+a1HHSldwL3S95nb1n6GKmzuMYk+/FsTCTBywOLyrJ5L/yC0XtHG6LFAJNtMgbcbw eDtLl7fpk4q7J8XKA7Tu2PVqqTi48SknizfbRkXN8FDm1E/xkTwQwSsV8Kpm19sCYJHfkhx5eay j1y78gvXfYVMzOOQK6Or98Bo9Xmyzgya2sggMMgh2RekClRJC6+ZWALh+cKKPovSv3wYxfa0Dzl aeeDEljSQFCfO0q5EokFkfSU9K/vj0NPMN8TLJaIM7QFa/pWMGeKioPulwP5663xxixVV/GlAUn dM0OhHCiZvt1sX1dDI4edn2jdeanQJbpaI/S1D2gbkYlSAbPLLiDj3mvoBcOEDzG37FanQ/Mos1 lQHirP3Ci/+Jz+6xQkSaK/jvVoXAZf X-Google-Smtp-Source: AGHT+IHav+g4VN7TR68FmJ6MQ5dGfmc08DH9RHyqZ9stCyQa7SM0jnh8+Api2aXy2LoKU21It4K54g== X-Received: by 2002:a5d:5f45:0:b0:3a5:3a03:79c1 with SMTP id ffacd0b85a97d-3b900b55170mr4280562f8f.48.1754728156484; Sat, 09 Aug 2025 01:29:16 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9eddsm33034134f8f.22.2025.08.09.01.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 01:29:16 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> Date: Sat, 09 Aug 2025 10:29:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > 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. Interesting. I come from a slightly different angle, that in my mac+igc port I had sometimes only 3 undos before I got "no more undo information". and I thought I had messed up something. My cimpler recipe is 1. Make a new buffer x.el 2. Type an a 3. undo 4. C-h v buffer-undo-list =3D>=20 Value: (nil ("a" . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (1 . 2) (t . 0)) Local in buffer x.el; global value is nil So far I can't see what is the cause. I would have guessed something in or around primitive-undo, but that hasn't changed forever. Adding Stef. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 04:55:54 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 08:55:54 +0000 Received: from localhost ([127.0.0.1]:40119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfMo-0003hR-32 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 04:55:54 -0400 Received: from mail-24417.protonmail.ch ([109.224.244.17]:45685) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfMj-0003h6-Mc for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 04:55:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754729742; x=1754988942; bh=kHiCGFyXnnVExBWDwFmb0qY3GMUu5ykSt1k4nbS6dDA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=wpvvTTrajtoQ6N+mgfQYRDeA66n3Jd9cUweBIEkcI19RzC0rRs128eTBD4BPCMksS W6DlGpJ4j2M3tIqkvmrqubzg2lA0aKxbth5nZR53NIXLttlmB9peT1W6J2Ytpojxyq J7IvMDPuvvlisztsGFJueavCWfM8uXgOOYoiv28NXftRatA9zUejPR29zAn7cjrtmQ gpPRtarZibTLaYzLvoZsYnDpDgS5m0G5KfPxcuisVqQPCtqNwjROP21oEO51vwPktr ykBGG1vKNOBguYAyTthn1jxVcVdlbSXQzlbacmoaZuYJSI+GHvUGVAjeezcvIpdBaX ovwi9gVny5JMg== Date: Sat, 09 Aug 2025 08:55:38 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: References: <87h5yhu5ko.fsf@telefonica.net> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 5c45ad5a614ad09fec3b46c24cbed380ad681b0e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?=C3=93scar_Fuentes?= , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > =C3=93scar Fuentes writes: > >> 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. > > Interesting. I come from a slightly different angle, that in my mac+igc > port I had sometimes only 3 undos before I got "no more undo > information". and I thought I had messed up something. > > My cimpler recipe is > > 1. Make a new buffer x.el > 2. Type an a > 3. undo > 4. C-h v buffer-undo-list > > =3D> > > Value: > (nil ("a" . 1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) nil (1 . 2) (t . 0)) > Local in buffer x.el; global value is nil Hmm. I'm seeing different results: "only" five markers between "a" insertions. > So far I can't see what is the cause. I would have guessed something in > or around primitive-undo, but that hasn't changed forever. > > Adding Stef. 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 =3D &list; for (tail =3D list; CONSP (tail); tail =3D XCDR (tail)) { if (CONSP (XCAR (tail)) =09 && MARKERP (XCAR (XCAR (tail))) =09 && !vectorlike_marked_p (&XMARKER (XCAR (XCAR (tail)))->header)) =09*prev =3D XCDR (tail); else =09prev =3D 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? 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. Pip From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:01:52 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:01:52 +0000 Received: from localhost ([127.0.0.1]:40129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfSa-0003z0-Bk for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:01:52 -0400 Received: from mail.eclipso.de ([217.69.254.104]:36088) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfSV-0003yb-BM for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:01:50 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754730098; bh=EyhDFmOD/DsmcHqpUEjpzJqIP4q+DtomGit1U1ktvgg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a/dLaoko+XEqXa21EcZ47xAh8I9iZ4BdYuOBZeLMYpsRxc+Wpvdo4hgPl5H2xLhGf 70bzNBgojRc+qt92gRf485iGXyuTGAWvFUKtTtw21aE3lPRvfmoItDzpFcmzh1yJmd KQWjZHl9+l34Uo6XYKIfqGVXa4ChEjQWRV/+9YCmDaVH77caDq7T9HOjnZjvw6S7V0 CNX/NRc0r0wGvNX0Sz5tvkT2cI+Z8cvTu4U/asMPf1Um5B87091FCmVN6tsDxR4SVZ 2QImvsEBErygfxnvOaelhaKoc93OkA/jXxNSW5E55XZ3FT+J6aykNZ7Xzzf/d859nj 9DdIAPnM7BITw== To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> Date: Sat, 09 Aug 2025 11:01:37 +0200 Message-ID: <87cy94uavi.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: > =C3=93scar Fuentes writes: > >> 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. > > Interesting. I come from a slightly different angle, that in my mac+igc > port I had sometimes only 3 undos before I got "no more undo > information". and I thought I had messed up something. Same here, but igc/Linux. Please note that the recipe on my report is with yesterday's master, though. > My cimpler recipe is > > 1. Make a new buffer x.el > 2. Type an a > 3. undo > 4. C-h v buffer-undo-list > > =3D>=20 > > Value: > (nil ("a" . 1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) nil (1 . 2) (t . 0)) > Local in buffer x.el; global value is nil I can't reproduce this with my master's build: emacs -Q x.el type an a undo C-h v buffer-undo-list Its value is (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) nil (1 . 2) (t . -1)) Local in buffer x.el; global value is nil However, doing the same with my igc build of 1 of August yields this: Its value is (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) (# . -1) (# . -1) nil (1 . 2) (t . -1)) Local in buffer x.el; global value is nil > So far I can't see what is the cause. I would have guessed something in > or around primitive-undo, but that hasn't changed forever. Eli in emacs-devel pointed to the possibility that something is creating lots of markers. Checking if those repeated elements in buffer-undo-list point to the same marker or to different ones would be revealing. Or not: I don't even know if getting markers to the same place in a buffer yield the same object or new ones. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:02:07 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:02:07 +0000 Received: from localhost ([127.0.0.1]:40133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfSo-0003zu-Ol for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:02:06 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:61798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukfSm-0003zG-91 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:02:05 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3b792b0b829so2788514f8f.3 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 02:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754730118; x=1755334918; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xOnfLs0kzSTLedFg5Btd+r5zXshRJU5YbOX1PpxUN8A=; b=IRyV1U1SsCuaM5/GhskfIGAS7AK73u7QDZOyvpPjjG1z5vt3WPurPrrSpB1yx5VmaV //F91lMgvwwLK4Ah0G/VH6PV4KMukiX0g5fJ05IMuc6qAjFZs4U/gpUtPf9vlnYQUpkZ lsF/R1rwiZY4rCORK1AKNnG66oCVXQom6/1JvEwx+hH6YAFbwo0WcjzGFpDNNgp/+pn2 P5JhxJjw+Btaic1+io96APCK5UpQoshaBKWcU42kzLXsujYxd5EiVWcCrNCpHNgfkdi0 WlDaH1IrqvWxmLzv2JVXHdSeN9Ig4E5TvzccAsczk2Hw+1+qXadYtMHfEEPyQgV9qyhx CEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754730118; x=1755334918; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xOnfLs0kzSTLedFg5Btd+r5zXshRJU5YbOX1PpxUN8A=; b=bK2b4JKbs0D007UuZNj4jvptBaKPUuuz145BxmXGRY2bjqH9Ysp56IDQPW0P4CMKyZ oQ/bOhWtT+xEzw4Aaabcu02LquCKx4+EVD3CX569lZmqzSkDj1VvxNZDw3ueLsJNilgi yil6sITU0656jM0RiXqzwQQtWPIA+NuPSuYxWMD5VQ1QY8g2QQ3afm5xTxqZ7zYHyDfL PZsoK3DI5aFCLZngdIdjc2BrMV9cXQg/Q33OLa9eIqVeDWbjNJAmfkef7DG8BfJZhWbN DzOe52ufToDp+gNOWRcSaZN+HDbJHppyvc3cgphznMqabkaQZYIt/gGMJCpxUDORGr7C /iKw== X-Forwarded-Encrypted: i=1; AJvYcCUoa5sHBsQDOylTA0uvRfJN+86yf8dVuc2PscUMN9ndoZlOhFp67rN+Xdjjxf9ENoHu0JwHow==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxbnxOhJ1so/szP2fEPiaLm9MdnatcvD+s1s2EyKzd4V03HRYJu aKYQqitB8/ZtAT2VDP+p6GXzOhTUu2skgeyPts8y6BdWXKfrd15dOe1W X-Gm-Gg: ASbGncvCvYQsWDz0cgBVJn28O5+G7gM4tGXxLc8wJiYHY2ybw8xjx9JqIQK1U/NpOCU wMyv2Hr0L0nA9bffr3qpa1ZLTjEelsy5ZzRvFcmfoQNhUSV2VYUfiaJZN0m706de63n1x0ptiZT ajZNi1EPM7cg7vF2XBXHziBgL4jvcrsLi41Bk6fTUQXjNtBlBaC5dDyEK0Id7GAf5EySNzsGCNS Q79DowFNYSnsf7sTC9PB26G2tXTLSdmcqZHg21heopJcW4U3iREAfTR3dpCMTxOjE82mOyYpM7s bNPYskQZ2boXB8lnJo/VQnJDyHRfSLYYSbIlBZflReWInottlXfrQCnMIOxC8ZsP0DhPYnpQ+Lb YrcB9wBpcdz0ojrHpUZGndF0K/9SmlAGNrU0kTm5D0QPP6mEGodO3aO+URoy/0ZhT67wNl3XlB7 UzX0TV9uRaXvq0KCrluiCkNV2tpqp+Lphq2G9dCUY= X-Google-Smtp-Source: AGHT+IET5wo8RvKkKuih5EvmgrnOyzHGWTPwqVAgxf+L8HNUg+8EI752s3ogWfP8pxhmJtvW9aZsYQ== X-Received: by 2002:a05:6000:2408:b0:3b8:d1d9:70ba with SMTP id ffacd0b85a97d-3b900b7517dmr4671247f8f.32.1754730117568; Sat, 09 Aug 2025 02:01:57 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9c7dsm32928788f8f.26.2025.08.09.02.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 02:01:57 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> Date: Sat, 09 Aug 2025 11:01:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pip Cet writes: > insertions. > >> So far I can't see what is the cause. I would have guessed something in >> or around primitive-undo, but that hasn't changed forever. >> >> Adding Stef. > > Well, compact_undo_list is a nop with HAVE_MPS: Sorry, I forgot to mention an important detail: this happens in master but not emacs-30. Oscar's report is also for master, IIRC. Really puzzling. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:15:02 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:15:02 +0000 Received: from localhost ([127.0.0.1]:40146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukffJ-0004YA-Tg for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:15:02 -0400 Received: from mail.eclipso.de ([217.69.254.104]:40446) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukffF-0004XW-II for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:14:59 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754730890; bh=8B3bA5k/WvlCG+MXIGLkaSDEDsrXLhJAL02M5oMUyPQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Sf56uV04T/cDDiYARpK1MbTFlMLnPW9LFPZLfpAdrAAdwxWarAYMf6/YPlcsFXaQ+ XKZ41S1gKt8L+DF82gf4aGEfHI6hDU3V4Oi2nlqc9H2TO/JvDayZu94jRWZNp9TLCT 9nGtwnr15Y/opBkoUSmQZGXSx/WmHD8+3ztCePtK8LTWD7Sspj5viptmyGIvvl9Prv +SGpQQ/jcsApkeUrUa/gpI8u72gnoeCl5gfURDjETfGS1axRBrZrCInmu88g8KWunG F7pnIgpvAQ6RHlvmAgaPSmh47sowvk1qlYiFoqPGQdrvGFcgeDFoRuTVzWhZRAWAQ8 V2oiaF2voWDug== To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> Date: Sat, 09 Aug 2025 11:14:48 +0200 Message-ID: <878qjsua9j.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: > Pip Cet writes: > >> insertions. >> >>> So far I can't see what is the cause. I would have guessed something in >>> or around primitive-undo, but that hasn't changed forever. >>> >>> Adding Stef. >> >> Well, compact_undo_list is a nop with HAVE_MPS: > > Sorry, I forgot to mention an important detail: this happens in master > but not emacs-30. Oscar's report is also for master, IIRC. > > Really puzzling. However, it seems that on igc it is more easily reproducible. For a moment I thought that I messed up my bug report, because a couple of attempts at reproducing the problem on master failed, but then I made a few more undos/redos and the sequences of duplicated elements appeared. Something triggers this and then explodes. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:15:03 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:15:03 +0000 Received: from localhost ([127.0.0.1]:40148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukffK-0004YL-IB for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:15:03 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:58497) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukffG-0004Xd-Uu for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:14:59 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-459ddf83023so17490245e9.0 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 02:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754730892; x=1755335692; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3KXEAyZcfFKDYYm8v+P8Z4tzw+xlM4/WGzhPimJXE8c=; b=ckiOVdsPh+sLssvXrzk6q47zYhsj/M6bQch5/4gf800Z/ucBvqBm6UZbB7rwNy27kF 8hY7SxX6zb3/UAqDJdvS4zRTL2P5H96SE32kDVBF1FdSzosESALlU6sC0Z5SWeqNrNRw iPzQ+kJvbXRMp8v2vmbS96NpRtHl9TvPb80QRdsImOIT9VgFV2CK5/4l8wsfGQ3z425J PQ+zQGjTJKhzRissAdeX5xmcbV4raFw5D3IHHEP9+IOaqCQExUxDKVSkQ+BSqXJ+OdgZ fFevsOjy6ed/bR8KgpeNyBxO6j7JocIp12dxME8W3eZ6KoS16Cur70/GT8/ot+jREiC0 EdwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754730892; x=1755335692; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3KXEAyZcfFKDYYm8v+P8Z4tzw+xlM4/WGzhPimJXE8c=; b=Np85v3e3wp2T3io4aScRzebWgFVz40m5w1U/G9o0FcgKzE8CX2vtAyR3Hkdl1yUbs2 ScdJtoCPil2TZg7uTyJZPK/0fijTq44HViY+h0WkYJAmcrvGUytd9ZRJA5cQrgoxjNsI IXXivQLrgRmvgBsqM3hqiTRr6FqT2fUr3kSR8QivtoewxHH96b/GFA9NShHa3nOjZeiU rJWZy2zMy5uBmm4g3PpRBdKbzYlpkJjXuyrKcNKahR/5Q6GXxYpbpS6kW/N6BVslYg/B oXWuB73YLRh9A0/UFs+kP0XJxA7n1w9NojiZ/bMYImUzR1Z5S1im19rDWT9w4DlVhTf5 EltQ== X-Gm-Message-State: AOJu0YxixP+WYz3pB3RvXNBD4C6TyNyB7AHj1QN1ICQIJMhSnBCJybdH 1T+p3ZjWzCnF4L12Eu9QkjZ66C8KxJEQ/kiRvRNU7OgyHs+ptKlm0xee X-Gm-Gg: ASbGncsFcWJL7S+RZx1mvJj/GiZEF35JGo8sReAxbetmVPKk7//hvvhxPKcXx5r2fmz lGKnV4m+zn+lwb42oXG5h8IG1nK7hBvwOBK4M+l//CfBaKgzv0c+0YYdkJNfElefOZ+JcDgzABT K8ZEzp5XKo0RHfws5DYkwfu8NVQmcl3yjAYxnNvoqNLEsBjPgFsft5YSD59UtVnPV8APCzCg8h0 RTJ0Lnphc4e2zdUIe2cO1sNwpRW0N7HQvfG/f/KEMGnklMTX4w8e0Y+GdLDHBx0nuFdLAsoBrgo YBmbAl+ewkTo3AH9AG3rAtRH/ZpIdP5Uy4QKe/7t6L4PmQrqZtxrputDMgtoGfEEd+6VWjtFUrc cvPQR1MxElHD8ObdkVFFPkrIqL3pb9rtQzmdTKpulwNzYSNbbULfFLzMWmXnauw2EaxBI4QvCSK wvwelRUln1h9x6uw2NAlUN6fLIWfw/rwsTQG3KaUc= X-Google-Smtp-Source: AGHT+IFQexBdYQBt9vJAq2vYlUtbFT5vlwj3v7/KoH3NdJcYpQmnifEV9B6qGzwj1NtRDbEVTYsUAg== X-Received: by 2002:a05:600c:c1d7:20b0:459:e440:61c7 with SMTP id 5b1f17b1804b1-459f4f3b4b1mr37701385e9.31.1754730892165; Sat, 09 Aug 2025 02:14:52 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459db3048bdsm261835235e9.29.2025.08.09.02.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 02:14:51 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87cy94uavi.fsf@telefonica.net> Date: Sat, 09 Aug 2025 11:14:50 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > >> =C3=93scar Fuentes writes: >> >>> 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. >> >> Interesting. I come from a slightly different angle, that in my mac+igc >> port I had sometimes only 3 undos before I got "no more undo >> information". and I thought I had messed up something. > > Same here, but igc/Linux. Please note that the recipe on my report is > with yesterday's master, though. > >> My cimpler recipe is >> >> 1. Make a new buffer x.el >> 2. Type an a >> 3. undo >> 4. C-h v buffer-undo-list >> >> =3D>=20 >> >> Value: >> (nil ("a" . 1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) nil (1 . 2) (t . 0)) >> Local in buffer x.el; global value is nil > > I can't reproduce this with my master's build: > > emacs -Q x.el > > type an a > > undo > > C-h v buffer-undo-list > > Its value is > (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) nil > (1 . 2) (t . -1)) > Local in buffer x.el; global value is nil > > However, doing the same with my igc build of 1 of August yields this: > > Its value is > (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) > (# . -1) (# . -1) nil > (1 . 2) (t . -1)) > Local in buffer x.el; global value is nil Now I'm completely confused. Your report had 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 but it's not happending in master? And I think, if didn't make a cockpit error, I tested that with master. Have to check this later, though. > > >> So far I can't see what is the cause. I would have guessed something in >> or around primitive-undo, but that hasn't changed forever. > > Eli in emacs-devel pointed to the possibility that something is creating > lots of markers. Checking if those repeated elements in buffer-undo-list > point to the same marker or to different ones would be revealing. Or > not: I don't even know if getting markers to the same place in a buffer > yield the same object or new ones. Hm.=20 From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:18:15 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:18:15 +0000 Received: from localhost ([127.0.0.1]:40158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfiR-0004kF-11 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:18:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44992) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfiP-0004jz-FK for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:18:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukfiI-0001Tq-Su; Sat, 09 Aug 2025 05:18:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5skIi/6dFwj4SWwTJLeuNVnLE5Pl+JomUitztsiaVYc=; b=Rbjd97gaulO0N0pGtTnw mRtlqFQxMHXLwwee5kEvMPndb+rC9xoJ/dmtgCOciIbqaRVswD1qSkEqtheqcQ2qwDCGQrM8EJX3D lhgahR0vzGn3Vx1fN90IyYazbzwtZVXBmRyl1FdROyO26ix9A8n0iZhc+WH4iR81BZoFGnRbFdOhY g1+OUq82Arm0tZZ7uJ7d4L1vaVdJWFANE6G5WPf+l8Y7trjLMdRiq8opbJqwXz6N1osiuAyYoSOwv AJtOUDeHTHmokyIZrscy3r2g3DqcJeXoZyb3kl8C7mCIpVPlvzygtDwXlQhPdwLleao/ixD8FerZ4 qsPe4LkDgoGLsQ==; Date: Sat, 09 Aug 2025 12:18:03 +0300 Message-Id: <86ikiwn99w.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?=C3=93scar?= Fuentes In-Reply-To: <87h5yhu5ko.fsf@telefonica.net> (bug-gnu-emacs@gnu.org) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 08 Aug 2025 18:43:51 +0200 > From: Óscar Fuentes via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > 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) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) > (# . -6) nil (#(" > " > 0 1 (fontified t)) > . 170) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) nil > (#("aor" 0 3 (fontified t)) . 171) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) > (# . -3) nil (#(" > " > 0 1 (fontified t)) > . 174) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -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'. Your bug report says this is on master branch: > 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 But I can only reproduce this on the igc branch. On master, I see a single entry for marker adjustment, not many identical ones. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:18:19 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:18:19 +0000 Received: from localhost ([127.0.0.1]:40161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfiU-0004kW-HO for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:18:18 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:50683) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukfiS-0004k2-11 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:18:16 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3b79bd3b1f7so1385136f8f.1 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 02:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754731090; x=1755335890; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DAxeVkHk9san8UIHIP5WXVRA/qC81PeBj4msOxTe8vM=; b=Y7k2gqr+nqoTSxVOVgVR5jYuiRnevBdAT7mD7BNeLiRu0vLITGGKd3636GeXWem45L PJe+AHLwW1GJVgBKuPYqLXc34mSFV9ivMVlr4nrIODDLRXfJ2FyF1S7ggjwMLGI5B0J5 Z4DxYNi9s6nM40sVbXbze8K/rbFmxgyAG9UA0v0o6Je6nPetfMOsgy9IBWyhwQ0n+F0a zWlXW6KrltNrFnrPcEugLtmGuobKfPz9bWp9klivMGqmLDic5EunSJM1XJp0l4IJR69C pZ7f3yRM79rZXubNq2wCKb6HiLCSQ4rCFk93t96oQGYNQeVTXrKKubL/xuBj142KLqZI Po+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754731090; x=1755335890; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DAxeVkHk9san8UIHIP5WXVRA/qC81PeBj4msOxTe8vM=; b=TPsYoi2ZZ/K3KV5mWM86ziIxfH3SfOcxiWZXdF6TKgT3GuQGU5GWneZSrH9whSIZEb F5z5IRn1A6qmVDekrxFw1YpH2nDZlNBZeJk9ZWuaOUdN+ZlMNqpUKcuUkL7Q9QRKyeYC Hi2XNndDbLidoV3o1ng3ORTMmCf0HgYAFgkxbtTFJfAjY+fGQBh9l4EieWhFjBy0fmwS +oWCYFEGz5Gxh90GNMzIonR9L4eaDGBx+WsM7qeIOPcvu1dIJx2DoG6ykSMBAaNlocZF P+hlStChoV2sUtDI1mYo2YF0f8+GQhsBeSVuPgB9k4nSR2W1mY4SrJo0kf18Hj6GIx2b P8Aw== X-Forwarded-Encrypted: i=1; AJvYcCW/ubn0r71xNUkG3SipSN4Qay4+5BiNJsEK++fb78IiTdbTAHve+zVZ8xrAxjtNsGHBSFISZQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxmdx0+AcDz8vzUkgz7xbk6OQMNJytoymm6GPmaM3RuTwCb3mPH O9TcA2vZ0zb+xa64SNVzfjWVK2WJbrblVyjk2kIdkpeiBk9wEcwVj/kM X-Gm-Gg: ASbGncv4CW5HMi0JEMLggOstaV4xQbTmHLiF0Yv3lvtesyXZF484Wc3huVTasGsaNrg /EBzhXTFVYmnFCVd9F+X+El+x2hwaJgzhoHHwBtAkYb44GB+zvKlbm+jO+YHy9zOm7hSQrQzUao ll8yx+tyMXTMzBs1KdWSwV/8xExjKYNN+IUfz4a5tIvH3tfy1QiPtiF8yCEkudXRIbXZxMAxbS9 4ZYb+MwhvVdn41TMuShDcqiXCbqo1QunyCRjwiPudickFbB+n7rGeZbVwlzC1601/bqxed5Fkn+ FbGTVk6s8y0z+n7yw0knlKS9DByb3BCBXCkD0YpmwkAWRJVLBgvqHKzqV45cggKVtZaYOXWdaxM C9xuuA4ObDvzcQSaSYeDkyQSMEtod3y1sdH2zCaQ7Mr1GjqcFtVVBeOBO74GHGCsBsSsewloVu2 p8pY2uxFknbJ8rmiBSw+V2mpN1lWcU X-Google-Smtp-Source: AGHT+IEMDQbY/LGDjX5G7vvp7CJM1/oMVuYhMqPhge/5sfcxOb4U5isRWMPmXT8Jgdc8Wa61WWfu9A== X-Received: by 2002:a05:6000:220c:b0:3b7:9dde:2c2 with SMTP id ffacd0b85a97d-3b900b55f2bmr4583933f8f.48.1754731089585; Sat, 09 Aug 2025 02:18:09 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b8f5d7deaasm12337014f8f.65.2025.08.09.02.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 02:18:09 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <878qjsua9j.fsf@telefonica.net> Date: Sat, 09 Aug 2025 11:18:08 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > >> Pip Cet writes: >> >>> insertions. >>> >>>> So far I can't see what is the cause. I would have guessed something in >>>> or around primitive-undo, but that hasn't changed forever. >>>> >>>> Adding Stef. >>> >>> Well, compact_undo_list is a nop with HAVE_MPS: >> >> Sorry, I forgot to mention an important detail: this happens in master >> but not emacs-30. Oscar's report is also for master, IIRC. >> >> Really puzzling. > > However, it seems that on igc it is more easily reproducible. > > For a moment I thought that I messed up my bug report, because a couple > of attempts at reproducing the problem on master failed, but then I made > a few more undos/redos and the sequences of duplicated elements > appeared. > > Something triggers this and then explodes. Okay, thanks. At least I don't have to check if I made a cockpit error :-). But I guess I have to check emacs-30 again, if this is kind of "random". From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:20:03 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:20:04 +0000 Received: from localhost ([127.0.0.1]:40168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfkB-0004om-GJ for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34506) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfk9-0004nV-Bi for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:20:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukfk2-0001eH-W7; Sat, 09 Aug 2025 05:19:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=A93riiv1PX5XVOa9eez8C1ypepjhyKGF4s52Z0j/yvk=; b=gtlWqugJy/gLGrlCdp8T Nha5ipDMrjuMQUxtOEEsVijvqZnT9EquhopJgyRMN+JZ2TUhRwaRE/AqJG1Y549PnVJcYhO8t8o2o RWIfrU5xGBDehmJ62eKD+4ySyfOdbCiu2SDSFjfRv641QvyQDo49DirlfypZFqTynDwPk+niDpNi/ SOaJlcovVabjWmZIOEf+QqgrtC5Zu/rOh87ULszNDsKxLo2ll7oRgLEmeJK0RoAugnwplMfxzdcXY gYoMNq5fmslieMrxY6OB8oCPzq9i4+rKb47klzQOCp1ww3dWfTGeGrRGRxiAjkZe1ykKpt3Hf51Hl 3mXq8NDmdEcmjg==; Date: Sat, 09 Aug 2025 12:19:51 +0300 Message-Id: <86h5ygn96w.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?=C3=93scar?= Fuentes In-Reply-To: <87cy94uavi.fsf@telefonica.net> (bug-gnu-emacs@gnu.org) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87cy94uavi.fsf@telefonica.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: gerd.moellmann@gmail.com, 79200@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 79200@debbugs.gnu.org, Stefan Monnier > Date: Sat, 09 Aug 2025 11:01:37 +0200 > From: Óscar Fuentes via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Gerd Möllmann writes: > > > Óscar Fuentes writes: > > > >> 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. > > > > Interesting. I come from a slightly different angle, that in my mac+igc > > port I had sometimes only 3 undos before I got "no more undo > > information". and I thought I had messed up something. > > Same here, but igc/Linux. Please note that the recipe on my report is > with yesterday's master, though. I cannot reproduce on master. Maybe you should try invoking GC there before you look at the value of buffer-undo-list. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:21:17 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:21:17 +0000 Received: from localhost ([127.0.0.1]:40175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukflN-0004wR-38 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:21:17 -0400 Received: from mail-10629.protonmail.ch ([79.135.106.29]:45147) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukflK-0004wC-QD for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754731268; x=1754990468; bh=cWkG3cz4cLhO6y5ksPLD9FqzyIDdQYVhRn/qoUiiYkM=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=HMIVqJPpGhyxJzWQhXzAa6beTC9Eg/H1IYYKVVyIlmmK+rm8cVO+SxXWnKKfOaXVq ejxBE4kYe4NS1qWuXxmxsrKZVsq8joGyMP53lu8KARVfVDBbPjEMVNrqUw2hnVBM4J wyTXagUVlKP+zVnHFsPOzgzST1MMCptY2n11gBXv0FIlWV3j3igbuygc6qVPLYvzFs S9Vjxo/yRpvrnqolWu8bN/s48pNpxODLWn1cSqNyXggVhbEooTngxge38FpWz6P0tj +AepWZ0RFdsvsdxWjaBjM2lV40M3hO4W7EePvGUfeeeDl2P8Z26aJV65PK9dqFVGPb 68Uz037EQfIPQ== Date: Sat, 09 Aug 2025 09:21:04 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= , =?utf-8?Q?=C3=93scar_Fuentes?= , 79200@debbugs.gnu.org, Stefan Monnier From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: <87cy94uavi.fsf@telefonica.net> References: <87h5yhu5ko.fsf@telefonica.net> <87cy94uavi.fsf@telefonica.net> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 866921cce6f0ded1c5b2af11108a025b4c9270e7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes via "Bug reports for GNU Emacs, the Swiss army knife of = text editors" writes: > Gerd M=C3=B6llmann writes: > >> =C3=93scar Fuentes writes: >> >>> 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. >> >> Interesting. I come from a slightly different angle, that in my mac+igc >> port I had sometimes only 3 undos before I got "no more undo >> information". and I thought I had messed up something. > > Same here, but igc/Linux. Please note that the recipe on my report is > with yesterday's master, though. If there's a problem with master, we should fix that first :-) However, one reason that results may be somewhat unpredictable is that buffer-undo-list can change when GC is triggered (on master): marker entries don't prevent the marker from being collected and the list entries are removed in that case. >> So far I can't see what is the cause. I would have guessed something in >> or around primitive-undo, but that hasn't changed forever. > > Eli in emacs-devel pointed to the possibility that something is creating > lots of markers. Checking if those repeated elements in buffer-undo-list > point to the same marker or to different ones would be revealing. Calling sxhash-eq is probably the quickest way to establish whether two markers are eq. If the same marker turned up twice in the same section of an undo list, that would be a bug somewhere: (dolist (el buffer-undo-list) (and (consp el) (markerp (car el)) (message "%S %S" (car el) (sxhash-eq (car el))))) > Or not: I don't even know if getting markers to the same place in a > buffer yield the same object or new ones. New ones, in general. Pip From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:23:09 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:23:09 +0000 Received: from localhost ([127.0.0.1]:40180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfnA-000509-PI for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:23:09 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:50211) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukfn7-0004zI-M0 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:23:06 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3b79bddd604so1618040f8f.0 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 02:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754731379; x=1755336179; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EBpTLwvzpLk9lazrqdhiVwu+5BTV0tnQogtfCsZr5Ns=; b=RFflA922Woccbu3lSf+FZscRStfcmVa/KJ9Kig8Q1TnwMqgLMrzvgY4b8cKk8Cn02Y aFfwokwJuGMW4S0QS+UXi0TCZWv0AGlxRBzYzmJv0aVxWyP/yq5hJX1Ubwqq8zqPxK1G DKYl23yEEp124zuKdHeWiMkYIrrHQUt37Dlp3vsKOXHWJ0EaS3+jViFuhCIczAAmzcvo j9NS6I2P0y1SQx8Bm6Hbv1LgWIXKhsdqd2z2JykDO8sNOJL+Sx2vZWhzE2Y0j4uK4yeU W3k+gjWmthmy6zQOse2L+rwlrGsuSf2fFefPtqbJ4aS11ejkESAHe7OZ+O5xxiVPSu4T Dxlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754731379; x=1755336179; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EBpTLwvzpLk9lazrqdhiVwu+5BTV0tnQogtfCsZr5Ns=; b=q7bXdQgMFuxsuvbKfTfpAekfrz8jzMv3fGmyl9t+jKxhKCZykDKLTANygqrzyiWxSI j/H2CfFSPgmy3c5y8I1yvZOCmKOoGcNoeD7sMkAxskkhVPxtrloNUSYvkKbczuXAW74H IsXveOiqmMpkxtbVhvu9lyUJJo2HYwsy7HX7AOS/YuX/zAwmLm+QJMJZpJKpkZkX4HDO +ZOJyNwiUKeiRh9Ju7ymQMD3/iu8qMqtyRzGPchlIEEp8defT3SolhfhSGk42cOA0TgB a+ZCxZ65pa2Ay6cBQeUGInokoTiFFSLKHu+T7kAygDH5Za2NBFBtKYN+PA8bQaxfosP6 +/mA== X-Forwarded-Encrypted: i=1; AJvYcCXkizhY11Jal34vA2H5+GI4TJEETnbzrmY9baorYRulm5Laq9gFc70jYGQL5TCTLcaOf0s9wQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YypzV47WPQmpl7p+ZkdtbcWFFerrLvS5Bp4MPK1hzgU9l5e27F0 ybiF2D6oW2pP7zz58fibM67b2LgHX6IhlNxpeHaLGHaXtewZ8GczB0xf X-Gm-Gg: ASbGnct5zTd2DnERKnuTa5pguQbowtikHPB/Xt0Z8PskVNfcn9gLerQfh2DqHRZwjGf dB53URvgpooxXxMG0gqJVPxgKEEOSK7X5dUTXoxou3qjTyGvot3lbI3yUnKLLA97iMFyioRzBU1 U8m5vNKLJKxVqQ6uhI4UUxwheJo7fahx03CVrpJNXHO4vuNVFwBDQCXlZHezTlBSL4n8Nb6g9vJ vYikSigMiSXdA4/RlmeojBJ1GaAzpq6IRtKJlIGXRjy8H4qAT8d1pz9QQPLcE8aB1/OIOiov0+I RwodGUTVZUi60frocwa7cz0tymt5eQ+S6FS7HHTVcHoWBx4/xYMZphgH+Uyyb7xfiyuCMbodCbf ct6wZCZbc0VcUJdL3c6YFl/1ATwVd6MnlMQIVey18L/yDIahWpvb9/JxyU3JaGGTcZc6aLVTg8v //VjpAs3ZFQlTZA+9rq3LCZSwT97x7 X-Google-Smtp-Source: AGHT+IFG9yud8dcBWBQOJIRw59mhm6svP47JyI5zjd2FCnLvEPll1GPN7gIdpPsagZ+qfO2xSeUkyQ== X-Received: by 2002:a5d:5846:0:b0:3a4:dc2a:924e with SMTP id ffacd0b85a97d-3b90093e6famr4622135f8f.6.1754731379386; Sat, 09 Aug 2025 02:22:59 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c338c7dsm33383033f8f.0.2025.08.09.02.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 02:22:59 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <878qjsua9j.fsf@telefonica.net> Date: Sat, 09 Aug 2025 11:22:58 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > =C3=93scar Fuentes writes: > >> Gerd M=C3=B6llmann writes: >> >>> Pip Cet writes: >>> >>>> insertions. >>>> >>>>> So far I can't see what is the cause. I would have guessed something = in >>>>> or around primitive-undo, but that hasn't changed forever. >>>>> >>>>> Adding Stef. >>>> >>>> Well, compact_undo_list is a nop with HAVE_MPS: >>> >>> Sorry, I forgot to mention an important detail: this happens in master >>> but not emacs-30. Oscar's report is also for master, IIRC. >>> >>> Really puzzling. >> >> However, it seems that on igc it is more easily reproducible. >> >> For a moment I thought that I messed up my bug report, because a couple >> of attempts at reproducing the problem on master failed, but then I made >> a few more undos/redos and the sequences of duplicated elements >> appeared. >> >> Something triggers this and then explodes. > > Okay, thanks. At least I don't have to check if I made a cockpit error > :-). But I guess I have to check emacs-30 again, if this is kind of > "random". Or it's related to what Pip said about compact_... From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:23:09 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:23:09 +0000 Received: from localhost ([127.0.0.1]:40182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfnB-00050C-4s for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:23:09 -0400 Received: from mail.eclipso.de ([217.69.254.104]:51340) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfn7-0004zE-Rz for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:23:06 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754731379; bh=UtM7ze9ZnDdwJV9PCkWOBgWsyEyq+W0fcE8fGeEOKQw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TvKsqcrgQ3SI7vleycgp0tDIuvkaaicHW/nO0K5riDEyPCES+vkBMuXRy7gpBDOXD gq6Okx7kWa7xm9ywZT8VVuyZhYYoQWn+jxPaemk1/zq3Ulj9xKWE311kMOV4hCs+pa +gOV6JDkvr/k5Cf1a1JHqRUnIeUllW50O/NVIpnqw0j+hKV4f9L6eJSNvB14wy/usd tzRatWyjJDrpBXs6i9aNt7aYy2TD2TYyC2DJ9CIB3095CIRrnuE/MDgUK6SUDwl+DF 1lqdNlKFJYiCx0h0vLBMvbSAFnAaenmY5UeBmzx9O2oZ9JayJeFy79f4eyXmFtABlt z6ctAjhe2CQvw== To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87cy94uavi.fsf@telefonica.net> Date: Sat, 09 Aug 2025 11:22:57 +0200 Message-ID: <874iugu9vy.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: >>> My cimpler recipe is >>> >>> 1. Make a new buffer x.el >>> 2. Type an a >>> 3. undo >>> 4. C-h v buffer-undo-list >>> >>> =3D>=20 >>> >>> Value: >>> (nil ("a" . 1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) (# . -1) >>> (# . -1) nil (1 . 2) (t . 0)) >>> Local in buffer x.el; global value is nil >> >> I can't reproduce this with my master's build: >> >> emacs -Q x.el >> >> type an a >> >> undo >> >> C-h v buffer-undo-list >> >> Its value is >> (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) nil >> (1 . 2) (t . -1)) >> Local in buffer x.el; global value is nil >> >> However, doing the same with my igc build of 1 of August yields this: >> >> Its value is >> (nil (#("a" 0 1 (fontified t)) . 1) (# . -1) >> (# . -1) (# . -1) nil >> (1 . 2) (t . -1)) >> Local in buffer x.el; global value is nil > > Now I'm completely confused. Your report had > > 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 > > but it's not happending in master? It doesn't happen here with your recipe, I need more elaborate sequences of inputs mixed with undos/redos. I *think* that multiple undo boundaries are a requisite. > And I think, if didn't make a cockpit error, I tested that with master. > Have to check this later, though. Maybe from your build's revision to mine something changed. Or, perhaps, there is a randomness component at play. I just executed emacs under valgrind and it spewed lots of stuff. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:36:23 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:36:23 +0000 Received: from localhost ([127.0.0.1]:40223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukfzx-0005gO-0h for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:36:22 -0400 Received: from mail.eclipso.de ([217.69.254.104]:35188) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukfzt-0005g5-E2 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:36:19 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754732170; bh=G5IV4eryokvrvurO4TDpP9hoAN2oCXG7iD9mi+TTU3Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=d8VrwbWRaDTnXnj7E+lSjIegM0arZRS+dcGqbgtspAI28bD2lb2FKQDAHFpJClt9L MpQiswzFEcStyiKF1ceU6xpTojmZnQZUTtU046w4OOCw25FCoqcZRedWdz9bnJeUmj bw5ZHxSEm42cxW/v4+tNJCbuhDbOpbOiVFvHtDFB9Pn8jIjZqNqfcwGaWzAWPa8uIS uZOf3ZardOrbrFf2MoWT8/Zym2nYWMx6hbuBxzCuyFCXstEDvxO6aPRGBUGTs1w7Ae RqMZsl50hNE4MLRd1hC3d5lvzYF/Q9rImylsxLOLBJTj9NZ+ryF4ysD8DnOXpt5UzG cHdLzmGdvP+ZA== To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87cy94uavi.fsf@telefonica.net> <87tt2g6ecz.fsf@protonmail.com> Date: Sat, 09 Aug 2025 11:36:09 +0200 Message-ID: <87zfc8supi.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Pip Cet writes: >> Eli in emacs-devel pointed to the possibility that something is creating >> lots of markers. Checking if those repeated elements in buffer-undo-list >> point to the same marker or to different ones would be revealing. > > Calling sxhash-eq is probably the quickest way to establish whether two > markers are eq. If the same marker turned up twice in the same section > of an undo list, that would be a bug somewhere: > > (dolist (el buffer-undo-list) > (and (consp el) > (markerp (car el)) > (message "%S %S" (car el) (sxhash-eq (car el))))) Thanks. Below is the output of eval'ing your dolist in *scratch*, with the contents of buffer-undo-list after that. Indeed, there are elements with the same sxhash-eq. Also puzzling to my ignorant eyes are the instances of "#" But added to that is Eli's question: why so many markers? It's just *scratch* with about 10 non-empty lines with a few characters each. # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63047179 # 63063029 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 63088759 # 54326086 # 63062382 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63084662 # 54326086 # 63099033 # 63099265 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 63085240 # 54326086 # 63076420 # 63078272 # 63097527 # 63097003 # 63109330 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981980 # 54326086 # 63110895 # 63107698 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 62981522 # 54326086 # 62948227 # 62947655 # 62949025 # 62954545 # 62987879 # 62981465 # 54326086 # 62948681 # 62954545 # 62987879 # 62987620 # 54326086 # 62987879 nil (nil (200 . 206) nil (199 . 200) nil (198 . 199) nil (196 . 198) nil (191 . 196) nil (190 . 191) nil (183 . 190) nil (182 . 183) nil (181 . 182) nil (180 . 181) nil (176 . 180) nil (174 . 176) nil (#(" " 0 2 (fontified t)) . 174) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) nil (#("aten" 0 4 (fontified t)) . 176) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) (# . -4) nil (#(" " 0 1 (fontified t)) . 180) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("a" 0 1 (fontified t)) . 181) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#(" " 0 1 (fontified t)) . 182) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("tseaint" 0 7 (fontified t)) . 183) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) (# . -7) nil (#(" " 0 1 (fontified t)) . 190) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("arsei" 0 5 (fontified t)) . 191) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) nil (#(" " 0 2 (fontified t)) . 196) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) (# . -2) nil (#("a" 0 1 (fontified t)) . 198) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#(" " 0 1 (fontified t)) . 199) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("atesnt" 0 6 (fontified t)) . 200) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) (# . -6) nil (#(" " 0 1 (fontified t)) . 206) (# . -1) (# . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("a" 0 1 (fontified t)) . 207) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#(" " 0 1 (fontified t)) . 208) (# . -1) (# . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("enars" 0 5 (fontified t)) . 209) (# . -5) (# . -1) (# . -2) (# . -3) (# . -4) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) (# . -5) nil (#(" " 0 1 (fontified t)) . 214) (# . -1) (# . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("etn" 0 3 (fontified t)) . 215) (# . -3) (# . -1) (# . -2) (# . -3) (# . -3) (# . -3) (# . -3) nil (#(" " 0 1 (fontified t)) . 218) (# . -1) (# . 1) (# . -1) (# . -1) (# . -1) nil (#("a" 0 1 (fontified t)) . 219) (# . -1) (# . -1) nil (219 . 220) nil (218 . 219) nil (215 . 218) nil (214 . 215) nil (209 . 214) nil (208 . 209) nil (207 . 208) nil (206 . 207) nil (200 . 206) nil (199 . 200) nil (198 . 199) nil (196 . 198) nil (191 . 196) nil (190 . 191) nil (183 . 190) nil (182 . 183) nil (181 . 182) nil (180 . 181) nil (176 . 180) nil (174 . 176) nil (167 . 174) nil (166 . 167) nil (165 . 166) nil (163 . 165) nil (162 . 163) nil (161 . 162) nil (160 . 161) nil (154 . 160) nil (153 . 154) nil (148 . 153) (t . 0) nil (1 . 148) (t . 0)) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 05:47:34 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 09:47:34 +0000 Received: from localhost ([127.0.0.1]:40251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukgAo-0006DJ-0h for submit@debbugs.gnu.org; Sat, 09 Aug 2025 05:47:34 -0400 Received: from relayout01-q02.e.movistar.es ([86.109.101.142]:25053) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukgAk-0006Cr-LM for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 05:47:32 -0400 Received: from relayout04.e.movistar.es (relayout04-redir.e.movistar.es [86.109.101.204]) by relayoutvt01.e.movistar.es (relayoutvt) with ESMTPS id 4bzbfM1VGnz41TL; Sat, 9 Aug 2025 11:47:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telefonica.net; s=selectortnet1; t=1754732843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YLvcgGaK8UNdCB6tKxcJVHQ3HSPY3P/2LwehcYVA4TQ=; b=KCtYnpAjrKZT6Pi812Ylmyw8sXi/gRqtFSZoD+jS0UT+dXd4G0/2vg7cozEPZeYRNJzf6T voz6V3K4lWlEc+worrJeyfE74HP51u7azcVZikcrXM9sl7z8gMgLm9IowrxAUH/4WyRkie Eei7EQTYMqI6gmHoZCB4qUold/6JG5GRM+Y9+IA9QjojKdQaqdtjjL1DH/KkIBBfkAzPyr Sr6urXLufkbDKx5dj2hMYo2cZUQXovC+59HFUupxr9i76WhvQb+eEn34H5KN+aGCF5vRsK eUofuHowRDgMYduf/OzbCwGwiqA+OxFJHhIYN9svvhPh6BAJ57CK5zmhTp93Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.movistar.es; s=arc1; t=1754732843; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLvcgGaK8UNdCB6tKxcJVHQ3HSPY3P/2LwehcYVA4TQ=; b=CphnDzJ8odacEXf0DDMkJvHrg0fIV2AumqsDPBBljBHWhYE1oksnPxjssTk1KQUhoykOWM raIQrfIYU7fCMCn34wKoq5LP3f8JQt7dstfNagYCAzyTeb/MwHF1bY1W8AIPrpkKqgPwHx ZNUF27PGgcXuzJrPWA/86xRrGosacl3r6DHztXxNX/w9OMVqqvcMEhFaPLQWyBKTEGvHn3 x20xUBriNJ/2r+NQygK65ObKNi9HswiQDjFWDhTdrkirqg9E6t5g0GIfs3HfiO13aALFyZ AbjRX3jS3QkzxB8XzWpITFyvqrq0rqZZ0cn6jTpfLbZKn/VbXgrrJXIO2JYuUw== ARC-Authentication-Results: i=1; relayoutvt01.e.movistar.es; spf=pass (relayoutvt01.e.movistar.es: domain of oscarfv@telefonica.net designates 86.109.101.204 as permitted sender) smtp.mailfrom=oscarfv@telefonica.net; auth=pass smtp.auth=oscarfv@telefonica.net smtp.mailfrom=oscarfv@telefonica.net ARC-Seal: i=1; s=arc1; d=e.movistar.es; t=1754732843; a=rsa-sha256; cv=none; b=Oe65Lthy9/gCRQcW5GJT7Dgy0wz3EWKnbASmvquGodheZ7COzG5TnGLQJllMRP+i9C6EOC RqvSMqJalTpBWjORhmmvzeBvCp+zGfeTgF9nuWNsq188BrQ8juq5qI4h0pxrJx1C1GN6Eo lCRKZ4FBwaqVRr9Rfnki/C0fl7GNDO6AqxTkViX2zV5UZNYUQD33lQW5Lortkcl7cUNski Jgj1Cm00d/G7ZY0I9DTVpQ3n2ciy2VbwxywX4i80v6LfbLT9VlEaS0MezP9tCxB0kqddfJ HeFZ+AymY2sLxEmuMtiyElICDXW9QTdVz0pILjvgL/UHRyNfuqIq7FiBer6j3Q== Received: from sky (161.red-81-39-126.dynamicip.rima-tde.net [81.39.126.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout04.e.movistar.es (relayout) with ESMTPSA id 4bzbfL4RdCz16Jv8; Sat, 9 Aug 2025 11:47:22 +0200 (CEST) From: =?utf-8?Q?=C3=93scar_Fuentes?= To: Eli Zaretskii Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <86ikiwn99w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 09 Aug 2025 11:47:21 +0200 Message-ID: <87sei0su6u.fsf@telefonica.net> MIME-Version: 1.0 Content-Type: text/plain X-TnetOut-Country: IP: 81.39.126.161 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout04 X-TnetOut-MsgID: 4bzbfL4RdCz16Jv8.A82B1 X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: oscarfv@telefonica.net X-TnetOut-Watermark: 1755337642.96509@Ws/ytS74F9MTwD+ixGddqg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Your bug report says this is on master branch: > >> 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 > > But I can only reproduce this on the igc branch. On master, I see a > single entry for marker adjustment, not many identical ones. On master you need more elaborate sequences of typing, undoing and redoing, but it is definitively reproducible. Maybe it is easier on igc because it does not do compactation, as Pip noted. Also tried your suggestion of calling garbage-collect (on master) before looking at buffer-undo-list. The sequences of duplicated elements remained. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 06:13:06 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 10:13:06 +0000 Received: from localhost ([127.0.0.1]:40289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukgZV-0007OY-Nx for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:13:06 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57556) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukgZT-0007Nn-0V for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:13:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukgZM-0006RO-VD for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:12:56 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukgZL-0000P9-8T for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:12:56 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3b8de193b60so1707774f8f.0 for ; Sat, 09 Aug 2025 03:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754734373; x=1755339173; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=TeeKpPqcwdPS+QqlhzK0zFbQRxe+LKJADUji/v5o65A=; b=e21nVk/hVdnNf8bQQU6/OM99g2lAWTkSH9dkMJ0aUXIxEuweiK08Ud3PdJagySR0Ta 9ywTan3mMKaP9AMmYR07uML7/dnuHB25vZTWnjWGfOopiVgK5heI9hApbH8qDUyri6Rk TCi6nMXsr+1Qh5zDkKJeYleMxnZfeuOauekKv04Rlb716xGCOaImmISceQ/+6k9YKCQe QAhzoi4uMr0uxV45viYTZUiyzSZzXOJyKkt+IONMkSO4/93tpnJcr4SRzaD+uNNAB2k1 Uv951aDbFrkwc3bRqwnSJT0tgZPDlTyRiLtrZhFnc7HQQrTwUnxRiLrFwWfEjBTgDhjq gQGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754734373; x=1755339173; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TeeKpPqcwdPS+QqlhzK0zFbQRxe+LKJADUji/v5o65A=; b=Af/aqWIBl+InSwLyXyv/sILy+CLQeLgAXYxKeaXaAFYRV38yeysFYBmFTgT/D8GRyR 053lFBKt3XgEv1SFSN9cl8I4Qt0zZg3LfDvqS1ABm01qA+4t54SvXf3JDaMcQL2OBYOc c7S6bNjQW6PLyOVADhmsL7OH42XbJ0p4m1qQNT+MRmk4S1nkIWRBnwUb2ViSfVlWtNHS cqVpahkm5zx3rIph+UkAvEOyEI2lPxHZOLaUosq6Sn+qJnZTIqSWNHk/6sQ0lGz+DhJA +Yp9e3RiEeRJP/AJKYiHSohFozE7B+vZVyZZ24vhafqhXH5kBeifmi5aTuBDYkhJ71V7 1b/w== X-Gm-Message-State: AOJu0YzOueCUK3F9dsBx/hlZClES25hK5RB6YXyaPxV/Db66V3L74CX3 zQny2/Wbds7H3qOyFuKE/uP5qK+dPf9kimOdJORL/m+8EVmTJ43ubR98L237wvO0 X-Gm-Gg: ASbGncviY90BpiZot8ngJoOZussM8ZtjXRGux/xxV/W6fg785003lWEEBatgrZ1eIEz Rn6S6F91KLyRUmqIBjZR/PQR9VZsLqFBkcQPowUqjPTJ2g8bM0bjhx42svh4UcrjW3FeAXAa58+ rXmuCQMyuxyJoWwi0osFAbkqHsrdZKYo7elpBMxjaGUltj12FcMT6zuHaZa8SckvB+qVqqK92ya tgtHiOSc+JEuki0KJ9/PYaNeaf1SU67SUKy8BR/gXVjhvb/LvN8zBlEyd20w6xsdkLPU5oHlLC5 ru6Q8DGmc00+l0jDCDWOU00pdV3DxDz4uXDwbEUtogTSf91oWLhovs4fYZDilVy48Wd55osos1u SJFeLRr7ZnlzdqVvUh7epJOcn5Vn6OnbwMagfwSSL6IvaNoGLLMu+lXshGDQGqLxGV4oLAcigT2 He1Ugyzrq9wDx1d72s5mBEQsdtI8cT X-Google-Smtp-Source: AGHT+IHLW55+xc19i38k3Tn3ypF+TQphLKzsNwwzoGJ7t5KVLeiUc0jh9ZGmHowGB26ZjXoxc4ObnQ== X-Received: by 2002:a05:6000:2013:b0:3a4:dfc2:bb60 with SMTP id ffacd0b85a97d-3b900b34192mr5051797f8f.26.1754734373426; Sat, 09 Aug 2025 03:12:53 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c469582sm32674988f8f.52.2025.08.09.03.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 03:12:53 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> Date: Sat, 09 Aug 2025 12:12:51 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=gerd.moellmann@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Pip Cet , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 06:18:29 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 10:18:30 +0000 Received: from localhost ([127.0.0.1]:40304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukgej-0007ds-FT for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:18:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44016) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukgeg-0007dO-MV for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:18:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukgea-0003PT-LU for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:18:21 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukgeZ-0001DK-54 for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:18:20 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-459ebb6bbdfso18708555e9.0 for ; Sat, 09 Aug 2025 03:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754734697; x=1755339497; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uwHeB7TpIawjw0lzPCzPuPMOqU8ct013o7g1VuN3Klg=; b=Pw2zVtWf+d5JMhrDu9Fr+PkR4mTDHfFWRjYvPr0BFIrN3xzKik2aCqf6ejtif0MzP5 t67At4dGaB6PpNB0LlS7cG5freMocKPUMV6sKNEm+L5d7SzkK4Rl2yOd8xYnkmvic2Wy av8s3wv2+Si8BozD41gGHdRG6+xuIGgdrCsOC0r2dTKx6sWoGvaSQcbW+3Pj6C7idUiM l/RKnuMbyC81VV3B2anogU+0yoRE2Bly8RawMqyl16blZe3Kr9xgd0JOWx5sar8aFeVf dS/v8kA2zXMUBBdcMYc2cWpUu2z4y0DTGeV2HpgQCDk9nl/ikMVR+4wZnopEIMZXM73i 7r6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754734697; x=1755339497; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=uwHeB7TpIawjw0lzPCzPuPMOqU8ct013o7g1VuN3Klg=; b=Iei2jCRcdpEQOAfKcW0Iby88pYCsDXs2AYGbXDNzY7clU7G/eT9P2G4TurCHMpnyUg BqfcEmxQX1pDB9cIuxm3uAhNZHB6u1em/uV6r+IvEur89gz7TA66RY86rBmok0Hmsdsa a1SUCfG0ZyiWcGUnZVfnPzJR3yB6EIRjg+SlqA0j7WFRTgdNPRvY4zg7+xOLyjmm2bJd u3Vc1MfVUppNPWqjhzyyN+P8a67LGLhobatPF+RXDZ+IrpTGdOFf8F3xH4YSaVp/9wXl u8PQnZsJFzf7CwbvnZn7VEevu+ATZFtqwVtI/leNk6Ud3DQLfTzAi8ZEgSHdG+NH+zYs hVWg== X-Gm-Message-State: AOJu0Yx1Mr10A2VwZ4vAQ79r34nSnoMTmEqzqWgMSiw3nfGWUxzUdp0V 4xMnQzj4tJ++629laUCRbadk9W4oIpocW3QnOgSF9qqMfMtreefaC0Y6 X-Gm-Gg: ASbGncsulgs97bOAm8jiI9oifx3/mm2bWKqo4/RkXrg7gjVfJ6ASjoPGvVG7O3oS9to TL0I0lRGF1J5KA2Ui8rCSOPowIKVN/+KiyTVrHNLYQ5f/nKD4LTYNhlo5JO5epSje61qG+lET8I CukuFuQGR/bKIjyAm2usRvUr8o9dpoNh64nLYzDQtfPRs+eMLT2L/dleDPWsLvOrCHV2ruQkqy9 Q6mMG+9P9Z5h4fhFhTvaL0wBjXLB3x5EO5ABpMKqqHQI56v/xbVwsNVAo1tjxMTISHr9KfxJW9A H+CdbUE+Ja/0reWdb+t7EDpwRT72BSxKjNj5hDTM3y4WMySVU5PaCbP3lnA3L98GqFjwifYb7KS R0sYXUgkFTsD8Znp3ZGtxeon31lZ8iKoVZ1Y92S/c1pnE/suhTr9nI4UZ4kgGfnJcPXW3NKShru h4fEnTEASCRyVN8nan74nctUhR563z X-Google-Smtp-Source: AGHT+IFYcZildHdFAV04N9flRKQ2nZVvILdLC5H8q92rXJYSVgX/lWTDdRRw0NmzRIFa9cSP+DaOUg== X-Received: by 2002:a05:600c:3e15:b0:458:bbed:a806 with SMTP id 5b1f17b1804b1-459ff34875fmr6400955e9.22.1754734697131; Sat, 09 Aug 2025 03:18:17 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5873c43sm186486045e9.22.2025.08.09.03.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 03:18:16 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> Date: Sat, 09 Aug 2025 12:18:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Pip Cet , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gerd M=C3=B6llmann writes: > Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" 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 =3D &list; >> >> for (tail =3D list; CONSP (tail); tail =3D XCDR (tail)) >> { >> if (CONSP (XCAR (tail)) >> && MARKERP (XCAR (XCAR (tail))) >> && !vectorlike_marked_p (&XMARKER (XCAR (XCAR (tail)))->header)) >> *prev =3D XCDR (tail); >> else >> prev =3D 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 is in primtive-undo for markers simple.el: 3758 ;; Adjust the valid marker adjustments 3759 (dolist (adj valid-marker-adjustments) 3760 ;; Insert might have invalidated some of the markers 3761 ;; via modification hooks. Update only the currently 3762 ;; valid ones (bug#25599). 3763 (if (marker-buffer (car adj)) 3764 (set-marker (car adj) 3765 (- (car adj) (cdr adj))))))) So, it would seem that one could do that. Famous last words :-). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 06:50:39 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 10:50:39 +0000 Received: from localhost ([127.0.0.1]:40362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukh9q-0000jx-OW for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:50:39 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58794) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukh9o-0000jd-KL for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:50:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukh9i-0002IU-9I for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:50:30 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukh9e-000613-Nm for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:50:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754736616; x=1754995816; bh=bWB4vCv8FVwfCgxV0suyPv1P+ar+6Cli6MYKQw+hyiM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=mPgLl/6pxJzkPJvYAxH8cfC197H4wEZwYEmqA0IgNO6bIhi1S0JfHJkl9uuNUTLyL XuTJCFLRqSn10P03kY5ijtQf+Q0HuA3LquHe6zPV2CcLCcbDcEp4loPTi6OPWaM2h3 gwsV3n4LnJpJRIQhUhMWpoLPIYlJ9SZ+LuqLUtux9pB4Bq4yRLxgypp+alWWNtjq/K Imj7D1N5lo90JbspIOlzs7Yh4fciiGOIx3ty8JrQaabSg9IrHO8PAIXvd2lCVpf3JS a3RL19Ikmjlg1hfnkMylqEf9WuiSMFA967z1fZHRBGjCy8aYtiHpRQahyw9/Xtu1Ou X1SQ2UyMG/vJg== Date: Sat, 09 Aug 2025 10:50:10 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: a48905563515d055cde89b16fa143b8522f938a5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?=C3=93scar_Fuentes?= , "Pip Cet via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gerd M=C3=B6llmann writes: > Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" 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 =3D &list; >> >> for (tail =3D list; CONSP (tail); tail =3D XCDR (tail)) >> { >> if (CONSP (XCAR (tail)) >> =09 && MARKERP (XCAR (XCAR (tail))) >> =09 && !vectorlike_marked_p (&XMARKER (XCAR (XCAR (tail)))->header)) >> =09*prev =3D XCDR (tail); >> else >> =09prev =3D 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. So far, I've seen no markers showing up twice in the same section of the undo list; that would be a bug in BUF_MARKERS, I think. So I'm not sure how coalescing would work. Over here, most of the markers in the undo list appear to be constructed in the format_mode_line_unwind_data function. So maybe something like this is needed: >From d5cf17f88fbba4cdfc61ebea725e12a2c8b9aa42 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sat, 9 Aug 2025 10:32:19 +0000 Subject: [PATCH] Detach markers explicitly so they don't wind up on the und= o list * src/xdisp.c (unwind_format_mode_line): Detach markers when we're done with them. --- src/xdisp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xdisp.c b/src/xdisp.c index 432dd5dceca..2406bb6f3d9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13828,6 +13828,7 @@ unwind_format_mode_line (Lisp_Object vector) =20 =09 current_buffer =3D XBUFFER (buffer); =09 set_point_from_marker (AREF (vector, 11)); +=09 detach_marker (AREF (vector, 11)); =09 ASET (vector, 11, Qnil); =09 current_buffer =3D cb; =09 } --=20 2.50.0 Famous last words: I think this is safe and AREF (vector, 11) is never leaked to Lisp. And I'm not sure whether the only reason it helps here might be a local peculiarity... Of course, none of this is very satisfying: we can perform manual memory management for markers in C code, but it's very hard to do so from Lisp code. Pip From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 06:53:53 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 10:53:53 +0000 Received: from localhost ([127.0.0.1]:40372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhCz-0000pm-3h for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:53:53 -0400 Received: from lists.gnu.org ([2001:470:142::17]:55066) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukhCx-0000pF-1T for submit@debbugs.gnu.org; Sat, 09 Aug 2025 06:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukhCr-0002Id-Mk for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:53:45 -0400 Received: from relayout03-sq01.e.movistar.es ([86.109.101.163]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukhCn-0006T4-N8 for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 06:53:45 -0400 Received: from relayout04.e.movistar.es (relayout04.e.movistar.es [86.109.101.204]) by relayoutvt03.e.movistar.es (relayoutvt) with ESMTPS id 4bzd6n1fgvz40tk; Sat, 9 Aug 2025 12:53:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telefonica.net; s=selectortnet1; t=1754736817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9jzgexmfb5v+SofImRy6+i9N0WD5IngYEGCbZ81VPy4=; b=qO/j/ntJ54+hlvdz47oQGqVkdCHRrlGAlYw+YiWrHeCFbF5zLlMz+LpK9fpdMxWPBHzf7P ADpwGhKbZD4wcjVSl+SxL65cadZrFAG2NiMudOaZPNtfNrHpQdE9KK3T1/3MjsDnJ/yl/L bsOTO7MID4qis4cwOgk062h2jit8yQX5N+joQ/rgrWqirRr17DDFQG0U084nFLPdPOds1A Rmo31oNFimp2Q/WHlcYe/rORBZlnAswIJBEOpQqPVNhC60IhmAOv6gk482A333eHdKpC/D VG/4RqZ+kbvUelG4XQn/HGOBOujWDb7p9xq8Z3UR7k8Wb/SCq/04mr7jOVI2lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.movistar.es; s=arc1; t=1754736817; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9jzgexmfb5v+SofImRy6+i9N0WD5IngYEGCbZ81VPy4=; b=HmIV9C2kSxgUYrtQyT+x+KQi9UOj7RLWnWTmvkKVjC6CQ9+9PJP2uh8RQdKKcBtDCkQv35 yp8gRREBwx+q/+5J4a8eGNw7XzkbKGhGUh0wJb5j1p/3nczLAB24xXFBowKjVCpdAkw0ok qW9v1fSV+hGX8c+/4NNFOnzz89nbJB0XRsWgSZjOC+T8SXGZm8leIqweuYLmhfrXMg7enL Pu+YiGbRynW2ECHui/lqEYmjeYh+IxDDtX+yg2h7HzaF+H82og7fFeWrtCEa5zT5hJmoxy lCATOfK52AuJW6I4BYvjOE8oDiYW8GTup3Qxoeh85A5CZmyXPXe0wTlGd4kwaQ== ARC-Authentication-Results: i=1; relayoutvt03.e.movistar.es; spf=pass (relayoutvt03.e.movistar.es: domain of oscarfv@telefonica.net designates 86.109.101.204 as permitted sender) smtp.mailfrom=oscarfv@telefonica.net; auth=pass smtp.auth=oscarfv@telefonica.net smtp.mailfrom=oscarfv@telefonica.net ARC-Seal: i=1; s=arc1; d=e.movistar.es; t=1754736817; a=rsa-sha256; cv=none; b=ViI8mYaMdAkL0d4piUPyknzqMjNkioMjBd662vU/4Cvq+DA8tyBxcIATtGhkpBcH97sO/L aS7GhFlez5ZYAL4SzYEa8arty3bqxDfIKLEZi0do9P08YXP/tfKl5X5re8bXSlHqhy/VFv px9fr1fbNCUyLX3E0BJssIPzFRcTMZn81eEqmUAUH0B96hCKH1GVxOeSeaTxw5uOPjoGjX 8fEusRsMyNNCQzkplWB6fisrHi15QC+oGKM/Afrr/IbuGGLCtAZ5uKKj3ynMNECgBCXfVB O1pkktOPsNyMCJvUPoS6s1KiEsVhZnl2DuNEZ8XhPB4qjHPGsmIHV6xg9JdbKQ== Received: from sky (161.red-81-39-126.dynamicip.rima-tde.net [81.39.126.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout04.e.movistar.es (relayout) with ESMTPSA id 4bzd6l16cMz16Jvv; Sat, 9 Aug 2025 12:53:34 +0200 (CEST) From: =?utf-8?Q?=C3=93scar_Fuentes?= To: 79200@debbugs.gnu.org Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 09 Aug 2025 12:53:34 +0200 Message-ID: <87ms88sr4h.fsf@telefonica.net> MIME-Version: 1.0 Content-Type: text/plain X-TnetOut-Country: IP: 81.39.126.161 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout04 X-TnetOut-MsgID: 4bzd6l16cMz16Jvv.AB4CB X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: oscarfv@telefonica.net X-TnetOut-Watermark: 1755341616.99842@lX26vKGWaLCK7XQCHav5xw X-Spam-Status: No Received-SPF: pass client-ip=86.109.101.163; envelope-from=oscarfv@telefonica.net; helo=relayout03-sq01.e.movistar.es X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Reverting this commit fixes the problem, both in master and igc: commit 6f494d74f645d6cffd98e168721a0347de271a54 Author: Pengji Zhang Date: Sat Mar 29 19:04:58 2025 +0800 New user option to hide minor mode lighters (bug#77361) * lisp/bindings.el (mode-line-collapse-minor-modes): New user option. (mode-line-minor-modes): New variable to hold mode line constructs for minor modes. (mode-line--make-lighter-menu): New helper function to generate the menu for hidden minor modes. (mode-line--minor-modes): New helper function to computer mode line constructs for minor mode lighters. (mode-line-modes): Use the new variable 'mode-line-minor-modes', and adjust the order of elements so the indicator for hidden minor modes is shown towards the end. * doc/lispref/modes.texi (Mode Line Basics): Move the paragraph for 'mode-line-compact' from here... * doc/emacs/display.texi (Optional Mode Line): ...to here, and document the new user option. * etc/NEWS: Annouce the new user option. Seriously. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 07:15:35 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 11:15:35 +0000 Received: from localhost ([127.0.0.1]:40421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhXz-0001ti-Bo for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:15:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37766) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukhXx-0001t6-B5 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukhXq-0003oQ-KU for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 07:15:26 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukhXm-0002Ze-Tu for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 07:15:24 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3b78bca0890so1382598f8f.3 for ; Sat, 09 Aug 2025 04:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754738120; x=1755342920; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=cWEkyY14Y3IGq8cImNbZ0S3TgWS00av8pNwIjgkXXdM=; b=Snbj+Dkou8zZLPoKCJE0Cl7r7qP/2w5fr2g0dC/omNxQBKnKJnXUFGIXFoD6N/WFbX +RR+Ibw9ZhHAiyt8QWfHktkUCnoThiEmu59o4NPUXqgJx7RnGB3oecDZfzulPq4attfz Np7KYBjwnnok/3uLFZyLPG7IgpFDy4UDkuuo/b0Nlt0CfwQ1r7KERkeZFB494QrmEk/i 3GNHVz4YKyeZXHTNKX2NR4ncblsHnQgSWdVqOGCFV2J7DS2/qqK5TFq9lSooWDKukGqK tJV6FV3+JSMpIxCOQVvM54xl69Q/syxcExEka9jez4p+Klp20sD9LM7SQXK/8TdcVL7W P7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754738120; x=1755342920; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cWEkyY14Y3IGq8cImNbZ0S3TgWS00av8pNwIjgkXXdM=; b=IpLmjktUPUAKi4XmsCrBEtSANjsiCEWIfDIkjhi2XEpNPLT2Wgubm68kymTA1eVP0w TcvguzMCzzpmdsbLhzg8z2P3jOI1tWXTB9GOZqrWzKhER9H3cffcuCdI8eDG6ptznicN gjqHCO9OSVLb5Rz3eN10HzRhNyngZSlQk7gE1Xp9Yys/7VECZoqJxydJuOIdqTQm7+SO uu/+rF2Zx4yvpOi2GDf196IB+7MxcNs5Qryr12ZTwivwq0bCKcc2mtIg00xGQo9CamFc yHrldSxUb9eAAyMW1AuDz7wHEzC+0FCYNyTF8rEfOkqbKUzh2YLbYO1TNKx4HU8fqoo/ gNWw== X-Gm-Message-State: AOJu0YyzfjyVmODurahb2lD6jZBiQ3kg5bM2JE9AW8+Dd/2Hb6bLAisP q3P2Q/OfdsMB/UAWuQwWPSlBfJ07hvU+hz4CAE9J9bQ7A0zBILIHSK4q X-Gm-Gg: ASbGncsdGGrgBpP4uMraOP9TI6ytw0DvMKBSFNPzOI8BYSI46s1kQIQZih2mUG0h6KR aJ4uL8U/g65d4oDEbcP+aGw4mVphJu4wHUMN+csfFr114aLFN7FLRa837xmcToKJnXYXElg7Vvh frJE6mZCTWWgyXQYpd2Bln9ktnx/oHACzNASmH5THwpPftlsvg03HwY6eERrQw7ekfikuIVQu1u E5+XR2+I5NYDx9jHEuv1a0/Nn7+0QXmZC1+I+zuIeXwkKy8C8Ed1VYhYJLJo7LIZkHjiWALi1JS yi06bDtV0RrLP5gZEVQlvXGu/+ZQz+zMy728Yi5jvINVVbJrCYCtNduT/YQG6gw48WuJF5Hp/By 57gzWUVA8m+zfYiFTXkDhPE+TdlnbbuI3dqFylWjdmDKhpsw0hNuEn/W3eT7BRASrW0udvMeCRv 8iY8kml3j3/cVMjjayLjP8xZNrnSTy X-Google-Smtp-Source: AGHT+IEKxUeDNLAUj8MON85lrrtqD23cUf6XHdhm8HtanMdC7Guh9d/+hASyrhWLhj7mIrznNMMynA== X-Received: by 2002:a05:6000:2501:b0:3b8:f2f2:e417 with SMTP id ffacd0b85a97d-3b900b56f7bmr5072214f8f.51.1754738120230; Sat, 09 Aug 2025 04:15:20 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453328sm35277762f8f.46.2025.08.09.04.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 04:15:19 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87o6so6a8k.fsf@protonmail.com> Date: Sat, 09 Aug 2025 13:15:18 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=gerd.moellmann@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?=C3=93scar?= Fuentes , "Pip Cet via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Pip Cet writes: >>> 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. > > So far, I've seen no markers showing up twice in the same section of the > undo list; that would be a bug in BUF_MARKERS, I think. So I'm not sure > how coalescing would work. Okay. The primitive-undo code of course only indicates that it can happen, not how often. > Over here, most of the markers in the undo list appear to be constructed > in the format_mode_line_unwind_data function. So maybe something like > this is needed: > > From d5cf17f88fbba4cdfc61ebea725e12a2c8b9aa42 Mon Sep 17 00:00:00 2001 > From: Pip Cet > Date: Sat, 9 Aug 2025 10:32:19 +0000 > Subject: [PATCH] Detach markers explicitly so they don't wind up on the undo > list > > * src/xdisp.c (unwind_format_mode_line): Detach markers when we're > done with them. > --- > src/xdisp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/xdisp.c b/src/xdisp.c > index 432dd5dceca..2406bb6f3d9 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -13828,6 +13828,7 @@ unwind_format_mode_line (Lisp_Object vector) > > current_buffer = XBUFFER (buffer); > set_point_from_marker (AREF (vector, 11)); > + detach_marker (AREF (vector, 11)); > ASET (vector, 11, Qnil); > current_buffer = cb; > } I think that should be done. The 11 is always made with build_marker, so it's guaranteed to be correct, and a win. (And Gnus seems to not cite anything after an inline patch Also interesting :-/). > Famous last words: I think this is safe and AREF (vector, 11) is never > leaked to Lisp. And I'm not sure whether the only reason it helps here > might be a local peculiarity... I think it should go in. I've also checked it's safe. And I'll run with it in my Emacs. > Of course, none of this is very satisfying: we can perform manual memory > management for markers in C code, but it's very hard to do so from Lisp > code. Yes, the more general problem is that old GC is "eagerly weak" so to speak, while MPS Is "lazily weak". I have no idea what to do about that. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 07:16:50 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 11:16:50 +0000 Received: from localhost ([127.0.0.1]:40427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhZC-0001wT-0w for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:16:50 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:57572) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukhZ8-0001wC-QU for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 07:16:47 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3b794a013bcso2313264f8f.2 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 04:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754738200; x=1755343000; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jWiu7P/DDwX7sD3thqTxmhK1NrfSQb41eIftE/BUjP0=; b=UC7csl3pTPQGzj9pHebqMy8jMGz857LaGKKo8OW6zZQAzF8yHg2t1tBa41vWdS9BBk w8C4PLo39GjRlL1uXD8UiySw6d8n8ca2SWnjE5a5UPl1b7KEH/AcIWXe/qPFXH2PqB8S EkcJDWF7V6ouyDvtqZLc4uSo65OpnT/KALcZMbvpS445GncxXexk1RDcJlc9Il2g2ono aclCcESFOGrNEF36HvZzolUORSzGxBPRM/Umrd8J9oWhS+1ZoDxspL5e5i0hEfMUufCE lbnqWjELUDV7nuqDH5XvqAcZNrYJoUJdMyYM4F991tPoio0dawBYFnj+sZryH3Q0I3BN ZegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754738200; x=1755343000; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jWiu7P/DDwX7sD3thqTxmhK1NrfSQb41eIftE/BUjP0=; b=nDtkFTuWXu5eKZLAkWtVb4PaguuuvU+GYLb26UScj5TKBwRAR7YAFOs2dD1G2cYP+W Ov2LMxY707FVx2FAUl8AO0Clto74CVTkd6fBhqb/fNvJsagXvNIQqLnksY1F/SK0nW20 Q55V0C2D6b0r5UaPOrR1CeXFSuD4Ut4HLpUsNfm9zNx7nDoCgmsH7wjWGTFSD8j06yJr xztOrruIJ6kHpzJvz2ESFTA69pKFpus1c/A1xgYp3iulnI2bhaWhUxWRaMQlBpd4Otr5 fKxW2GNeSANm+EdPpPcv6gSmQ11eyNlYF4QJvvwyjkBd76nYEw7SEoR/TlUK6lmXaKKr r+UQ== X-Gm-Message-State: AOJu0Yxw0wUDc4Uh6lO9tflD8lARKoiNU9+KuPITLLdRiqSUUTwrmcby olHyUSjfgfhW2Xfu7lcFoT4YQ9gMwYN7B1e+YXR+SWy1QOaroqW4RBf3 X-Gm-Gg: ASbGncvt3ZdZcE27Zfm3WPVu+Lb4sPO2tAJva9scyL47DafnDIUO34JieNtgMo+bTK+ GYGgPW9mc674eETgoohWyWjZ5sQB76aH5OnS6nraXFUsH78By73MJ2gJ8MXDAy3iQAdk9qJSgnE A52yDkJIRTKiUQnoomwoDBSl6pjSIJhaKQcUuW/cImn6buliwSHDDi/QlRY+iJ2JpMFnEnboI6c jgfLlhnskkL7D1L6ShxPab2HITym/x4ufm9t4iVzHOulk7vmegeFekayoRSJ1IuGTuIpIwJj6nQ e6vP0tVR98kRxxBDo+mCNC5H/kdv0m/HRkYGizCGOOXb9jB+IRpIn08PtNMoCP6DUfMnh13p3a8 Ravq7jmgztT+klTztrXVL+uScCjwaB4Z04zuOlic7XwZCdC0j6H3XfM6Tb8Lb2R9BK4j9KnAcIC +rBQLzLjwJQ5jKRQaO8jJ7kgnwayWJ X-Google-Smtp-Source: AGHT+IEVa8J0nFmSqfoS1D6aJ0KyV43FapKrOe7pCNeEYHg45s9BEUhwbfXBHvlK8K+g6vyKnDMR4w== X-Received: by 2002:a05:6000:18a9:b0:3b7:fbe3:66c2 with SMTP id ffacd0b85a97d-3b900b7a541mr4603833f8f.50.1754738200433; Sat, 09 Aug 2025 04:16:40 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c48de68sm33674105f8f.67.2025.08.09.04.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 04:16:39 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> Date: Sat, 09 Aug 2025 13:16:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > Reverting this commit fixes the problem, both in master and igc: > > commit 6f494d74f645d6cffd98e168721a0347de271a54 > Author: Pengji Zhang > Date: Sat Mar 29 19:04:58 2025 +0800 > > New user option to hide minor mode lighters (bug#77361) >=20=20=20=20=20 > * lisp/bindings.el (mode-line-collapse-minor-modes): New user > option. > (mode-line-minor-modes): New variable to hold mode line > constructs for minor modes. > (mode-line--make-lighter-menu): New helper function to generate > the menu for hidden minor modes. > (mode-line--minor-modes): New helper function to computer mode > line constructs for minor mode lighters. > (mode-line-modes): Use the new variable 'mode-line-minor-modes', > and adjust the order of elements so the indicator for hidden > minor modes is shown towards the end. >=20=20=20=20=20 > * doc/lispref/modes.texi (Mode Line Basics): Move the paragraph > for 'mode-line-compact' from here... > * doc/emacs/display.texi (Optional Mode Line): ...to here, and > document the new user option. > * etc/NEWS: Annouce the new user option. > > > > Seriously. Makes sense: no idea what that is, but it's something with mode-lines, and what Pip found out is also the mode-line department.=20 From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 07:20:40 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 11:20:41 +0000 Received: from localhost ([127.0.0.1]:40439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhcu-00028Y-Gq for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:20:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55846) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukhcs-00028J-6r for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 07:20:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukhcl-0003iI-I7; Sat, 09 Aug 2025 07:20:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Bsf9a+d2yjxQeqxpb+OxHojTu8xOA8vI0kZ/ydhXyKc=; b=IBifYUhC/u5YT1kgmwDD cKdvSK7N8/qqyU4KiZ/MlS0WZuv/g6r5Pn4f135Ajd2PiiOBnv1mfJpNIBaFZ9s8jFb42CPZXs4mC xZ4S/5mGMjpP5lLeGcb6SBB2g/tXThocJiu8OZ+mFl34sJ9pENMYwLEKtkr8nfcLmWyuVuGDTUFEU PTkK0G4ZG0RCm8KVgI4CAwdUVK0KcEeIZK9RTcwt3lsYAEzojqGzuD6BNtRFPaQKSKRw3QW7h8Wir kfpdA6UAEKNSg/GrxqmLkrMgTgWdylVyp35aMc8KNJnsBvQqjWdtbv4LTrJnygdfQP3goTnaQStRw 8bRf9PKVgBqXfQ==; Date: Sat, 09 Aug 2025 14:20:29 +0300 Message-Id: <868qjsn3lu.fsf@gnu.org> From: Eli Zaretskii To: =?iso-8859-1?Q?=D3scar?= Fuentes In-Reply-To: <87sei0su6u.fsf@telefonica.net> (message from =?iso-8859-1?Q?=D3scar?= Fuentes on Sat, 09 Aug 2025 11:47:21 +0200) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <86ikiwn99w.fsf@gnu.org> <87sei0su6u.fsf@telefonica.net> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Óscar Fuentes > Cc: 79200@debbugs.gnu.org > Date: Sat, 09 Aug 2025 11:47:21 +0200 > X-Spam-Status: No > > Eli Zaretskii writes: > > > Your bug report says this is on master branch: > > > >> 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 > > > > But I can only reproduce this on the igc branch. On master, I see a > > single entry for marker adjustment, not many identical ones. > > On master you need more elaborate sequences of typing, undoing and > redoing, but it is definitively reproducible. Why does one need more elaborate sequences on master? > Maybe it is easier on igc because it does not do compactation, as Pip > noted. If compacting the undo-list solves the issue on master, I don't see this as a grave problem on master. > Also tried your suggestion of calling garbage-collect (on master) before > looking at buffer-undo-list. The sequences of duplicated elements > remained. On the master branch or on the igc branch? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 07:38:03 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 11:38:03 +0000 Received: from localhost ([127.0.0.1]:40460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhti-0005h4-L8 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:38:02 -0400 Received: from relayout01-sq02.e.movistar.es ([86.109.101.144]:23557) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukhtf-0005gX-O5 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 07:38:00 -0400 Received: from relayout04.e.movistar.es (relayout04-redir.e.movistar.es [86.109.101.204]) by relayoutvt02.e.movistar.es (relayoutvt) with ESMTPS id 4bzf5r415Lz40NB; Sat, 9 Aug 2025 13:37:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telefonica.net; s=selectortnet1; t=1754739472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bYF+NSj2k6OlC/Xm+i3KwMOI636DXuGq4ie0n73Wczo=; b=d18eD0peHcnv53UbURPXf0C4AeSNwlQaz4C00z7JMYahW+wOWZNu30VjeWJCq1Buif+rOu gtYIzKXhweA9nPaTRq5PXRi8U7vNyDTihK0gKiFoMs3xClgcBbrfNiyym64qBPAYJZ/Bjj zZERP8YZyVo8Rv7qh7Btvf5NYuUUKAjtldPw+x4lUguwuoD2pCtPBOoyAhAYqwf410Lu02 ia7b3zP3/BLum1+D8GiL/XoqbfgDTnicUxk7e+sZ77JVycCNAix6uXflmUBxWbVjdwXNyo 3tzbmckc1GPN+QQxlyGuvb82b+jZiSSgf93fKfha6hjMHGWo+6aXbxXl+DBSFw== ARC-Seal: i=1; s=arc1; d=e.movistar.es; t=1754739472; a=rsa-sha256; cv=none; b=u0h4MJyKjEtC6AcueL3pQFoj4RBEJYRT73z/ZIkjvBrlYR0sGebaplqF37sQI2DEXNk2+o bpx54WsAzUQi01PdgsXkjwUev3O3Okq4bx0GK9yLEtFNo1sDNiaLi33wPCgbkKwTNehST3 We+G/ndzIVFG2YjLEBndH0J+XWkOHjQOSSyCZb13ZVMf5J2MqVluQwiIpji16P+WlOcthH bTSXMi9wwNEXNFXlfGSpyPuTMrMqXemSCoB4uAQScoBOzOnmyZAB72+H6lOnmVwb5j3Nai ZWhynHtg/aB8MOQwQ6sE2U3UcpoapuAhyXGQwfWLyIg59C1SHm2kTgcndaq73g== ARC-Authentication-Results: i=1; relayoutvt02.e.movistar.es; spf=pass (relayoutvt02.e.movistar.es: domain of oscarfv@telefonica.net designates 86.109.101.204 as permitted sender) smtp.mailfrom=oscarfv@telefonica.net; auth=pass smtp.auth=oscarfv@telefonica.net smtp.mailfrom=oscarfv@telefonica.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.movistar.es; s=arc1; t=1754739472; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bYF+NSj2k6OlC/Xm+i3KwMOI636DXuGq4ie0n73Wczo=; b=SS5Ul/jPpRMYIIjxyOLkyG/0sZkfrS36ms78iNPew0nLLSD8crEBHX8dblSr6NNUdon7ed E5exzs/humQV/+lG6C+XRNalpMb7uMldkjkdkmWWZztQ+uck3jBI7eY/iau1vYUYBS56vc 3ZI+PcOpLMAfbP54Jh/Jgb0XH9AhKDyvp8Ek7NWXBJ+iv7gI6H9d00vhnzTMjSFHqbioKT tBd1wn7DYp18HwWszvCLn8a+1rgEu3+XQH9jS1ZV7IMoshm9oMD69swxfVHKUT9zgfub8P 3Sym3pR1LyOwNol7S4XPdSlo0571LVXLncXWO2rYJWdZpTVTQ5P5ce4nY5WvQg== Received: from sky (161.red-81-39-126.dynamicip.rima-tde.net [81.39.126.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout04.e.movistar.es (relayout) with ESMTPSA id 4bzf5q6n90z16Jv8; Sat, 9 Aug 2025 13:37:51 +0200 (CEST) From: =?utf-8?Q?=C3=93scar?= Fuentes =?utf-8?Q?=C3=93scar?= Fuentes To: Eli Zaretskii Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <86ikiwn99w.fsf@gnu.org> <87sei0su6u.fsf@telefonica.net> <868qjsn3lu.fsf@gnu.org> Date: Sat, 09 Aug 2025 13:37:51 +0200 Message-ID: <87ikiwsp2o.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-TnetOut-Country: IP: 81.39.126.161 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout04 X-TnetOut-MsgID: 4bzf5q6n90z16Jv8.A73ED X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: oscarfv@telefonica.net X-TnetOut-Watermark: 1755344272.32206@Tk8bK/s6vdqH054F9gmmKg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> > But I can only reproduce this on the igc branch. On master, I see a >> > single entry for marker adjustment, not many identical ones. >> >> On master you need more elaborate sequences of typing, undoing and >> redoing, but it is definitively reproducible. > > Why does one need more elaborate sequences on master? I don't know why. I mentioned the lack of compaction in igc as a possible factor. >> Maybe it is easier on igc because it does not do compactation, as Pip >> noted. > > If compacting the undo-list solves the issue on master, I don't see > this as a grave problem on master. The copious sequences of #marker elements happen on master too (the contents of `buffer-undo-list` that I copied on the previous messages are from master.) I don't know if they end inundating buffer-undo-list to the point of losing undo info like they do in igc, though, but looks like a bug to me even if there are no user-observable effects. Those sequences use memory and require cpu time, for sure. >> Also tried your suggestion of calling garbage-collect (on master) before >> looking at buffer-undo-list. The sequences of duplicated elements >> remained. > > On the master branch or on the igc branch? On master, as mentioned. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 07:42:28 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 11:42:28 +0000 Received: from localhost ([127.0.0.1]:40471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukhy0-0005tz-4E for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:42:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58182) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukhxy-0005tV-An for submit@debbugs.gnu.org; Sat, 09 Aug 2025 07:42:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukhxs-0003WI-GZ for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 07:42:20 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukhxq-0006PO-Lo for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 07:42:20 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-458b885d6eeso18692815e9.3 for ; Sat, 09 Aug 2025 04:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754739737; x=1755344537; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P0oHGR8wYENkUkGLwET9013CzGk3Zb9WFVAzeHFedDA=; b=A2r6i3poA7SznuMSd+Nm8EvOezxKWYx+EdMOeXs0Dc61H2bfIxaDCneR8mL+TCS0Ap 4v20neEQS0//o9lntEkQALRXeB8dioQSBfN9jI7m8aoJtKPPnVu/Cav6lyme5pf85Vs+ NCIsSUzyE4N/7FoSB/lDykDKiyuJuiLZ04kMPSZtNqlU69H8MgtbfN8WvY7Raqy66gRs VrfR3jTFhzQaljMVZudAUk8DX3+On+rWo4m44l1XGltxifWwV6CGlV5PbMWS7ZXSgyEZ Xr5YD3RQwlU4LwtyzuMShkibKXKePWgdfvoQ70TDA82nGfRoThPOVcX9lZhwOYtLaOAf unJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754739737; x=1755344537; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=P0oHGR8wYENkUkGLwET9013CzGk3Zb9WFVAzeHFedDA=; b=bi0Xm9M0WXEFL3KWX1jHtnx+EYllI8i1qVQbh2fvhwHcVcmFfUwqbMQYYvSdSe7v6F C50lP+v5pxw3TSxldfxWZSurLav0E/uIbirvPQGfek2npibmagMmOHPlsXicdGmvj+SW xC/ExkcW+w9m3sHgCD93FgYjV5URExD3g3o60HgwjVmaln1+W3HOkGzLREzMbumsVet2 hpbcBE+PotFoKo1PEBj5R4NwIdJL6n1fSsw8wzEpo4LRnmJrXvasfA57llrxES58ntxB jYsgTvsR8tVJXOwuhlknVCksBHP/fJzinds5StYJeyA54XSGVhaZwCh1Tsufx4/rKe73 2ZGw== X-Forwarded-Encrypted: i=1; AJvYcCWP1X4Jnc/FzLcT0dFQCt+C4Cll7GxUqOYt78TsxJnSm9rAhKK0ZpUIK8DOo49tEmgT5pTHzWRJ6ktljnVq@gnu.org X-Gm-Message-State: AOJu0YwkLHiCaPkVI2rKx3XlYI4nZ/+oGp3MMXLW27ej770skjUcnIjq TSyzMo4vGvNjuGzXg0c7pLY/nGsOF00envUaKYD6IQiTjXlgIbIh+kjy X-Gm-Gg: ASbGnct/NjSUQt28Hz7uh+18PMQI5wER/SlE3hYXI1R0qsBMwFx0hMS+J6v4D8P/KaX 2dr70OlFRt2alEq/S7VPc/wFb/fKSoBCT2DrUBHKrJ3Xcr1zA6d1T5zPKdKPzL6pVZLUPEBhfZJ vxEI63ZE0PMil4tInO4WzUbTFDWx1YsT2e/ygomgBTDN8SclG5lOzv04+o3UrKVLUxM31fl6tzQ GgOks64XRYut6IJkef5qUH+/TZ0vJzCjks/amURZCPoFw7LtWR+bexSEd9M7AQpEp80YwnETjgI Na/wpEA/lxe0EYsoGQLpvWcF3xf/mV7CMOsqf/bhRjvAQ1c/k2z5CaUi4IZvrPXcB5TNgdPDfQw NzjPyIBBcuOuY4ZpzGAQvKTMbt1hjj+ZhU4CkwlGCKztqFeFtHQSVs87zM8K4x6qZRTPFBfp5rI JQkHD5bl2SYEwLc/64qNs0FW0HAYEo X-Google-Smtp-Source: AGHT+IFcEO74GLorp9yN6PuCCsQWT6UnhBUOKOjO1wHyIAu4rCiiiUm8W0xd0rwarECazMqNuouUkw== X-Received: by 2002:a05:600c:4e87:b0:455:ed48:144f with SMTP id 5b1f17b1804b1-459f4eb4041mr62052595e9.14.1754739736508; Sat, 09 Aug 2025 04:42:16 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459de91ea4csm228293755e9.10.2025.08.09.04.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 04:42:16 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> Date: Sat, 09 Aug 2025 13:42:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gerd M=C3=B6llmann writes: > Makes sense: no idea what that is, but it's something with mode-lines, > and what Pip found out is also the mode-line department.=20 And with Pip's patch applied, I can now longer reproduce the problem. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:00:21 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 12:00:22 +0000 Received: from localhost ([127.0.0.1]:40519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukiFJ-0006mY-Ga for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:00:21 -0400 Received: from relayout03-q01.e.movistar.es ([86.109.101.161]:43927) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukiFF-0006gV-Dk for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 08:00:19 -0400 Received: from relayout04.e.movistar.es (relayout04-redir.e.movistar.es [86.109.101.204]) by relayoutvt03.e.movistar.es (relayoutvt) with ESMTPS id 4bzfbZ0qlcz40Ry; Sat, 9 Aug 2025 14:00:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telefonica.net; s=selectortnet1; t=1754740810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mxoJdlgQeMrij+hcPC+a5USCGns7dZ4bzAxwcSmvVak=; b=wiK+YZXk6O2TF2kKVco7t9DHS28UjVEBpttZqfcDiDb3H5CXhLwD/p2IALZ7UuGCGF8ZgJ PBWJtKpnnjF2bdwxP0nJcxSNLqddFIA0YegxS6YJxhp6S58uZ9r0TnJX1DrgpyE4giK8Gp QaUcTRror4mb5WgYBO6VgZJbtRLPfpZPalg50/HWgFf9SnNC7OGTVFN2LzGQthP0Pzt18N TyR8FJlDkBjkguqF7N23t3BaePVRFwFmdoI4nQmUJWcvntSU3BXQMmOK8XGEO//3JubjPz 5hZhCixkQUWZAaR8ZcD5LuLmMxln2m63/AcW9DGi8Hy7kKkafXLnPWDeeaJ5zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.movistar.es; s=arc1; t=1754740810; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mxoJdlgQeMrij+hcPC+a5USCGns7dZ4bzAxwcSmvVak=; b=eBHwgJ/Q6/FKwWXeo7i4PDCCTPC8HlmkHLxxX11ti4Jn2CrNVFoktTwLi2cEAt1D4WK/Xl GpHsoonf/GIq9eIXMmIYpsKujW6bWc3vZhzsDC8u3fBLAytvRwJ3tqHlwZvwJGuZU039hL 7ytPjqLd4DXYmwTKzPGEiMLKb0fENM7pv4uW0ozgEXs0EtgUirSvMkcj+yBM3qYGfXVIm8 GC0JXQL5uamiB4WPu3ckSn60ubWeqFeQKAeCs1n7Z8ElboF2ZR2ewd+dzkcKJpLYlbHuyh ChC8N9HcB7YnQ2Bpgk2eSk6UVOPPjtJu+pCAIGSo3DPRMfMt7db3v4DnoUcnxQ== ARC-Authentication-Results: i=1; relayoutvt03.e.movistar.es; spf=pass (relayoutvt03.e.movistar.es: domain of oscarfv@telefonica.net designates 86.109.101.204 as permitted sender) smtp.mailfrom=oscarfv@telefonica.net; auth=pass smtp.auth=oscarfv@telefonica.net smtp.mailfrom=oscarfv@telefonica.net ARC-Seal: i=1; s=arc1; d=e.movistar.es; t=1754740810; a=rsa-sha256; cv=none; b=p5KFeS6Lf2DiKPFomEowC+f00kmvBE2SGhs1oslvTpli/NH3EqbLqa9e3OsLRw327Xu7wr wRIaaRY8jFQscmLMlItN+fW7GkY9FDNQKTmhqBu2l+VGGAuke7+b6HCA5YZj8dha6KsvdI m1Yxptx9TqhS4dRcKzTxJ7rwrCBo7Z3eJ946uaKmx7WrtGSVzCybDcV4xYUwc6hSWF1iTS Xs4V5ZqNKvl17Om9yNLGo37Qp2GFyZ1q5cQhudvQLpca84Mf5IDlLLSUWmU2Mi6jtxvkt9 5naT3VjeKiJl/x83/836+BWSxNLJ47ILvNBMa8psRgBS3iEItoqYP6TwLG/25g== Received: from sky (161.red-81-39-126.dynamicip.rima-tde.net [81.39.126.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout04.e.movistar.es (relayout) with ESMTPSA id 4bzfbX3wFYz16Jvl; Sat, 9 Aug 2025 14:00:08 +0200 (CEST) From: =?utf-8?Q?=C3=93scar?= Fuentes To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> Date: Sat, 09 Aug 2025 14:00:07 +0200 Message-ID: <87cy94so1k.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TnetOut-Country: IP: 81.39.126.161 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout04 X-TnetOut-MsgID: 4bzfbX3wFYz16Jvl.AE383 X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: oscarfv@telefonica.net X-TnetOut-Watermark: 1755345609.81233@nrPWhU8IWWJQVDyDAKYdDA X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Makes sense: no idea what that is, but it's something with mode-lines, >> and what Pip found out is also the mode-line department.=20 > > And with Pip's patch applied, I can now longer reproduce the problem. Applied the patch to igc (adding the call to detach_marker.) It took a while of monkeying around, but eventually... (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil (351 . 352) nil (#(" " 0 1 (fontified t)) . 351) (# . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("n" 0 1 (fontified t)) . 352) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) etc. Bummer. Looks like the patch puts igc on the same footing as master wrt the required work to reproduce the problem. As a side note, executing igc-collect removed some elements: (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil (351 . 352) nil (#(" " 0 1 (fontified t)) . 351) (# . 1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) nil (#("n" 0 1 (fontified t)) . 352) etc. Note that on my first copy&paste of buffer-undo-list the first sequence of repeated elements was 8, but above it shows 6. The other repeated sequences show a similar change. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:29:26 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 12:29:26 +0000 Received: from localhost ([127.0.0.1]:40643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukihS-0002YD-7t for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:29:26 -0400 Received: from lists.gnu.org ([2001:470:142::17]:33520) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukihP-0002Xe-Sz for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:29:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukihK-0004iH-0S for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:29:18 -0400 Received: from mail-0301.mail-europe.com ([188.165.51.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukihH-0004J4-2a for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:29:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754742547; x=1755001747; bh=VFxCFHBYJtJaYbRH75SmpZOb4VUWNCyS1hVj7sdoC4I=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=rt4SdcJ58aG77Q1tzhQxPWvm9enxJqdVy2ruEos7VZEuDnQ3TYwhICQVH2b4oi2uY Nd9Np2On16sGxQANNuiKX9dU2r3tevHKnapzfgA7Xxr8MzvH5Vy8h3jcm74y4rV8Nj DYLlbj0MeGh/FXSxVWkl2gCfAi2g6GXal1zOzSNCKlSh8SIUGycgbisHF4qghJp+5e G0R634tuz5hqpAwOBH18IVovLu+utUOR+bLdtAQSeeCNbI1MimB3+VWkOyw0u9C/jz +R4FOf9eW+m4c5zcciMjOBllj1F9dUjIkml6VHVN6YQuZborqPwwdu8t1259Ewo8vW 6Kb47lQkPReVQ== Date: Sat, 09 Aug 2025 12:29:02 +0000 To: =?utf-8?Q?=C3=93scar_Fuentes?= From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: <87cy94so1k.fsf@telefonica.net> References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 9ebfc146895742c46c19b4c4516b433d47f1ff2e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=188.165.51.139; envelope-from=pipcet@protonmail.com; helo=mail-0301.mail-europe.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= , 79200@debbugs.gnu.org, Pip Cet via , Stefan Monnier , Pengji Zhang X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > >> Gerd M=C3=B6llmann writes: >> >>> Makes sense: no idea what that is, but it's something with mode-lines, >>> and what Pip found out is also the mode-line department. >> >> And with Pip's patch applied, I can now longer reproduce the problem. > > Applied the patch to igc (adding the call to detach_marker.) It took a > while of monkeying around, but eventually... I'm afraid I must be monkeying around differently; I haven't found a way to produce similar undo lists with the patch applied on feature/igc. Our options here are either to find a recipe which results in what appears to be an undesirable undo list, or to run Emacs in rr and produce one in some way, then inspect the rr session to see where the undesirable markers were produced and whether there's a way to clean up when they're no longer in use. > (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil > (351 . 352) nil (#(" > " > =09=09=090 1 (fontified t)) > =09=09 . 351) > (# . 1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) That's 6 markers at position 364, then two at position 363. Note that it's not necessarily a bug for several markers to share a position; it is inefficient for too many of those to show up in an undo list, but I'm not sure it can always be avoided. > (# . -1) nil > (#("n" 0 1 (fontified t)) . 352) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > etc. > > > Bummer. > > Looks like the patch puts igc on the same footing as master wrt the > required work to reproduce the problem. > > As a side note, executing igc-collect removed some elements: It moved some markers to point nowhere (I'm not sure how, or whether it was igc-collect itself rather than unrelated code that ran, maybe because of auto-saving or a timer). > (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil > (351 . 352) nil (#(" > " > =09=09=090 1 (fontified t)) > =09=09 . 351) > (# . 1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) (# . -1) > (# . -1) nil > (#("n" 0 1 (fontified t)) . 352) > etc. > > Note that on my first copy&paste of buffer-undo-list the first sequence > of repeated elements was 8, but above it shows 6. The other repeated > sequences show a similar change. I don't see a run of 8 markers at the same position. Pip From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:31:48 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 12:31:48 +0000 Received: from localhost ([127.0.0.1]:40665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukijj-0002l2-Ns for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:31:48 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35666) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukijg-0002kO-Tf for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:31:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukijJ-00080p-67 for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:31:21 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukijH-0004fJ-Jw for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:31:20 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-459e72abdd2so16896695e9.2 for ; Sat, 09 Aug 2025 05:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754742677; x=1755347477; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1/zqhP8q4teXIv0ilbHsyltE+XIAAq+0OJmUDluPYdI=; b=aA+LejQCnTYdOXxl7EC/1tgjcJW7wspz6w63wjrRGCVkznvYIzlbsPH4jfGawQp+3z +mHRqS0kSRz5B2rIBUIhSPfkZVzChltF6ONe9mj7V/eqlSw6yTsZdwIWNi49uuXCdPJo HY8p/C4IqdCUu4LedVoK1GSU7/WT0eq9HRaIITyg3eTEoNPkOFDX4M1IZDAZWAlGUX7E slEd88Pt71E7TFNRV1g/XVfp5eGOY6KsFGZN0Oipsr7X0UnrPwIAS139h1Xg2bFnqIBm e8Akgr8y9FQufAK1pIQSdbBe+Qrj1CG7WbYjYlzSRKGEKbs4q5gSbY9rEtDNRl8H46Rx CUKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754742677; x=1755347477; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1/zqhP8q4teXIv0ilbHsyltE+XIAAq+0OJmUDluPYdI=; b=I0SMyxtvHP+IL0Z1T+AtbZi9+TEDrKQ6TcJs46+xN4R6PBXfSzOMHoDit9zGdMD3Fa GGVgk8UkAHO3AaxNoNFnBJnaEAaqSAz0PXzUSP98L00iTFYDct7T0kzic8HmkCEDi1wX BowqkT/FAnJP6AGToy64Ir2XsYFjCncKmRgBA3+0ODxWeUkKWUU8u/53CM4MO9cpkgCp mrbNbk+G3pO84KDV/5LLkUsVKTuVuHTWJFKUk9H/1WkOSAzN39AlqJ/OIyTPq1tEX/wX pok5kApv9sVSYCDYacMQT30842camWueDynKp7quO9ezlA/C8rSidHwYzkAe3VXgCkIw jrDw== X-Forwarded-Encrypted: i=1; AJvYcCUAx2OdFUIiTCUAkwHBcebSD9wHdutwcNKtPFfWMQkahX+gxjUIM1RW480zP16VVuwSVuGNukx03eC1fRK2@gnu.org X-Gm-Message-State: AOJu0YyC6xafHXcSWUPjnII7dMVe/qEAw3xnMVxw6wjTff9IqxwQwQ+j +Y42rwx/XdbSsEEewDMbNtB9kGBtWe3jbpxu7sWEq3eO54QwsXnNo/CM X-Gm-Gg: ASbGncuBuSTZNljPsftcDzaoByPSTMsHI4nZ5sKZQnj6NWdieb/R33cGEaQg0uJitxW JPlY1OkHQz+H/CWnCGXSWcausgSElsRFzRmCNwPSnif9jFJXhc/4mzAyBc15+9usn4JtEPV84yf SeiIJxDlT/b6QAYoXa8aul/WC4q3hXtA4J+eB31aOVSkCUsoUPwUrlkU9o1zqxcNrlgSq+p8jbX bZuWMCNXEMscw7/7et+HQQC5O5kGVx07AOeHJsjROSTpmYXIk3R1/zJDgt0Ai80H4zKcIZV9BkM +NYWJNc4GrdeU31QCGauOnn9ZsBcXUk+qxudplZa197Ltfidte5ToGkVGNchMrOrLJ4301/zo9B 8QoflZaiDPjX14LpOe9gFnNyHSb4EHpEKzkcVE2xD+AzyTYA0arm9pBxURRh3lsnm08KgmeDIcW VYYSJhh8triCbM1cIoUbMwoSMQdGna X-Google-Smtp-Source: AGHT+IG7fmDMBX365Y14dY5TNSRO9cX3bkQ4da7JHKMBi0/9AsUCDqRd7lqzfT6ZtgS/uZ4eCxcDMA== X-Received: by 2002:a05:600c:6819:b0:459:d709:e5c9 with SMTP id 5b1f17b1804b1-459fb7db457mr27320635e9.6.1754742676722; Sat, 09 Aug 2025 05:31:16 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e0cd2c90sm218642215e9.17.2025.08.09.05.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 05:31:16 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> Date: Sat, 09 Aug 2025 14:31:15 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > >> Gerd M=C3=B6llmann writes: >> >>> Makes sense: no idea what that is, but it's something with mode-lines, >>> and what Pip found out is also the mode-line department.=20 >> >> And with Pip's patch applied, I can now longer reproduce the problem. > > Applied the patch to igc (adding the call to detach_marker.) It took a > while of monkeying around, but eventually... > > > (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil > (351 . 352) nil (#(" > " > 0 1 (fontified t)) > . 351) > (# . 1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) nil > (#("n" 0 1 (fontified t)) . 352) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > etc. > > > Bummer. > > Looks like the patch puts igc on the same footing as master wrt the > required work to reproduce the problem. That's something, thanks to Pip! Can you determine if these are different markers (sxhash-eq)? > As a side note, executing igc-collect removed some elements: > > (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil > (351 . 352) nil (#(" > " > 0 1 (fontified t)) > . 351) > (# . 1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) > (# . -1) (# . -1) > (# . -1) nil > (#("n" 0 1 (fontified t)) . 352) > etc. > > Note that on my first copy&paste of buffer-undo-list the first sequence > of repeated elements was 8, but above it shows 6. The other repeated > sequences show a similar change. I would guess igc_collect also does a "weak collection". But it's only a guess. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:49:49 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 12:49:49 +0000 Received: from localhost ([127.0.0.1]:40747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukj1B-0003fw-1h for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:49:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42534) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukj18-0003fS-V8 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukj12-0008Do-Vb for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:49:41 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukj11-00078B-Id for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:49:40 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3b8de6f7556so1630167f8f.1 for ; Sat, 09 Aug 2025 05:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754743778; x=1755348578; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lJtiRXd6cus5Jo8KImRgRpDcpsslhVVIqVS/OgfxXEo=; b=PWHKJwzBggkweQE76X3Igd7Xs3j5JS3UN4+4PyXXYNJcQRFUXPlTnnReMp2nEyrFOQ Uw4ckq7NZGH5isodbpwevcZ9VHmz/5CbbvXr5+L9GlDB8SvnjTUFxbZPLFz8keCK2RA7 NfI+u/9dnj5lOmvtSWkZM9I5ogJX3FH03NwLR0S8dezEoeP2GvNXyoGPz+bGwV/FkWdp 5USdeHLdPqHwiUvoJuSU/PiyDWqDzF16bLW2KkSpJw3xaakuG0aLsXNhafI9KhYwRRXG d8cmJkfoD9aTSKuKMYnp+rhbG2ZUXgKZZnwF1K+ruhF3AZC1myGCo8pc2wR+CTnl65KO 4qaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754743778; x=1755348578; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lJtiRXd6cus5Jo8KImRgRpDcpsslhVVIqVS/OgfxXEo=; b=X34ii39udfkq2Y0q+DGYfW9jL4ttg1XRu32QHB/KhI1HXR4oTftqJ3AV731J0RyPR3 b3aMyKlVTlst7g0MOVPTWFSe5VwMQp1StlLqzK9u1yE92J3V+N+hJjR0TXIkH/PARhgl K/79msLJ20NAdZvJuE10iESnZgKKb0vHLI7WO+DoHKZCOIaO6oYntA4wQzMhb7Vl6xJK OX4Qa0VeXVh4pAS/D5To8iaM63fh8AMrdtV9q7/bByNitG/bDjtoQLMJrAEiJlC14OAM TZVNT+lVkJlKO3CI0lMfqRbn1CD+rVMXPlLKp1HSId+0UVD2iauBBLZPcVm/h4Bunv0X T25Q== X-Forwarded-Encrypted: i=1; AJvYcCVt7mZbuOaPpWuWdJ+q6Sn958uhhK5T64FtFtD8K3XOjuEsShb/oUEwJvHK32yC3aycY1Gpkn+ekFilAGLR@gnu.org X-Gm-Message-State: AOJu0YxHlN87Xra2zig23BlRttnEdHRM0Oc2PWAUXZzUHWKni1/Coyxo Yt7RI9EXAGJ7vezW5wp1gC+gEMkK/k4dAaKbsUurVFVMeimYTy0SXVgY X-Gm-Gg: ASbGncvbEBMU4+ETiHbXAaNmboGrMaYJdaWu/6hDbPfzLkECznxbv4m2HJFttexKv9v mY3pMp2qeVJwvD04RfUYCmlHvDRGNQUD34iW+D9bP5c4vFHKcYg0AmrBwmcMlbMDjKJ0w5m5NJC 6E0sv2L23IAnJLkrF383CIgEjzAp+WeYwbqsZ+wldA2l8HbBca7Z86dw9ZEfdG1uCuZlmJVuwo0 XiCRJNnHM8TXvCAe7OVJAINVG90QZdXMPX1DDtKKBwhEUQ0amRRCHhWsR1RzLw3qnIc9Z9oA8RE GCd2qnwZJRAeSXsfIVYgxpOgRyl0cm8J2oKSh95S3UoiuQBP2exJCTG+aMSTFZsPhfns5MkFHVg b1aDJHfcMwIDxFElpyA34bVTwmnwi+bHJdCqDykku8k99XPMpQWKobKkXPMHfkaXaxLUAjfdTPc DQHevuTJNcZ9EnvQUN36Mxr8RP+MT3 X-Google-Smtp-Source: AGHT+IHUtpLpvGYv8XfQ85IVScFyFNGKQT9d52NJK7rgf7rA1OF8Zffckv6Kpk4xr1mOW71PZD7T3Q== X-Received: by 2002:a05:6000:220c:b0:3a6:d93e:5282 with SMTP id ffacd0b85a97d-3b900b56117mr4857763f8f.59.1754743777616; Sat, 09 Aug 2025 05:49:37 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c475067sm33456203f8f.58.2025.08.09.05.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 05:49:36 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> Date: Sat, 09 Aug 2025 14:49:35 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=gerd.moellmann@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gerd M=C3=B6llmann writes: > Can you determine if these are different markers (sxhash-eq)? And within a group? To find out if it would be worthwhle to coalesce adjustments. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:50:00 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 12:50:00 +0000 Received: from localhost ([127.0.0.1]:40751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukj1L-0003gN-Dj for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:50:00 -0400 Received: from relayout04-q01.e.movistar.es ([86.109.101.171]:27579) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukj1H-0003fv-DK for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 08:49:57 -0400 Received: from relayout04.e.movistar.es (relayout04.e.movistar.es [86.109.101.204]) by relayoutvt04.e.movistar.es (relayoutvt) with ESMTPS id 4bzghr1nRGz40WG; Sat, 9 Aug 2025 14:49:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telefonica.net; s=selectortnet1; t=1754743788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hEVMHGaXS10h7PrUQBfAwk/wryPFcpwjsc+SWYuEEFI=; b=x+bYkOqr37+0dxW2IM0hNzkr2rVMndDfHxwr4JZYtoktFQxosSFe625Kx9Po2x281hNmLo 0aXce7XhRo2aTdBGQluYBktMRWR3caiK8z1B0c5ZVHOglMncXeaAf42BZCK81zC+BHlGo6 TxILsMsDKzatLXq/r8tTpB62FJfynYyXExEdMM2NJjltrG9WEWK0rcboVFkYT+OTCV4gdy EK4M1rYQrq/+4hAPBA9GAvxIJUKA76Ri2Nn9OYgfWOSE/ZrYJHEzWEqjxpV06/c/eRaEce IIzgP6TKoXuiteSKPHqvfY8s82UNYf67bGhMaWbhP/neObxnsQIuie2cEJe1UA== ARC-Seal: i=1; s=arc1; d=e.movistar.es; t=1754743788; a=rsa-sha256; cv=none; b=TghKytAVMaEbAfKG8GbbpFAgRnUHayvGZ/p4VMrV0ePBknxzkfEtczMO/Z/9X+La1rT9FY yn6q/nFhq2EF0j9T5WhF1CJDeEZ2I8V9k7x03WTFQyyCND7mhHEBWZLVFTw4au0zvW7ida ZE+BrktXFC9wIDV9beZdAgIQcXUMmzGgSiA5G57Kxauc5wcb24iS7yA9knomULXKhohZuS aJPzima3GX+qxJ/yn400EtGi6ZRCEl2+hmgTNEuRyJPKPFS9SbOvadu73g7pIBlPXA8Cl4 fWOC1xy6eQ6IawlbnX71tpVHMcnXZml4rVYcIYaFHRhRIzMAIlXWGfQ7SMrcsA== ARC-Authentication-Results: i=1; relayoutvt04.e.movistar.es; spf=pass (relayoutvt04.e.movistar.es: domain of oscarfv@telefonica.net designates 86.109.101.204 as permitted sender) smtp.mailfrom=oscarfv@telefonica.net; auth=pass smtp.auth=oscarfv@telefonica.net smtp.mailfrom=oscarfv@telefonica.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.movistar.es; s=arc1; t=1754743788; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hEVMHGaXS10h7PrUQBfAwk/wryPFcpwjsc+SWYuEEFI=; b=jbKvrbgacE1V5J2U5go3ffLNoqLUWT2xmZDa6eLH4eeyMAkerKVpRPAcEDpekMnfhRBlYg 5Uth/Pmw1c+OLsZbpGLRGrZwzFohaA6+DS029pnwjcaDJ+kpQglKzM0DfzuvSWqBtC8tzH cFi8zbDmdzFE/hV/7VtL1NSg5h4YeT4ZfUZatH7d2+ysGcz/+sPKMjCBSHyb5UnINTV0K/ ov+84oEV1iWosHsqD+l8SGroTqEQg5gzj83mG1LTS/FXDdBLCep+uTafy4SGRpKAGE8pyN jphgabL89Lmtou2KS/mj84vzO8PYO/CJYIEtWNjrZufFnzFoMRawQ5ZcNfD9Xw== Received: from sky (161.red-81-39-126.dynamicip.rima-tde.net [81.39.126.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout04.e.movistar.es (relayout) with ESMTPSA id 4bzghp3Vvpz16JxC; Sat, 9 Aug 2025 14:49:46 +0200 (CEST) From: =?utf-8?Q?=C3=93scar?= Fuentes =?utf-8?Q?=C3=93scar?= Fuentes To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> Date: Sat, 09 Aug 2025 14:49:46 +0200 Message-ID: <878qjsslqt.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TnetOut-Country: IP: 81.39.126.161 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout04 X-TnetOut-MsgID: 4bzghp3Vvpz16JxC.A2059 X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: oscarfv@telefonica.net X-TnetOut-Watermark: 1755348588.01225@mbAudLAac2l1/0SvKQxtrQ X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: >> Looks like the patch puts igc on the same footing as master wrt the >> required work to reproduce the problem. > > That's something, thanks to Pip! > > Can you determine if these are different markers (sxhash-eq)? Yes, sxhash-eq indicates that there are repeated markers, but not into the same sequence. Actually, the sequences themselves are repeated: (this is on igc with Pip's patch applied, but without reverting the commit I identified) # 418927 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 732225 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 420616 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 735044 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 425399 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 733791 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 411420 # 411101 # 416868 # 663376 # 663379 # 678696 # 678699 # 683321 # 683322 # 125961 # 125960 # 736545 # 125960 # 438736 # 398619 # 398618 # 396666 # 125960 # 398618 # 125967 # 125960 # 439505 # 437760 # 436696 # 399181 # 125960 [2 times] # 418927 # 397926 # 125960 [2 times] # 420616 # 400830 # 125960 [2 times] # 425399 # 399510 # 125960 [2 times] # 411420 # 411101 # 416868 # 404453 # 125960 [2 times] # 406678 # 408097 # 405207 # 125960 [2 times] # 240196 # 218066 # 125960 [2 times] # 221331 # 218138 # 125960 [2 times] # 222596 # 223098 # 223963 # 218723 # 125960 [2 times] # 226017 # 220121 # 125960 [2 times] # 216127 # 219420 # 125960 [2 times] # 220218 # 220281 # 125960 nil From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 08:54:57 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 12:54:57 +0000 Received: from localhost ([127.0.0.1]:40771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukj68-0003wB-Mk for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:54:57 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38718) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukj66-0003vk-UI for submit@debbugs.gnu.org; Sat, 09 Aug 2025 08:54:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukj60-0006qW-NE for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:54:49 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukj5z-0007gl-8w for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 08:54:48 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-459d4d7c745so27866465e9.1 for ; Sat, 09 Aug 2025 05:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754744084; x=1755348884; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JOaGFuE2yeHjtRl8vi98xeZy632gKee9UwyHT1D0wjo=; b=iZ2mI3/Jzj/t8/kkZ5ZrmnGOQMVRU9w9ulrsvlpkrDm5MO5sdNDXz3+7bvqgUEfHEx SUSW01joGTJrnVbULFXg4wrHgad2yDDhqkfuU0RFWBgUkTlII9yFQ7603Ulsdw+N3ugm EJcc9rXw8Z/TrMw2HwviO9YIcqaDS4x/GnCooqraxC+g2+ABYOneVtpXpT+BkGXp6TdY rQAh41jfCIv0uiQ5WiN9AKwsay7hfABwcwnsbLgqZlwki1PfTOWyOVtbzScDSv8g3BZW r+6p7sZc+hDatKKEvB9l0AGA/1gzxWqRa5yTHTOzwoqRMpu5Dt2CXDwj9XwjM/KUAJyc 0/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754744084; x=1755348884; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JOaGFuE2yeHjtRl8vi98xeZy632gKee9UwyHT1D0wjo=; b=Ml7F3wERwVBZZEED/vWIKOhPilFzPT4RLE+8d8E3K/M/KszK7G09Afn4ie98AcqH34 C00RDrPiGlqrq/RPSXpQ/UVYRPzTjCFCVL4/DBC0U/2uZIQANJzzndZoWQBAmUXGcK0x uXU3kdlRFvnVoWW6egREDNVFKIOJz451+MSSxr0n/LFRIl2cIsgJF9sHz2fAm2DqUY0K m7Fq0FhSjmsZDUQaWqmpuPRWu+hp4oCuYhOMsltbIPjgVuE4/ZmKRqFvhNeGNtZ++mak 4smVBJnvRSpZ9kMFx+yYi/GU3UgGp0tVt6gTJ7SV+oc0F/LLGu+1/NcXA0ohHGlVoQZm X4NQ== X-Forwarded-Encrypted: i=1; AJvYcCX9xpJFazyrdYEnzffnbpQfLIPJGhLJIuLAoUZBA/EgEcNvT69pblTSnobI8ieUykH2WYhnb/UJNQ7YeM5s@gnu.org X-Gm-Message-State: AOJu0YyQi4mAclT0WuVXsnReDq5Y9vG5AqWafkZ2bCv+BriC/MB6JyKI uZRr7cCd6utnBq4rXJ7y3EBe6q/PIyH3UOUa58SfC4YmLrn6kvSPwuved37bfUYN X-Gm-Gg: ASbGncu/IpqxymQl0Wsd+7teZ6FcnNjCCiUpVkxy7kygma5euxPqNsvMOVkiy/yfT/9 PTUTYmXSbQChuTW+YuZpm87p/y5EwmHtZfZwHN8plh73J32hrBVI8eTtyNp81UC9RwEy/ciOg68 R9ZTKYuKba7RJjNkkxpM7FBC9wvU+uTEFqiUNNoD8C9VRqr8jUiwNvuqYtEcyi3Pb/d7wDpjIUi ymI8FPZqe5Hzmrqvuy9FAhg1ssLBe4ItWhD1MlKyjgyWeCkS/FjEhsFq46XVtjVBRcoO4q1iMeI g0nzj+a24HSvRFl8iZOhZp+9fcN/YcykMqfvq/uX1lICWV5VrBd2BLuS/hJR9ZpXk/GIcpY35+t xrRKeHMhYGFpFf/zenXNJwI3k15xSPdL7c4WGAkrA1JFgTOyVVKzq2qJSA/Fjf3Lx+/XtsTFuet 3HuzVSyv3glcvVzt0LPBeokkSqnx3P X-Google-Smtp-Source: AGHT+IEr6U9vSYj5B9lhCi9C1hOrP4VmiFvIEQmmEn0doUACvfYsjo73rI3zL/UUqHRUeeMDJrtj9w== X-Received: by 2002:a05:600c:45cc:b0:453:81a:2f3f with SMTP id 5b1f17b1804b1-459f4f2dbecmr69929475e9.30.1754744083478; Sat, 09 Aug 2025 05:54:43 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5869cccsm194433425e9.17.2025.08.09.05.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 05:54:43 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <878qjsslqt.fsf@telefonica.net> Date: Sat, 09 Aug 2025 14:54:42 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , Pip Cet , Pengji Zhang , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) =C3=93scar Fuentes =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > >>> Looks like the patch puts igc on the same footing as master wrt the >>> required work to reproduce the problem. >> >> That's something, thanks to Pip! >> >> Can you determine if these are different markers (sxhash-eq)? > > Yes, sxhash-eq indicates that there are repeated markers, but not into > the same sequence. Actually, the sequences themselves are repeated: > > (this is on igc with Pip's patch applied, but without reverting the > commit I identified) Thanks. If they are not in the same group then trying to coalesce entries is not worth it, I think. Maybe another case like that of the mode-line. Without something rr pretty hard to debug (no rr on macOS :-/). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 09:18:54 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 13:18:54 +0000 Received: from localhost ([127.0.0.1]:40856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukjTK-00058F-6Z for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:18:54 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47210) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukjTH-00057g-NO for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:18:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukjTC-0006ud-0v for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 09:18:46 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukjTA-0002qS-Dh for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 09:18:45 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-459ddf83023so18056815e9.0 for ; Sat, 09 Aug 2025 06:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754745522; x=1755350322; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RrZ3XhPc4U/U18JIo9ibG2Bm42trcdpk/pLyiL2XmYc=; b=aXAeqWi/aZrEgkyVtSyn+KO1oiYnG87cEN/CApAu/DJ+k0bvNxg8mGImQDg4km3krU d8APOY9x91bh4qEOJ2ZRHUAoeqA/gUVzpwHnU4w8bZKLH9svgfHOSNmidlAs/c5xBqYL V36u+NwOXPBbiAEkK+uev9euraUpAXHaBdbR2I3hQW81MFItYIhphrHjDGzEjnnHpbqC diVYF7t7Zezslh9fHKgEcYyDubRMzb68pPS2EY2+36gMG7ie5RL5PQKzzQ4RdJROuZvH CTYT+wKBDLHAx0ukXUPDakHRrYtbFvYh0nCP1Ee8tq4TtzcOCCkp/40SMoz1tqUIjK7X cZLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754745522; x=1755350322; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RrZ3XhPc4U/U18JIo9ibG2Bm42trcdpk/pLyiL2XmYc=; b=a4uu5mht3E3cmN4ZWaNCp42sHqfy6rkh/2rZSLr+tB443Go43v6xrw4zzMsxvGAtNC Jl0pejkVD3bS0mRfHaYdEkhCFntEwMiEk+1GwjxcXBrBI5o/D1H4GgYiKq7DRFOLq/o1 4n4EI3/p/kPMi60uaw/fCLoKkFGP6zJAnV7IMiwaB+54IBw/qXFLhu/xlg7YF1tPTV4k 56tkXQWqVZDWnJElcmUEd6bebK1EAcGSp8975wCRI1CwznwHj5qE7uQbhnaBu1gg4pMA xotb7NBje4YF98XoJ6Z4e+rCFCFYMrqQIOJQLDFuiW1mbv5hHnTGX9cAm+ee5gPTzg0M FrpA== X-Forwarded-Encrypted: i=1; AJvYcCXrruXGH8K4SoulVATdgWo1YhgOPDxULNLBpJdvriRkmCzFUXIYa9J8vFk0tONjlS59JQO9BuJ0lsBVLBwF@gnu.org X-Gm-Message-State: AOJu0Yyp+jynQA8WdHCtU0nl4wNZbtBrcA7F2IGa3VGjD8HlYb0JTUQw r/v8sWdqrto0djVipZhNPHzy4DdHp5h323Lh1JB9QEVjk4u1/xMs/j53 X-Gm-Gg: ASbGncss3Aj/oEyAIIrmFldOwENi/mCe/IMBCfpUs1YXnuIifkPmKri1p31pJzpLQj8 uWYRtoIyNuZU9JqDVtjI3XiOx8RajR3d7NQk8mdppbsK5igikZcGyvTNxCrmxW1CpL/1gxNC/E3 RWOug7gAja2Wbn2gB6I0rM/A6XiGI3hg7ZEM6GGokmgNAwGAyNoP+6MDGMUDEm5Rh7eKCI59eo4 ezSZ+0eV7Qt6pmIZRd/dGEDx7dxn17HkTD9+nqC/2ycVmsayB/g7NS2xm2f8sHoxo/s9mxA4O9n NMqvzJGTgf0hPWlkjBW9aYTc8o4C3yzJGNKZ3bZmqTTyFqUXBjZakMtGMFTexETdZouFZEYiqCn yWSquk3Q1+Z1VqANvU9JLWO38OMTRartIk+4/ZrlpoTRuMSEyLdOQIEw8x/MqQWNGW31RgBk5j4 GSQCnwP9ljCCYjFYGoGkT+Qk9enfKE X-Google-Smtp-Source: AGHT+IEl/MbYusXeVOj6E+eZMbFzIkpueM2KwN2x75tZ1Peye+XENrx9mX2MHfFO7cbUhm/ntuwOiQ== X-Received: by 2002:a05:600c:45c7:b0:459:e398:ed80 with SMTP id 5b1f17b1804b1-459f4f3b70dmr48453575e9.32.1754745522046; Sat, 09 Aug 2025 06:18:42 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c469319sm33183786f8f.54.2025.08.09.06.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 06:18:40 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <87a54865nq.fsf@protonmail.com> Date: Sat, 09 Aug 2025 15:18:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , =?utf-8?Q?=C3=93scar?= Fuentes , Stefan Monnier , Pengji Zhang X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Pip Cet writes: > =C3=93scar Fuentes writes: > >> Gerd M=C3=B6llmann writes: >> >>> Gerd M=C3=B6llmann writes: >>> >>>> Makes sense: no idea what that is, but it's something with mode-lines, >>>> and what Pip found out is also the mode-line department. >>> >>> And with Pip's patch applied, I can now longer reproduce the problem. >> >> Applied the patch to igc (adding the call to detach_marker.) It took a >> while of monkeying around, but eventually... > > I'm afraid I must be monkeying around differently; I haven't found a way > to produce similar undo lists with the patch applied on feature/igc. > > Our options here are either to find a recipe which results in what > appears to be an undesirable undo list, or to run Emacs in rr and > produce one in some way, then inspect the rr session to see where the > undesirable markers were produced and whether there's a way to clean up > when they're no longer in use. > >> (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil >> (351 . 352) nil (#(" >> " >> 0 1 (fontified t)) >> . 351) >> (# . 1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) > > That's 6 markers at position 364, then two at position 363. > > Note that it's not necessarily a bug for several markers to share a > position; it is inefficient for too many of those to show up in an undo > list, but I'm not sure it can always be avoided. > >> (# . -1) nil >> (#("n" 0 1 (fontified t)) . 352) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> etc. >> >> >> Bummer. >> >> Looks like the patch puts igc on the same footing as master wrt the >> required work to reproduce the problem. >> >> As a side note, executing igc-collect removed some elements: > > It moved some markers to point nowhere (I'm not sure how, or whether it > was igc-collect itself rather than unrelated code that ran, maybe > because of auto-saving or a timer). > >> (nil (363 . 364) nil (354 . 363) nil (353 . 354) nil (352 . 353) nil >> (351 . 352) nil (#(" >> " >> 0 1 (fontified t)) >> . 351) >> (# . 1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) >> (# . -1) (# . -1) >> (# . -1) nil >> (#("n" 0 1 (fontified t)) . 352) >> etc. >> >> Note that on my first copy&paste of buffer-undo-list the first sequence >> of repeated elements was 8, but above it shows 6. The other repeated >> sequences show a similar change. > > I don't see a run of 8 markers at the same position. > > Pip 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 09:34:10 2025 Received: (at submit) by debbugs.gnu.org; 9 Aug 2025 13:34:10 +0000 Received: from localhost ([127.0.0.1]:40902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukji5-00060M-T8 for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:34:10 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34884) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukji3-0005zn-TW for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukjhy-0000Ck-1b for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 09:34:02 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ukjhv-0004fG-6d for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2025 09:34:00 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-459eb4ae596so26774575e9.1 for ; Sat, 09 Aug 2025 06:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754746437; x=1755351237; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cMLxvgIodNGzTiJCqk+M4kR0CsIzh+R6hrhHoerf/N8=; b=LXWtFXd3fp0muGtgZxqTcGE88hgZrYS9NEdIjyQyyRJBA5ksG40PA9FKucA4dCRwzU 1ZmrCUXPA7FcwW3iUo4U7U2hSye3vSe0aInxhrZOZ3AxmtqiNVamYEiaLJZq1JkUwNbp KRV1Gw4ryCjRJCFHMESxSYlLaV/xlMuO8KLiB7mEg3Kykl+WpO40/excfu2YIms0nBa5 YowTa43Ak4htfN8nP4gMSeClZxggKcDhMK/uVHycZ273NKtJYX/ANG3gVQgWB7uYYzhM v0A1t3E90I+TgfAl0CBQe8V767sO/mH86mzpq0PLfipfkCJc8BbyQmupKr9lfzSsIstZ ak9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754746437; x=1755351237; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cMLxvgIodNGzTiJCqk+M4kR0CsIzh+R6hrhHoerf/N8=; b=UTc78lcpY3slDJc8yyyUvR+FFq5ljWZDLudV3Aa8l6+xfYD7ZAh+LjaR7VHwVnkFU1 AQptuxg+QHwQqs4PGm5bUmQljqsJp/skapn7IGCqKBrUXZBVtHDDyFvMr7QGexEdnkcv mvxOjtYPP8W4mpQ3U36uuTHyrU87gUTRVFIU0yEkNgkTqdnfsRcNRWGmbNONgjD/WNA6 Qs7aJ7u39OEHS5AYB7BZItc7HgyHn5dIh9+F1Q/kK1ECieWP1uu2cJ7ndQv83pkwfoSl winl5tgCt8A9Deobpg8puRkL9lLDb50mWd/SkC0ye9VtWPhb3U/J0QYhKsfCnNLd2pmy dZpA== X-Forwarded-Encrypted: i=1; AJvYcCVXCpBeXASXwv2yfPr/w3ImbTPcVnzTZBZ1KJ+66Sh1ji57+wfJTJYP7DKsuIMYKHmPOICrQbsCHMjDs4RL@gnu.org X-Gm-Message-State: AOJu0Yxu3n/X05iDSTMkSreRXMFAcjZ1sMkQPmHGLRTvWqzhSU3LqJSg 6UXww2jRLQu35lfZz6VGO9PRZoEGN6gDMcWfoSH+Odg3kLec8LIkn4G3 X-Gm-Gg: ASbGnctRNaha0UIrXfMPrj8pqbeCRgp6y05AyEMd5RBaZMNVbqvEAlxlw5+TBKMrLo2 3BkeH1WxulQkSRY3Z3Qn0UBh6FhXd6oglXKltdUPzFhnsCkpxatj6e2CDC76iE6kRO5fd5qr5Lb R7Hr1/ej8whCs7b/4OH+DtVLyKQurcZFwMCNqhUPYSS3X3YeJCuJRsnZWcZipyYaSNU32EKWHMh WFvSCbDwLMIzcYEHYoj3Adflx2SN8qHITDZOTsH+jMUrVdleZjpsR8nGNquPth1Epry6QMfG/3F /cL1JNr4oUrV6RYp0kBjkAaxoUP9i/SySRav7SM2vZXvb7va5raMGKGuQIhA7RneGBZEmOemVGt yh2RLVGZyN3Ox/yYuLLPy/1AgwQrEUPjgWr0G5JYDFjCCjCbFEnsOYrTC71KezX8ERXn8m4RQA2 b6DrUVAEaBLmOrH7kihNqGYJvyZfDJ X-Google-Smtp-Source: AGHT+IFpIXDfANcoMOCXqLcJGewAS+hLqAdD8hGUn4n85R/FbtgkA5eOc2Wd7SFjVb28nEQEcIKhEQ== X-Received: by 2002:a05:600c:46c7:b0:458:bdd1:b7ef with SMTP id 5b1f17b1804b1-459f4f9b21amr56113515e9.19.1754746437282; Sat, 09 Aug 2025 06:33:57 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5e99e04sm174959985e9.11.2025.08.09.06.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 06:33:56 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <87a54865nq.fsf@protonmail.com> Date: Sat, 09 Aug 2025 15:33:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: 79200@debbugs.gnu.org, Pip Cet via , =?utf-8?Q?=C3=93scar?= Fuentes , Stefan Monnier , Pengji Zhang X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gerd M=C3=B6llmann writes: > 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? jit-lock uses this, which turns undo recording off subr.el: 5253 (defmacro with-silent-modifications (&rest body) 5254 "Execute BODY, pretending it does not modify the buffer. 5255 This macro is typically used around modifications of 5256 text properties that do not really affect the buffer's content. 5257 If BODY performs real modifications to the buffer's text, other 5258 than cosmetic ones, undo data may become corrupted. 5259=20 5260 This macro will run BODY normally, but doesn't count its buffer 5261 modifications as being buffer modifications. This affects things 5262 like `buffer-modified-p', checking whether the file is locked by 5263 someone else, running buffer modification hooks, and other things 5264 of that nature." 5265 (declare (debug t) (indent 0)) 5266 (let ((modified (make-symbol "modified"))) 5267 `(let* ((,modified (buffer-modified-p)) 5268 (buffer-undo-list t) ^^^^^^^^^^^^^^^^^^ Maybe there specbinds missing somewhere. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 09:46:25 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 13:46:26 +0000 Received: from localhost ([127.0.0.1]:40938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukjtx-0006gO-5s for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:46:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59804) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukjtu-0006g5-CG for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 09:46:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukjtn-0006Vk-M5; Sat, 09 Aug 2025 09:46:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Binh9g+BnuSp17PsK9AxQNraYR9ZmxKzh7qtwO3OQkQ=; b=VUx0UOmq43AEEAgvrgIx P+WqL/s+nTqoStiq3HO1RdoMKyGPFvTBLyJM9/jHHKcfojw65StznxyxKKZYkXs8SXufUgr5aaL7e 3gUHnDblv517WYjMfzoLr5fkZsArQElde7Ed0BdziyeH5bXZyr5BHjNwEQQnA5ZVDMgE2tFcyrC0r UQK+fzlQEN2+7/BSBigS+oh0lsteptxVLqA/UoR+qqVqBDeZDCwcY1qQP4QZ/rhvbAP4zSyYvKM8A uqNCJpw2mSMT775RNC5tZaR6YtD4iuGegBQTM7tZq5cFfvILAx2UGFdcap/oIIdWAV+gn3X852/Qm nt7pglMkRrwo9g==; Date: Sat, 09 Aug 2025 16:46:11 +0300 Message-Id: <86bjooliak.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Sat, 09 Aug 2025 15:18:39 +0200) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <87a54865nq.fsf@protonmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, pipcet@protonmail.com, oscarfv@telefonica.net, monnier@iro.umontreal.ca, me@pengjiz.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 79200@debbugs.gnu.org, oscarfv@telefonica.net, monnier@iro.umontreal.ca, > me@pengjiz.com > From: Gerd Möllmann > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 09:51:26 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 13:51:27 +0000 Received: from localhost ([127.0.0.1]:40953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukjym-0006uO-Ul for submit@debbugs.gnu.org; Sat, 09 Aug 2025 09:51:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55832) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukjya-0006ts-8X for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 09:51:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukjyT-0007Di-P7; Sat, 09 Aug 2025 09:51:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=na8O11vIckCPY4KBCLCQkr9jvR5VLHDZhJtreFfWmts=; b=leZzkVmE6fsBK5MtWsoA vnrx8i+zp0f11bNZm03bCckw6RXkPQfcO92h0wjWq4oMkeM3RvEBpxHJSooeSMbSl+WGhFMte1M1T nLDXFvYwCWhwxoKaZQDYXzTOhsOcbIqpFrgIWakkYJd9Q+pbrzjCvABxAxTVI+oHY7gjdWfQV3zpC KfP3KUIURFjGGfweKYtgCS7y6s+lqExZieJ82at/YQpKjkj6qlkeYgLZJRGBdn7b18zRzmxrhLTsi ZTjiY8zDoHjKy/QcJmbbrOiZqQKLLAbavNrCwAYKfc7hEKGh+XNx092OLJOfep/OKjIwSFSxvm3YT UUitsYT3MaYXmQ==; Date: Sat, 09 Aug 2025 16:51:03 +0300 Message-Id: <86a548li2g.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Sat, 09 Aug 2025 15:33:56 +0200) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <87a54865nq.fsf@protonmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, pipcet@protonmail.com, oscarfv@telefonica.net, monnier@iro.umontreal.ca, me@pengjiz.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 79200@debbugs.gnu.org, oscarfv@telefonica.net, monnier@iro.umontreal.ca, > me@pengjiz.com > From: Gerd Möllmann > Date: Sat, 09 Aug 2025 15:33:56 +0200 > > Gerd Möllmann writes: > > > 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? > > jit-lock uses this, which turns undo recording off > > subr.el: > 5253 (defmacro with-silent-modifications (&rest body) > 5254 "Execute BODY, pretending it does not modify the buffer. > 5255 This macro is typically used around modifications of > 5256 text properties that do not really affect the buffer's content. > 5257 If BODY performs real modifications to the buffer's text, other > 5258 than cosmetic ones, undo data may become corrupted. > 5259 > 5260 This macro will run BODY normally, but doesn't count its buffer > 5261 modifications as being buffer modifications. This affects things > 5262 like `buffer-modified-p', checking whether the file is locked by > 5263 someone else, running buffer modification hooks, and other things > 5264 of that nature." > 5265 (declare (debug t) (indent 0)) > 5266 (let ((modified (make-symbol "modified"))) > 5267 `(let* ((,modified (buffer-modified-p)) > 5268 (buffer-undo-list t) > ^^^^^^^^^^^^^^^^^^ > Maybe there specbinds missing somewhere. I don't think so. The additions to buffer-undo-list are because of deleting some text, and that cannot be disabled. The problem we see is because there are many-many markers where the text is deleted. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 10:06:37 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 14:06:37 +0000 Received: from localhost ([127.0.0.1]:42620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukkDU-00081D-DX for submit@debbugs.gnu.org; Sat, 09 Aug 2025 10:06:37 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:57362) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukkDL-00080q-1S for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 10:06:33 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3b794a013bcso2415485f8f.2 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 07:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754748381; x=1755353181; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hT5J7GI7CjC6jhySXefuvZxIbfpUB7XEFwNR/a8chdU=; b=bZX4PqOgRsZNsx5THKy+nu29GubZZZJYkqfJeuFV2D9P9f1GvjglmxmYkTQsJG8HW+ UGYLITdoYiTr4W5FijIx+Z4F40f8DlsXQP0jb4Y0N9G5eilO0GgY+5fqcT4CfrYgWjts pbFpjIyeyEP6C5EnldQYtzeRbGEPT8A48y9pDGXRKoQHiTmZUiKBIYfT9osQE0n5uDnn EP9kXftWLIKSXZ2ZI2EX2Hh9I4eVhRa8t+H0vdGTjM+tbtIOjxpTpmStko6oHzXYv5c7 cDYKt5zB/a4vU89jQYsAUpp+bP655rEcjoihFk5BFeaXDqAPaQID8ATy1MY+e+xhjzVe MFQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754748381; x=1755353181; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hT5J7GI7CjC6jhySXefuvZxIbfpUB7XEFwNR/a8chdU=; b=JewOs0pfB4/CIF6ewzstq56032gJ16//0k4IpBxdLZnSYRGb+cSRVYrx2TGpBqeMxK mqHYZtULPB84jtQCeclfyp6QpZRQizedEdoA0bNadlELtdDSDJVe8O40oCUVTm60bZM4 HFMXb10xbHUB8W+1n0WtCpuTJRdYWSRldU/YRsrRBknRicfrMHdBmjRT76PqgMObFvPi CboQfptlgbTl7FgX3SRnN1D+BaDyhGReOjKkYStXcREiumn77JAReD8MxYBLjHNPQk+j GfJJpBv3unZOruIDQpMTGrThlXnJ1V0u0eh5XhL0pqonZCGS7mf0Cczqj7NO4LVfw+jp MM3w== X-Forwarded-Encrypted: i=1; AJvYcCVttZpCWH2w/9AdF1yuoGx7ao4bV8NNr/KXI8VlXQzCYNPVLVm4iT+FtvGTnTZ3d2ze7zz9+A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw9WhRAlUwCGGTVrhRH7d9q+gAOXcOAGFRLO23u4M5ESGQJx2Ld 6UtaVZmMZNkONf31/2uTYeVNjE5xONyOVjX4mdeXC2DeaIQdGlvShWvG X-Gm-Gg: ASbGnct2BFP7NPiSvwKjblPi58yWwAPSt97jIi4LhX9rRcW6cW4SRyIeICSwXzTGCRM OyWA17l+PLWacObUilYpF3b6WlESUxDEke/WZxeKkKkRHknz3mHhsuaZLBRFnoTac6lkB55HacA TLb6LTylKsz1Dv8GA9MmnwGDb5kskcLINC8eZrN7TlDAb0vARMeVQGBA9EVUYIJ2mMmOaWDP9oO DoKOg3OX50pH9qLjZdPP4I7w5XfwGQrRe4/zoSpPilDG9TB3jCoTh/sR2iejjND/hkFZAR8GA3b 7w1ImYEsSpmWjYJS0roq0y4Kn8NyD5cxq/rnmyfdhQDmMVWfQEYF7TuEWKUhNjvhDjsllsp5xyl SB+r9MRAmBi3dpCbOuhW/OTKebGr7YhrS+gayyrXojDon5vOinZhhnTGJuW/skhbN+KZQdShYWy 8rDmj9QP1t2VxyTNDBl8wFeRlOnsBN X-Google-Smtp-Source: AGHT+IGKyUF8LH2fzaNYDuL+MGKYsXbZbixSWTczQtSWhqmv4dyb2rIxX2at1SUlbKoMFcqOjTU2jA== X-Received: by 2002:a05:6000:4210:b0:3b7:8d70:dac5 with SMTP id ffacd0b85a97d-3b900b471b2mr5767734f8f.2.1754748380478; Sat, 09 Aug 2025 07:06:20 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3c51e2sm33017787f8f.32.2025.08.09.07.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 07:06:20 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87zfc86fjd.fsf@protonmail.com> <87ms88sr4h.fsf@telefonica.net> <87cy94so1k.fsf@telefonica.net> <87a54865nq.fsf@protonmail.com> <86a548li2g.fsf@gnu.org> Date: Sat, 09 Aug 2025 16:06:19 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, pipcet@protonmail.com, oscarfv@telefonica.net, monnier@iro.umontreal.ca, me@pengjiz.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Cc: 79200@debbugs.gnu.org, oscarfv@telefonica.net, monnier@iro.umontreal= .ca, >> me@pengjiz.com >> From: Gerd M=C3=B6llmann >> Date: Sat, 09 Aug 2025 15:33:56 +0200 >>=20 >> Gerd M=C3=B6llmann writes: >>=20 >> > 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? >>=20 >> jit-lock uses this, which turns undo recording off >>=20 >> subr.el: >> 5253 (defmacro with-silent-modifications (&rest body) >> 5254 "Execute BODY, pretending it does not modify the buffer. >> 5255 This macro is typically used around modifications of >> 5256 text properties that do not really affect the buffer's content. >> 5257 If BODY performs real modifications to the buffer's text, other >> 5258 than cosmetic ones, undo data may become corrupted. >> 5259=20 >> 5260 This macro will run BODY normally, but doesn't count its buffer >> 5261 modifications as being buffer modifications. This affects things >> 5262 like `buffer-modified-p', checking whether the file is locked by >> 5263 someone else, running buffer modification hooks, and other things >> 5264 of that nature." >> 5265 (declare (debug t) (indent 0)) >> 5266 (let ((modified (make-symbol "modified"))) >> 5267 `(let* ((,modified (buffer-modified-p)) >> 5268 (buffer-undo-list t) >> ^^^^^^^^^^^^^^^^^^ >> Maybe there specbinds missing somewhere. > > I don't think so. The additions to buffer-undo-list are because of > deleting some text, and that cannot be disabled. The problem we see > is because there are many-many markers where the text is deleted. Right, thanks. It goes like this (call graph, incoming): - record_marker_adjustments undo.c:127 - record_delete record_delete:187 + casify_region casify_region:555 + adjust_after_replace adjust_after_replace:1408 + replace_range replace_range:1639 + del_range_2 del_range_2:2030 + record_change record_change:201 Hm, so binding buffer-undo-list would have no effect. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 12:00:27 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 16:00:27 +0000 Received: from localhost ([127.0.0.1]:42844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uklze-00052c-Vt for submit@debbugs.gnu.org; Sat, 09 Aug 2025 12:00:27 -0400 Received: from mail.muc.de ([193.149.48.3]:51707) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uklza-00052F-8o for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 12:00:25 -0400 Received: (qmail 55812 invoked by uid 3782); 9 Aug 2025 18:00:14 +0200 Received: from muc.de (p4fe15475.dip0.t-ipconnect.de [79.225.84.117]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 09 Aug 2025 18:00:14 +0200 Received: (qmail 792 invoked by uid 1000); 9 Aug 2025 16:00:13 -0000 Date: Sat, 9 Aug 2025 16:00:13 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , acm@muc.de, Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, everybody. On Sat, Aug 09, 2025 at 10:29:15 +0200, Gerd Möllmann wrote: > Óscar Fuentes writes: > > 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. > Interesting. I come from a slightly different angle, that in my mac+igc > port I had sometimes only 3 undos before I got "no more undo > information". and I thought I had messed up something. > My cimpler recipe is > 1. Make a new buffer x.el > 2. Type an a > 3. undo > 4. C-h v buffer-undo-list I have an equally simple recipe, which suggests undo is not the culprit. Note step 3. 1. emacs -Q 2. Type asdf. 3. M-: buffer-undo-list. This gives: (nil (148 . 152) (t . 0) nil (1 . 148) (t . 0)) 4. Type . 5. M-: buffer-undo-list. This gives: (nil (#("f" 0 1 (fontified t)) . -151) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) (# . -1) 152 ...) [ That enforced dumning down of the output by truncation is most annoying. I haven't found a way to get a complete output. ] Unlike other people here, I see this in the emacs-30 branch, too. > => > Value: > (nil ("a" . 1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) (# . -1) > (# . -1) nil (1 . 2) (t . 0)) > Local in buffer x.el; global value is nil > So far I can't see what is the cause. I would have guessed something in > or around primitive-undo, but that hasn't changed forever. My theory is that the cause is general poor marker hygiene. In the elisp manual, there is (or was) a recommendation that after finishing use of a marker, one should remove it from the buffer's list of markers with (move-marker foo nil) (or the C equivalent). There are lots of places (probably several hundred) where this is not done. I tried gdb with a break point on Fpoint_marker, but every hit I got (about 15) was from save-excursion, which does clean up the marker it uses for point. I tried disabling inessential features like font-lock-mode, and setting post-self-insert-hook to nil. This made no essential difference fo buffer-undo-list. [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 12:30:41 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 16:30:41 +0000 Received: from localhost ([127.0.0.1]:42882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukmSu-0006Ql-Ah for submit@debbugs.gnu.org; Sat, 09 Aug 2025 12:30:40 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:45125) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ukmSo-0006QM-M8 for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 12:30:38 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3b78310b296so1594454f8f.2 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 09:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754757028; x=1755361828; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jleQz8GmytTrN2Aa0QqTdfVy0edNFKzNzydCvl5JB+U=; b=Mq+h98UzbZl3EpdCdzgkK4kPgoKBLiaPPV8eBKJRcq+phIYszn7N/Jk9Grj+QtQnRS Kkt0vv8N64mDEL9a0t+cE5MpyU6TxxjfTDXcr93s/XRcSGSW59K4fBjxSgWcOIbJRaKt o8ANy5T/+EAITxGDwVOy8tEmt9Q1Ocuewx322vZ65k8ZgUWMqtByT4ynccAGC1M8xx1g jx19rD9Ph6Oe/ZR4HaC0uhXjjmF+uhWmLAF4DFQCkFN6IriC+Ym/LnsTk89FsOcj22en TmQRHFOzlXxcpqiejklv5dnM3ZEHEBH74VFkybCOiSDv+qAKr2XJCI9yDJtPvdwIYQgQ rdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754757028; x=1755361828; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jleQz8GmytTrN2Aa0QqTdfVy0edNFKzNzydCvl5JB+U=; b=IxuKVlmdJYetVeUlNnwQuoTbX9zmBdliZYodIr80umxQZYLc1APH9mx5iepM6JJr0T G5JblQzjkoMGJbICwyZNglALfVeuVrBapQadq+TKbwu3EYyiSQld+hbkRIUaZYUuP+NO MviO9Lxqqdvdw9f5FBzk1DXI9CUq0oZGFsMfddIKeDo9JiX9JJcgdQITYmiZBcwD5cKc AmDDS3fmZ3o7WkyeuQmGalB0xbt/4ys26pUn4fnkfugC68N1UWCGvh3SqTKnSgx26U/R Eb4A9gYazL42h6oYMoopcm7qu+BtidlIJCrvBNSYLOhiXXi2YWeK0NlESAEXfvLTDUPw vDhw== X-Forwarded-Encrypted: i=1; AJvYcCVek0zSm3ZMvVrFVetEwnoRtdCPns2J1hLabsAs5bAHAoc51smqfrF06Yw/yiEJQNVwiKxcMA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy2mim27+drBW1fMWNoJmqIQZQdcy9hH4wmlGCprrYoO5FjpIvd i5zmjq5gHh1W0SEOY0HZctuQz1KuahHcwXr+t7tkaVlk/FaHEQ1RLfAY X-Gm-Gg: ASbGncsDwYVmQo0+Gvz37f5KzXsA8E133kaZPddIPGbt45rwx3ttHkZvw9P38Tk7Okb /tVSxI1O6hf/daKJ1+V/iCceM7ItpM7Lk4esOsm/6qZp4iy3rlTNrHZh7c6Yt6b/5SYh+JDhUUR jBZbKY8G/oHQrfMOXKgUi0t4b1FYBWno+Z5/dgf/Ceo8X1GqVdW5E3sbSYysg3qZNl1SxvTNWzY tH0dOISxPrPgnL4HkdIyV5xPVl+GX1gZ/g3+wn9UUG6ePJYCDkcCPGq+UZ9X3dsM3Nd1zDJrRSf RYaVrcJMWER3Oy4vb6jjajJIR2FuPpeUKEGDVO79W141MRgbviN/gHZlSo9pJtt1IutNn8Q9/So IKESq+HA6avH1CLVOWOWX5aeKzWh8CeH5BH84Ayz6YtKACZR8AkLFmwo0Ndfxh+AnHkz3Io384s C5O5bf4URhWsAm35z6gXdwa5jUisSa X-Google-Smtp-Source: AGHT+IH939RCrlqOk0tD5vYIVxr16DtUgU3mKG8Uej1YOG4XmK2EOCf39MvNHxoFCBViNHLrtcOG7w== X-Received: by 2002:a05:6000:1a8d:b0:3b7:8851:659 with SMTP id ffacd0b85a97d-3b900b2dda4mr5476295f8f.19.1754757028157; Sat, 09 Aug 2025 09:30:28 -0700 (PDT) Received: from pro2 (p200300e0b7037300047e052d440c10bb.dip0.t-ipconnect.de. [2003:e0:b703:7300:47e:52d:440c:10bb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e577d0f5sm183225455e9.0.2025.08.09.09.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 09:30:27 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> Date: Sat, 09 Aug 2025 18:30:26 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Hello, everybody. Hallo Alan! > I have an equally simple recipe, which suggests undo is not the culprit. > Note step 3. > > 1. emacs -Q > 2. Type asdf. > 3. M-: buffer-undo-list. This gives: > > (nil (148 . 152) (t . 0) nil (1 . 148) (t . 0)) > > 4. Type . > 5. M-: buffer-undo-list. This gives: > > (nil (#("f" 0 1 (fontified t)) . -151) (# > . -1) (# . -1) (# *scratch*> . -1) (# . -1) (# 151 in *scratch*> . -1) (# . -1) > (# . -1) (# . > -1) (# . -1) 152 ...) > > [ That enforced dumning down of the output by truncation is most > annoying. I haven't found a way to get a complete output. ] (I think M-: (pp buffer-undo-list) would do the trick for the truncated output.) > > Unlike other people here, I see this in the emacs-30 branch, too. Yes, make sense. After Eli's hint, I found this incoming call tree: - record_marker_adjustments undo.c:127 - record_delete record_delete:187 + casify_region casify_region:555 + adjust_after_replace adjust_after_replace:1408 + replace_range replace_range:1639 + del_range_2 del_range_2:2030 + record_change record_change:201 where record_marker_adjustments puts basically all present markers in a buffer's undo list. del_range_2 I would interpret that any text deletion might do that. I think a garbage-collect with the old GC will clean up the undo list eventually by calling compact_undo_list. With MPS, that doesn't work. The cleanup in compact_undo_list cannot be used because MPS's weak objects and GC work completely differently. At the moment I'm a bit out of ideas. Waiting for a divine inspiration, so to speak. > >> => > >> Value: >> (nil ("a" . 1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) (# . -1) >> (# . -1) nil (1 . 2) (t . 0)) >> Local in buffer x.el; global value is nil > >> So far I can't see what is the cause. I would have guessed something in >> or around primitive-undo, but that hasn't changed forever. > > My theory is that the cause is general poor marker hygiene. In the elisp > manual, there is (or was) a recommendation that after finishing use of a > marker, one should remove it from the buffer's list of markers with > > (move-marker foo nil) > > (or the C equivalent). There are lots of places (probably several > hundred) where this is not done. Yeah, for sure. > I tried gdb with a break point on Fpoint_marker, but every hit I got > (about 15) was from save-excursion, which does clean up the marker it > uses for point. > > I tried disabling inessential features like font-lock-mode, and setting > post-self-insert-hook to nil. This made no essential difference fo > buffer-undo-list. > > [ .... ] Yes, see above. I think it's that adding to the undo list when deleting text (at least when deleting, haven't checked), and the creation of many markers. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 14:28:35 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 18:28:35 +0000 Received: from localhost ([127.0.0.1]:42995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukoJ1-0003L9-6g for submit@debbugs.gnu.org; Sat, 09 Aug 2025 14:28:35 -0400 Received: from mail.eclipso.de ([217.69.254.104]:44382) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukoIw-0003Kq-IN for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 14:28:33 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754764103; bh=iF6L8qUY+6mn3EwnvjPk7di9T9Lo9ixj1sIZxzWNmBc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MnKo9B8emajjKv12aYaBk8XBWQIYisigudDCrntFMVuSVvMeN/di7pMJuQdBiQWhb 4SykI/u7pX61WxB0UaQxh5Co9ZAy+Xq2ITqk5ELWj4f6RNemD0eLmDEN7bco9jXFwV o0DaT2vh26yCDffBXxdR7p5MAtHshn98oKACT/09609k37UsakrHhm5l210EhEZodI nnexu4Vyy6s7aYbGkGjwl2eHZkH77r9m+I8Q4vaQRajzGf2cweiS6laYo6o5e5XAfn kFw9ohJxUZGS9V8g0b3Q+qSha9goMzzHeW6tD0jhdlR2sIO27YtfHcaE37npKfQ8pf 9BRLlbknGrzwg== To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> Date: Sat, 09 Aug 2025 20:28:21 +0200 Message-ID: <871ppks62i.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , 79200@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Alan Mackenzie writes: > I have an equally simple recipe, which suggests undo is not the culprit. > Note step 3. > > 1. emacs -Q > 2. Type asdf. > 3. M-: buffer-undo-list. This gives: > > (nil (148 . 152) (t . 0) nil (1 . 148) (t . 0)) > > 4. Type . > 5. M-: buffer-undo-list. This gives: > > (nil (#("f" 0 1 (fontified t)) . -151) (# > . -1) (# . -1) (# *scratch*> . -1) (# . -1) (# 151 in *scratch*> . -1) (# . -1) > (# . -1) (# . > -1) (# . -1) 152 ...) Thanks Alan. > [ That enforced dumning down of the output by truncation is most > annoying. I haven't found a way to get a complete output. ] I use C-h v buffer-undo-list which has no qualms about displaying thousands of lines. > Unlike other people here, I see this in the emacs-30 branch, too. Interesting, because the commit I bisected as the cause (6f494d74f64) is only in master and igc. There is something much more general at play here, as you suggest. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 14:30:54 2025 Received: (at 79200) by debbugs.gnu.org; 9 Aug 2025 18:30:54 +0000 Received: from localhost ([127.0.0.1]:43003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukoLF-0003W9-UY for submit@debbugs.gnu.org; Sat, 09 Aug 2025 14:30:54 -0400 Received: from mail-24416.protonmail.ch ([109.224.244.16]:50205) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukoLC-0003Vr-1j for 79200@debbugs.gnu.org; Sat, 09 Aug 2025 14:30:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754764243; x=1755023443; bh=fFCZ7HY0qZTTZiVaodpvGlDVtjrNog6nSus69vS8tKg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=nG8KHG94j8FmTWjtwO+lte+cYwxnbZ1cKp23OrXINWviELvmoLsk0gsrTLYLV+Dq3 PHGMuNtQN6z8HzSYlfjvb6pCl9jGg52shJBNYmmtZJFvZMtW9JtPBltZGfGo9k4Wvy pgU2cov5m8dyhed03wt20CSfniBU7Nxe2FS4V0S6MCjlMqrxT+J07RmeKy8MQGuFDA YIiAAWwjaoo7PASPKDgSYmekR/I4JAwfvWnDXO+G7ypAVnxbocrvAXy2dHDrIP7fxd ZNG9JyBEdQbQBkIiWBHSPgBZJ7dBlZA9947q4NzXOVOoPDE4cEdoug1US7S2CJ5obl 4M1JdHk2hnd2A== Date: Sat, 09 Aug 2025 18:30:37 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: References: <87h5yhu5ko.fsf@telefonica.net> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 9284d517d28493591649fd88241a4734b6a378db MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Alan Mackenzie , Stefan Monnier , =?utf-8?Q?=C3=93scar_Fuentes?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Alan Mackenzie writes: > >> Hello, everybody. > > Hallo Alan! > >> I have an equally simple recipe, which suggests undo is not the culprit. >> Note step 3. >> >> 1. emacs -Q >> 2. Type asdf. >> 3. M-: buffer-undo-list. This gives: >> >> (nil (148 . 152) (t . 0) nil (1 . 148) (t . 0)) >> >> 4. Type . >> 5. M-: buffer-undo-list. This gives: >> >> (nil (#("f" 0 1 (fontified t)) . -151) (# >> . -1) (# . -1) (#> *scratch*> . -1) (# . -1) (#> 151 in *scratch*> . -1) (# . -1) >> (# . -1) (# = . >> -1) (# . -1) 152 ...) >> >> [ That enforced dumning down of the output by truncation is most >> annoying. I haven't found a way to get a complete output. ] > > (I think M-: (pp buffer-undo-list) would do the trick for the > truncated output.) > > >> >> Unlike other people here, I see this in the emacs-30 branch, too. > > Yes, make sense. After Eli's hint, I found this incoming call tree: > > - record_marker_adjustments undo.c:127 > - record_delete record_delete:187 > + casify_region casify_region:555 > + adjust_after_replace adjust_after_replace:1408 > + replace_range replace_range:1639 > + del_range_2 del_range_2:2030 > + record_change record_change:201 > > where record_marker_adjustments puts basically all present markers in a > buffer's undo list. del_range_2 I would interpret that any text deletion > might do that. I think it may make more sense to find out who goes around creating markers and not cleaning up after them. But I suspect many places cannot easily be fixed because the markers might be exposed to Lisp. > I think a garbage-collect with the old GC will clean up the undo list > eventually by calling compact_undo_list. With MPS, that doesn't work. > The cleanup in compact_undo_list cannot be used because MPS's weak > objects and GC work completely differently. That's my understanding, too. And it means that this probably isn't horribly important to fix on the master branch. On feature/igc, it looks like something has to be done. > At the moment I'm a bit out of ideas. Waiting for a divine inspiration, > so to speak. Maybe some markers could be marked at creation time as not being important enough to be recorded in the undo list? I'm not really sure which markers are being recorded and which need to be for undo to work. Pip From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 00:45:31 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 04:45:31 +0000 Received: from localhost ([127.0.0.1]:43596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ukxw3-0003WG-27 for submit@debbugs.gnu.org; Sun, 10 Aug 2025 00:45:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52296) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ukxvy-0003Vs-Qz for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 00:45:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukxvq-0003qv-QX; Sun, 10 Aug 2025 00:45:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=1ZRS9j/sAcf4/w3+YERqZlUvsZMUVi3XaTs7lezKxwk=; b=NgQ2VpH8ytB1mSNfJoSV V/R8JKLvZBkubug/bzQl/BIyIsEgRAyjdqPqDEdkdAh2DnOpnloupF0ueLfysshbmO8fE5BBEQrdu QQjLYEg6RZH+e3fEwtj5tII+q9HDBcb46Wx9Lcg5po7r2pZg3uGfUMP7FRCCU9zsP1xfz0RDOr3ZV VvoSdCGXUwMSx1k4oCXBOBaJ83jM73TKXsRKPHMXb0TPve78l+FccU17DRoDCFLKbsvTCx7BFCNL/ bZjZJVPbSL1vEDXyDuUpCbadr5x5f0gQpaFEQWIAh/gP7ieUMduoJJVkq5u1PXaJ54pTio5WVTh8w m6u48geovGcTJA==; Date: Sun, 10 Aug 2025 07:45:14 +0300 Message-Id: <864iuflr8l.fsf@gnu.org> From: Eli Zaretskii To: Pip Cet In-Reply-To: <87v7mw4aco.fsf@protonmail.com> (bug-gnu-emacs@gnu.org) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87v7mw4aco.fsf@protonmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: gerd.moellmann@gmail.com, 79200@debbugs.gnu.org, oscarfv@eclipso.eu, monnier@iro.umontreal.ca, acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 79200@debbugs.gnu.org, Alan Mackenzie , > Stefan Monnier , > Óscar Fuentes > Date: Sat, 09 Aug 2025 18:30:37 +0000 > From: Pip Cet via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I think it may make more sense to find out who goes around creating > markers and not cleaning up after them. Isn't that format_mode_line_unwind_data, which you found, and the missing detach_marker call? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 00:56:00 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 04:56:01 +0000 Received: from localhost ([127.0.0.1]:43618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uky6C-0003yA-Ge for submit@debbugs.gnu.org; Sun, 10 Aug 2025 00:56:00 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43206) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uky66-0003xp-Jw for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 00:55:58 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3b7848df30cso2378306f8f.0 for <79200@debbugs.gnu.org>; Sat, 09 Aug 2025 21:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754801748; x=1755406548; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=rT4tJ/GL1nxDRlxq8HfJYcyureZ0Hx+An+BsIwj1Ias=; b=MvTFbyAv8n7BnF9E/F3minXrN8Ueo7Jb0v58/+wRHE8BXhaLJ7LxVZkpE8Qj47WInq 9FM7J6CjH+mYfF1byaSNVbEezFmm9uquQ5KOM5+6liIK2Jr/fP+ESNixdzg3geoiKRQt O0gmi8PY42qBvP9wXoSngYJKevaICY+5k41x7mfZ49C1Uz/5R5wsqIkfmLceryYMRAlP +VaHov6SAVLOkSHnHf+YlvWgWCAmsnbEEDu0mp7D75vvonlluC0X9J5+i5mzyjLGFSj4 7LiUjngzkbnA8Yd0FbZ8n9Z7RMmVLfmhj3O1Y4g56FYOu9vVBSw2YFiAxaxIfevoDa09 dxfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754801748; x=1755406548; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rT4tJ/GL1nxDRlxq8HfJYcyureZ0Hx+An+BsIwj1Ias=; b=gaPUh7k8wtItqK8HeNt3QpwJthhEuzJbgp5Cbz2GiBjBaphvtw3jVDnM7eBUu0xpUt UvysPk0/PszBRcLzXy9Iplq6JoNu8BTsTXo1zfIVSf+pjRxc2xrXJHcvLJGa5qyyobP0 WznctxN7CKLPhSrcW4d7BCH3TYQhraPsIRtJbfm+XWcd9Td2bWfM445lvxs9h1TsBqA0 Q7s0MV76T+lH5yUnZBOHCM0VwqIbD/Stg5UdCLb0T9Ahnx7FFt8gWEOpptslLfNbsjfB o1w8lSSFazk8VuVrOg4Owaa73KHy1+RGcHFd8aY33OW8zW3A/S56FB2FmQwfzGr0MpxE C2fg== X-Forwarded-Encrypted: i=1; AJvYcCU6VT44dtxXBlNHnnWLCV45oUXNJ+1r/w1CwYQCtoIvArOllSqMUEDl+jT4XN7CCmTBgGbYIQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxNNZYTYm6i7wOGyve0Eup8rCGhIS/B815rZpIuLg0KISt9i+eh xOQCu5ipQwX8o4hHoQIgWM24OAVv9bfbrTTLtS6C9NMhIOQtl6+vLQOWcbf7TA== X-Gm-Gg: ASbGncv4Dt7Ha9llR5BI38oWF2/1ENAlSjRWZPHrlLgWiE/WGnjow/uncqoMBsLXnIO afcUXhPSFdZwJiigyUxqQyEu02h1Vgah/jcfADbrQ+TWY7FN0EHUB2ssij5xJCHbBVzXYCCFxf3 ot918UahyEwPCE3bRJ1R7udfX4FIYareH9CgwVmoD23Bo31023rJv2YXQaYTQHJdV7SkX6GN7kp 8L2ua9sI5pW/+LMzjrstTgwP7Ld41CA89DMLlBAo+AfIPBQvP0slaLGxsmWs2IGxeDjeTezksUd IgruWL1B8JElhP06iIeVxf7tHuao3hTN/zUQG2hX5ibS6FMJNLVw/dqfg6G2bkjsXR2kOMgkAVo QUGkoBejqBSq+rxvwV8Riinz1DxK3WSTa6XFJTkrKVv3xF10bZRlyh+aWX0zxLsEE+u+7H3dZhx dVHJ62upQVepXKve20yXtNOP7HxN+FarP+W2txBgXg X-Google-Smtp-Source: AGHT+IGxWKVhf3ykcB09f1gCgZQb41POYNjZ4+e2tSnQ0CpU3uNMFB6LmLeBf6cvUYITVZsRbEkAjQ== X-Received: by 2002:a05:6000:2386:b0:3b7:908e:e4ac with SMTP id ffacd0b85a97d-3b8f97bb954mr9850919f8f.2.1754801747380; Sat, 09 Aug 2025 21:55:47 -0700 (PDT) Received: from pro2 (p200300e0b70c96007c360b79defb2b2f.dip0.t-ipconnect.de. [2003:e0:b70c:9600:7c36:b79:defb:2b2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459de0d4cf1sm261945135e9.13.2025.08.09.21.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 21:55:46 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> Date: Sun, 10 Aug 2025 06:55:45 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Alan Mackenzie , Stefan Monnier , =?utf-8?Q?=C3=93scar?= Fuentes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pip Cet writes: >> - record_marker_adjustments undo.c:127 >> - record_delete record_delete:187 >> + casify_region casify_region:555 >> + adjust_after_replace adjust_after_replace:1408 >> + replace_range replace_range:1639 >> + del_range_2 del_range_2:2030 >> + record_change record_change:201 >> >> where record_marker_adjustments puts basically all present markers in a >> buffer's undo list. del_range_2 I would interpret that any text deletion >> might do that. > > I think it may make more sense to find out who goes around creating > markers and not cleaning up after them. But I suspect many places cannot > easily be fixed because the markers might be exposed to Lisp. Probably. Good question is how to find these places, especially when they are created in Lisp :-/. > >> I think a garbage-collect with the old GC will clean up the undo list >> eventually by calling compact_undo_list. With MPS, that doesn't work. >> The cleanup in compact_undo_list cannot be used because MPS's weak >> objects and GC work completely differently. > > That's my understanding, too. And it means that this probably isn't > horribly important to fix on the master branch. On feature/igc, it looks > like something has to be done. > >> At the moment I'm a bit out of ideas. Waiting for a divine inspiration, >> so to speak. > > Maybe some markers could be marked at creation time as not being > important enough to be recorded in the undo list? I'm not really sure > which markers are being recorded and which need to be for undo to work. Might be possible but also requires to find where the markers are created, find out if they are nver required for undo, and so on. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 08:36:45 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 12:36:45 +0000 Received: from localhost ([127.0.0.1]:44309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul5I4-0003GK-Uc for submit@debbugs.gnu.org; Sun, 10 Aug 2025 08:36:45 -0400 Received: from mail.muc.de ([193.149.48.3]:60594) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ul5Hz-0003Fw-KV for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 08:36:43 -0400 Received: (qmail 33903 invoked by uid 3782); 10 Aug 2025 14:36:31 +0200 Received: from muc.de (pd953a559.dip0.t-ipconnect.de [217.83.165.89]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Aug 2025 14:36:31 +0200 Received: (qmail 19247 invoked by uid 1000); 10 Aug 2025 12:36:30 -0000 Date: Sun, 10 Aug 2025 12:36:30 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , Pip Cet , acm@muc.de, Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Gerd. On Sun, Aug 10, 2025 at 06:55:45 +0200, Gerd Möllmann wrote: > Pip Cet writes: > >> - record_marker_adjustments undo.c:127 > >> - record_delete record_delete:187 > >> + casify_region casify_region:555 > >> + adjust_after_replace adjust_after_replace:1408 > >> + replace_range replace_range:1639 > >> + del_range_2 del_range_2:2030 > >> + record_change record_change:201 > >> where record_marker_adjustments puts basically all present markers in a > >> buffer's undo list. del_range_2 I would interpret that any text deletion > >> might do that. > > I think it may make more sense to find out who goes around creating > > markers and not cleaning up after them. But I suspect many places cannot > > easily be fixed because the markers might be exposed to Lisp. > Probably. Good question is how to find these places, especially when > they are created in Lisp :-/. I've made a start on this (see patch below). It's mainly in the C files, where I grepped for Fpoint_marker and Fcopy_marker, and tidied up the uses which didn't tidy up their uses of markers. But also in some Lisp files, which are directly part of the command loop (simple.el), or called from it in hooks (jit.el, electric.el). Unfortunately, this hasn't helped much. When I type "asdfasdf" into *scratch* on emacs -Q, then , I still see five point markers in buffer-undo-list. If I a second time, this adds on a further ten point markers to b-u-list. It's worth mentioning that these markers aren't eq to eachother. At least, not all of them. I have a strong suspicion that there are duplicates in the 15 markers in buffer-undo-list after my two deletions. It is unclear whether the creates these markers, or just puts existing markers into buffer-undo-list. Maybe we could do with a primitive in marker.c which would print out the current buffer's list of markers. > >> I think a garbage-collect with the old GC will clean up the undo list > >> eventually by calling compact_undo_list. With MPS, that doesn't work. > >> The cleanup in compact_undo_list cannot be used because MPS's weak > >> objects and GC work completely differently. > > That's my understanding, too. And it means that this probably isn't > > horribly important to fix on the master branch. On feature/igc, it looks > > like something has to be done. > >> At the moment I'm a bit out of ideas. Waiting for a divine inspiration, > >> so to speak. > > Maybe some markers could be marked at creation time as not being > > important enough to be recorded in the undo list? I'm not really sure > > which markers are being recorded and which need to be for undo to work. This might be a silly question, but why do we have to put markers into buffer-undo-list at all? Surely they should "fix themselves" as other changes in the buffer get undone? > Might be possible but also requires to find where the markers are > created, find out if they are nver required for undo, and so on. Here's a patch which tidies up several markers. Unfortunately it doesn't seem to make a massive difference to the problem. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index c06b6b06406..9574d4d4d0a 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -783,6 +783,10 @@ abbrev-expansion (defun abbrev--before-point () "Try and find an abbrev before point. Return it if found, nil otherwise." (unless (eq abbrev-start-location-buffer (current-buffer)) +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + (when (markerp abbrev-start-location) + (set-marker abbrev-start-location nil)) +;;;; END OF EXPERIMENTAL STOUGH (setq abbrev-start-location nil)) (let ((tables (abbrev--active-tables)) @@ -803,7 +807,11 @@ abbrev--before-point (when (> end start) (setq name (buffer-substring start end)) (goto-char pos) ; Restore point. - (list (abbrev-symbol name tables) name start end))) + (list (abbrev-symbol name tables) name start end)) +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + ;; (set-marker start nil) NO!!! +;;;; END OF EXP STOUGH + ) (while (and tables (not (car res))) (let* ((table (pop tables)) @@ -1090,7 +1098,12 @@ abbrev--default-expand ;; where it started. (if (and (> startpos endmark) (= (point) endmark)) ;Obey skeletons that move point. - (goto-char startpos)))))))) + (goto-char startpos))) +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + (set-marker startpos nil) + (set-marker endmark nil) +;;;; END OF EXP STOUGH + ))))) (defun unexpand-abbrev () "Undo the expansion of the last abbrev that expanded. diff --git a/lisp/electric.el b/lisp/electric.el index 39e13e1ca0c..c8fcba803cc 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -279,7 +279,11 @@ electric-indent-post-self-insert-function ;; to `indent-according-to-mode' but after we may ;; not be (Bug#15767). (when (and (eolp)) - (delete-horizontal-space t)))))) + (delete-horizontal-space t)))) +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + (set-marker before nil) +;;;; END OF EXPERIMENTAL STOUGH + )) (unless (and electric-indent-inhibit (not at-newline)) (condition-case-unless-debug () diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 711d7ca8cac..3e8c75abc7b 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -502,7 +502,12 @@ jit-lock-force-redisplay ;; Don't cause refontification (it's already been done), but just do ;; some random buffer change, so as to force redisplay. (put-text-property start end 'fontified nil) - (put-text-property start end 'fontified t))))) + (put-text-property start end 'fontified t) +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + (move-marker start nil) + (move-marker end nil) +;;;; END OF EXPERIMENTAL STOUGH + )))) ;;; Stealth fontification. @@ -751,7 +756,10 @@ jit-lock--antiblink-post-command (jit-lock-context-fontify) (cancel-timer jit-lock--antiblink-grace-timer) (setq jit-lock--antiblink-grace-timer nil)))) - ;; Update variables (and release the marker). + ;; Update variables (and release the markers). +;;;; EXPERIMENTAL STOUGH, 2025-08-09 + (set-marker new-l-b-p nil) +;;;; END OF EXP. STOUGH (set-marker jit-lock--antiblink-line-beginning-position nil) (setq jit-lock--antiblink-line-beginning-position new-l-b-p jit-lock--antiblink-string-or-comment new-s-o-c))) diff --git a/src/lread.c b/src/lread.c index 57d3239e283..b0cc1b6ec0c 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2244,8 +2244,12 @@ readevalloop (Lisp_Object readcharfun, /* Just for cleanliness, convert END to a marker if it is an integer. */ - if (FIXNUMP (end)) - end = Fpoint_max_marker (); + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + /* DON'T make this conversion! It is thouroughly unclean, + since we never unchain_marker it, so it is left clogging + up the buffer's marker list. */ + /* if (FIXNUMP (end)) */ + /* end = Fpoint_max_marker (); */ } /* On the first cycle, we can easily test here @@ -2312,8 +2316,11 @@ readevalloop (Lisp_Object readcharfun, && XHASH_TABLE (read_objects_completed)->count > 0) read_objects_completed = Qnil; - if (!NILP (start) && continue_reading_p) - start = Fpoint_marker (); + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + /* DON'T create another marker each time around this loop! This just + clogs up the buffer's marker list with useless markers. */ + /* if (!NILP (start) && continue_reading_p) */ + /* start = Fpoint_marker (); */ /* Restore saved point and BEGV. */ unbind_to (count1, Qnil); diff --git a/src/window.c b/src/window.c index 1ac004af5e0..a96a6aa2eb8 100644 --- a/src/window.c +++ b/src/window.c @@ -6592,6 +6592,9 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, bool noerror) if (lose) { + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + unchain_marker (XMARKER (opoint_marker)); + /* END OF EXP STOUGH */ if (noerror) return; else @@ -6689,6 +6692,9 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, bool noerror) } else { + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + unchain_marker (XMARKER (opoint_marker)); + /* END OF EXP STOUGH */ if (noerror) return; else @@ -6701,6 +6707,9 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, bool noerror) ? make_fixnum (BUF_PT (XBUFFER (w->contents))) : Fmarker_position (w->pointm)), w->contents); + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + unchain_marker (XMARKER (opoint_marker)); + /* END OF EXP STOUGH */ } diff --git a/src/xdisp.c b/src/xdisp.c index 2691296b282..c787657e429 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12085,6 +12085,9 @@ DEFUN ("display--line-is-continued-p", Fdisplay__line_is_continued_p, } SET_PT_BOTH (marker_position (opoint), marker_byte_position (opoint)); bidi_unshelve_cache (itdata, false); + /* EXPERIMENTAL STOUGH, 2025-08-09 */ + Fset_marker (opoint, Qnil, Qnil); + /* END OF EXPERIMENTAL STOUGH */ } set_buffer_internal_1 (oldb); -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 09:11:38 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 13:11:38 +0000 Received: from localhost ([127.0.0.1]:44340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul5pp-0004ox-Gj for submit@debbugs.gnu.org; Sun, 10 Aug 2025 09:11:37 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:46411) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ul5pk-0004oY-Sa for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 09:11:35 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-459e3926cbbso14992845e9.1 for <79200@debbugs.gnu.org>; Sun, 10 Aug 2025 06:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754831486; x=1755436286; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=PLF8WJX3iEi9KXADsB5LBNv4IGsFhIra4ELdPBE41cY=; b=PqdFmgkOq7RC63ILEOaloUUzyKxfKFS511vTRuspBUNoZtIO0zyotNhUTf1T8gHQ5g YLUtZtS99V3QQERqwrO65BY1zuMSLnt/EOECpbLu9qnOjwoJ4bihmKZWXVtKE4ovadhb de9AZg/qiqcCPT3XDW2K663H0fa8/atvFBcVOXh5awy2/de6YQhRCCKCKQwNK4a3VgZk SPap1ms7I642znKcCgF9R9wtWjb+0UIh7vaKE3g+KgRqByeDNFCR6ywOCOJK0Vcf5Rhb 5+vU5zBjF6sMU+inz59TkptKxCI4jSJNmMtlAb0HI+0X6IcrLjqbz9Ln+QtchI8OJH41 ef8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754831486; x=1755436286; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PLF8WJX3iEi9KXADsB5LBNv4IGsFhIra4ELdPBE41cY=; b=PiyModRehkl7VFX0e1dLsM0+7Wx7Y6whnts8e80PX/k1hsjQTjLL1CCP4VWWyNj6m6 JudhTpOF54xff/yORQQrKb/kY5Tf0TQFFwrNe6H74es3CU6/xNTapdFywhJbvt1yIpON dZnyBsCRmBF4nid9Zgocc4ypvogH4yOgDAAEBz12EVKHljbN9yo8OwJfhAfBIWVDWxy9 Jq2gXTXSL290SOVbLSb0jXiVJeJReSXPjnEzRCYYG4ohNavR8UyJRzktRbWDuU6fKlVP YSi1CVFjxA8qfIeYFcdBcMKKitAusB1A8mMrE09BmK/icSra6yB6eYOgGrL9djN6lJs4 bLlw== X-Forwarded-Encrypted: i=1; AJvYcCWY8xpNN3rpHWebxrZUCBHJLB4Hb0f9t2Sv3dkEXDJSZJT1FQ2R/B43ku27J/IZ3Wwlx2PgIw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxCdsPp1hEUhfbF3kVkGzXz370QFSrl3qTcxGLs+MfyxyaphLZj abdPiT4P8GerfEDJUqaEH2da06boPnubgwMEljwahYxz/BCJiyhfjpxppISReSOv X-Gm-Gg: ASbGncuqcqgb/IsdWz5NPIIVn68+6ya7CZnIzBbxtpCcDrSNxiChEMwbP7onuL+VJaZ YzGUKb7bVJ67QvITO4brkJRTeO7SNUfl0Y2cxWNE9v50899X6iIncc62PhWG2jSmYyo8InE4GJN 0P9gsdto9oA/dpL02eDGB5Ba7hXQlWX3HN92WQYCSrQui77dEfybgfga1BF8p6v2uQ/FEJODlw9 WGozgfoLxfUWyo9ozumQLMZc9U2Zbbr4tHCiLmqswnUmQ6EwwQWcCW+5taIb2zIg72zBJv49XIF 1EXmuYBp13ofQrQ3drxkg7+36DruORFG8KbHsrlsEOrs4F8umCY+YUqvzzCjB7LKsTSLypPOk77 xwcdvOkuGdQwsKCXlwjqfFC3hmBoQj1XLmCFoh7+RxiRe8yb7RJohcWJDoseWUFimdtukfhXJt7 h+4MRkPBFY2+mrj/miSJp38pi5vauUT54KAZ4= X-Google-Smtp-Source: AGHT+IEinDOI+Ard8lMwHr1a+1GKAo7hX5qMIeqlLpEGR+HAJvrbDa/HCkAi/RbcG+TL7OhLzX2gzA== X-Received: by 2002:a05:600c:358f:b0:459:dde3:1a56 with SMTP id 5b1f17b1804b1-45a00cada7amr25176575e9.28.1754831486147; Sun, 10 Aug 2025 06:11:26 -0700 (PDT) Received: from pro2 (p200300e0b70c96007c360b79defb2b2f.dip0.t-ipconnect.de. [2003:e0:b70c:9600:7c36:b79:defb:2b2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-458b4f9e952sm353544135e9.9.2025.08.10.06.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 06:11:25 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> Date: Sun, 10 Aug 2025 15:11:24 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Pip Cet , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: >> > I think it may make more sense to find out who goes around creating >> > markers and not cleaning up after them. But I suspect many places cannot >> > easily be fixed because the markers might be exposed to Lisp. > >> Probably. Good question is how to find these places, especially when >> they are created in Lisp :-/. > > I've made a start on this (see patch below). It's mainly in the C files, > where I grepped for Fpoint_marker and Fcopy_marker, and tidied up the > uses which didn't tidy up their uses of markers. But also in some Lisp > files, which are directly part of the command loop (simple.el), or called > from it in hooks (jit.el, electric.el). Hi Alan, Thanks. > Unfortunately, this hasn't helped much. When I type "asdfasdf" into > *scratch* on emacs -Q, then , I still see five point markers > in buffer-undo-list. If I a second time, this adds on a > further ten point markers to b-u-list. > > It's worth mentioning that these markers aren't eq to eachother. At > least, not all of them. I have a strong suspicion that there are > duplicates in the 15 markers in buffer-undo-list after my two > deletions. Hm, you mean eq markers inside the same undo group has duplicates? That I haven't seen yet. There is code in primitive-undo for that case, though, so it seems to be expected in some case. No idea. If the same marker appears twice in different undo groups, then that's normal. The entries for markers mean something like "add some delta to the marker's position when we undo this record". > It is unclear whether the creates these markers, or just puts > existing markers into buffer-undo-list. Maybe we could do with a > primitive in marker.c which would print out the current buffer's list of > markers. I don't believe it creates the markers. But I'm pretty sure that record_change can put a lot of markers to a buffer's undo list. It just considers all markers in a buffer's markers list as relevant for undo. IOW, when we undo, all these markers need their positions changed. It has no way to recognize markers that are only used temporarily. ... > This might be a silly question, but why do we have to put markers into > buffer-undo-list at all? Surely they should "fix themselves" as other > changes in the buffer get undone? Please see above. I hope that explains it. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 10:41:55 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 14:41:55 +0000 Received: from localhost ([127.0.0.1]:45637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul7FC-00016I-QE for submit@debbugs.gnu.org; Sun, 10 Aug 2025 10:41:55 -0400 Received: from mail.muc.de ([193.149.48.3]:60713) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ul7FA-000160-AF for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 10:41:53 -0400 Received: (qmail 99551 invoked by uid 3782); 10 Aug 2025 16:41:44 +0200 Received: from muc.de (pd953a559.dip0.t-ipconnect.de [217.83.165.89]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Aug 2025 16:41:44 +0200 Received: (qmail 12128 invoked by uid 1000); 10 Aug 2025 14:41:43 -0000 Date: Sun, 10 Aug 2025 14:41:43 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , Pip Cet , acm@muc.de, Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Gerd. On Sun, Aug 10, 2025 at 15:11:24 +0200, Gerd Möllmann wrote: > Alan Mackenzie writes: > >> > I think it may make more sense to find out who goes around creating > >> > markers and not cleaning up after them. But I suspect many places cannot > >> > easily be fixed because the markers might be exposed to Lisp. > >> Probably. Good question is how to find these places, especially when > >> they are created in Lisp :-/. > > I've made a start on this (see patch below). It's mainly in the C files, > > where I grepped for Fpoint_marker and Fcopy_marker, and tidied up the > > uses which didn't tidy up their uses of markers. But also in some Lisp > > files, which are directly part of the command loop (simple.el), or called > > from it in hooks (jit.el, electric.el). > Hi Alan, > Thanks. > > Unfortunately, this hasn't helped much. When I type "asdfasdf" into > > *scratch* on emacs -Q, then , I still see five point markers > > in buffer-undo-list. If I a second time, this adds on a > > further ten point markers to b-u-list. > > It's worth mentioning that these markers aren't eq to eachother. At > > least, not all of them. I have a strong suspicion that there are > > duplicates in the 15 markers in buffer-undo-list after my two > > deletions. > Hm, you mean eq markers inside the same undo group has duplicates? That > I haven't seen yet. There is code in primitive-undo for that case, > though, so it seems to be expected in some case. No idea. Ah, OK. > If the same marker appears twice in different undo groups, then that's > normal. The entries for markers mean something like "add some delta to > the marker's position when we undo this record". Yes > > It is unclear whether the creates these markers, or just puts > > existing markers into buffer-undo-list. Maybe we could do with a > > primitive in marker.c which would print out the current buffer's list of > > markers. Yes, I've called it buffer-marker-list, and it looks like this: diff --git a/src/lisp.h b/src/lisp.h index 64b5c227583..bc5a404c261 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1400,6 +1400,9 @@ #define XSETTHREAD(a, b) XSETPSEUDOVECTOR (a, b, PVEC_THREAD) #define XSETMUTEX(a, b) XSETPSEUDOVECTOR (a, b, PVEC_MUTEX) #define XSETCONDVAR(a, b) XSETPSEUDOVECTOR (a, b, PVEC_CONDVAR) #define XSETNATIVE_COMP_UNIT(a, b) XSETPSEUDOVECTOR (a, b, PVEC_NATIVE_COMP_UNIT) +/* EXPERIMENTAL STOUGH, 2025-08-10 */ +#define XSETMARKER(a, b) XSETPSEUDOVECTOR (a, b, PVEC_MARKER) +/* END OF EXPERIMENTAL STOUGH */ /* Efficiently convert a pointer to a Lisp object and back. The pointer is represented as a fixnum, so the garbage collector diff --git a/src/marker.c b/src/marker.c index 4ab68ec7bbe..c5be58d1d7a 100644 --- a/src/marker.c +++ b/src/marker.c @@ -424,6 +424,24 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) /* Operations on markers. */ +/* EXPERIMENTAL STOUGH, 2025-08-10 */ +DEFUN ("buffer-marker-list", Fbuffer_marker_list, Sbuffer_marker_list, 0, 0, 0, + doc: /* Return (a copy of) the list of markers in the current buffer. */) + (void) +{ + Lisp_Object markers = Qnil; + Lisp_Object mk; + + for (struct Lisp_Marker *ma = BUF_MARKERS (current_buffer); ma; ma = ma->next) + { + XSETMARKER (mk, ma); + markers = (Fcons (mk, markers)); + } + return Fnreverse (markers); +} + +/* END OF EXPERIMENTAL STOUGH */ + DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0, doc: /* Return the buffer that MARKER points into, or nil if none. Returns nil if MARKER points into a dead buffer. */) @@ -833,6 +851,9 @@ verify_bytepos (ptrdiff_t charpos) void syms_of_marker (void) { + /* EXPERIMENTAL STOUGH, 2025-08-10 */ + defsubr (&Sbuffer_marker_list); + /* END OF EXPERIMENTAL STOUGH */ defsubr (&Smarker_position); defsubr (&Smarker_last_position); defsubr (&Smarker_buffer); > I don't believe it creates the markers. But I'm pretty sure that > record_change can put a lot of markers to a buffer's undo list. It just > considers all markers in a buffer's markers list as relevant for undo. > IOW, when we undo, all these markers need their positions changed. It > has no way to recognize markers that are only used temporarily. In emacs -Q, C-x b foo . Now do M-: (length (buffer-marker-list)). It returns 9. Repeat. It now returns 14. Then, successively, 19, 26, 31, 36, .... OK, between the 19 and 26 I had finger trouble. But it would appear that the command loop, or something close to it, is adding five frivolous point markers at each iteration. This is in my "EXPERIMENTAL"ly patched master. It may be even worse in a vanilla master. > ... > > This might be a silly question, but why do we have to put markers into > > buffer-undo-list at all? Surely they should "fix themselves" as other > > changes in the buffer get undone? > Please see above. I hope that explains it. Thanks. I'll study it more carefully when I'm in a less hacky mood. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 10:56:48 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 14:56:48 +0000 Received: from localhost ([127.0.0.1]:45655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul7Tb-0001lq-GP for submit@debbugs.gnu.org; Sun, 10 Aug 2025 10:56:48 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44441) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ul7TV-0001lW-Vv for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 10:56:45 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3b7892609a5so1961230f8f.1 for <79200@debbugs.gnu.org>; Sun, 10 Aug 2025 07:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754837795; x=1755442595; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qPD7sNTdT4jUCYI2MO3aSit4IzimgXDE+eK9MxOFypU=; b=Z+cD3kKeA3q4xCLOQXWSsL5djCQW5xNhJiWUYVbiX5Rh55KludRN9WcbBQsJV2SHN8 EreTSHKEtY2rZ9Ob40wwX1/sIQAZLYDgYlXKJDbRsyj2tf72D4QaF4qjitOnD6zpziK8 ONnbC/+oepu8O7kqs7Sc4ZcAIyH/6IaZ9HDcqtwFM3kXzQSATuABUFkBC6q+ClqPz1OD NYYkoB/4DUfXyEZVlx90NeFdKFdJLywI+HcYfkSqVmu0JsW/Yu9ftyfrrlg/CNFkqHeY xwggIqhAj/vr7dbFEHIhPkDeB+4A1cms6OYj97GOBPXPmN/hs2R/3tWgjH0G7Iev7McY brCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754837795; x=1755442595; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qPD7sNTdT4jUCYI2MO3aSit4IzimgXDE+eK9MxOFypU=; b=r6z5MaSkg2+hAugqO6tYxRd4Hh/84yZm6llACZNyA5TWw+cAGWrdWvFlTLwWf1YCgC MtyZwVVlWwsum3w9QU6kOGbzKsP++Gbsm5vAeSkRah4z1AXulV5jO/3YrdjM3V1RfiQs QxB0XMtOIiFMgZMxljKvy5M/UJRu/IRvd81gLoHvkGnUUHaV9MPKsnr2WNom+fjH8o0I wTRR6Alc5fHPNIBHoTjgBjzy5vGIaxfFfsJ3xJINiiMzaDGvIMhriKtfM+aicepPevWF s2DaE6nh8okxhLwffqrzcYb7RIa2nuqkX8U/yHKYNSBGBvyuO2/sWjVBDuKBwThoB931 tCtA== X-Forwarded-Encrypted: i=1; AJvYcCUQMBx52MnvZpTPdmQzOVjizc0PyXiBfFWVa59haIjZFv68wPAcF7xlD57t3373UNTw173JQw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzoZc4l8nUHS9/OK28mF7Pube9CVfihcFnswsBEPO7gn5+AxEfa 5vUqWifTqq5BdfZWqve5akvPFvvP7XwfupIgQrTwfC/CQPOMIzLNkOiLgBT+3HaI X-Gm-Gg: ASbGncuXwbp1Dn0ItYfvp2MiBuG+Boe8lujFs23UI92mmm3Fl823RnA3IGCBrHZZNtC xF6ZgfqJ/1tJmsy5d6If0+VKX7YI5rzt3Bc/8cKcEf3mUh3s5W6SRM4sysIOHDKLC8lrINOFOKv QDGOCyUhgD9XV0y5VOkaEC7LvRK5KXuk4D+HAqAivhjIrhczU1Ea5vPi91kTSf23cBEZTTeByN6 xdVmejj6rpxrq0zzCzjSeL2DSqbRU3h3dCm8lfxgFA4o7Uv6Axf/wmG8lhlXplxjTZiD4C4fnPO XFWXi6pDhcqcBdiQBxmwKAf+mYj/VxJYFTCNZRDp4Vx0wYxom4ZJydrigytsZZLaLcra1uDsHID FscbWS3GumG+NE5RoD10TXPmwvIu9X4A3cLg2pmYR/8HybwhpmtDI6mIrHCi0xCUUQzHMNwfaoX qyWyjetFHdKExf0anZ7xYOBiTn X-Google-Smtp-Source: AGHT+IEWvw03weq5I0KDE5ZwWvVwlIiGG7liv8O0XDAG5eJtexAaHeM9d3TW6d+42++QbOKmqEb8Gg== X-Received: by 2002:a5d:4988:0:b0:3b9:6e:5242 with SMTP id ffacd0b85a97d-3b90092ca31mr5511574f8f.4.1754837795122; Sun, 10 Aug 2025 07:56:35 -0700 (PDT) Received: from pro2 (p200300e0b70c96007c360b79defb2b2f.dip0.t-ipconnect.de. [2003:e0:b70c:9600:7c36:b79:defb:2b2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459ee17535bsm174124385e9.16.2025.08.10.07.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 07:56:34 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> Date: Sun, 10 Aug 2025 16:56:33 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?=C3=93scar?= Fuentes , Pip Cet , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: >> I don't believe it creates the markers. But I'm pretty sure that >> record_change can put a lot of markers to a buffer's undo list. It just >> considers all markers in a buffer's markers list as relevant for undo. >> IOW, when we undo, all these markers need their positions changed. It >> has no way to recognize markers that are only used temporarily. > > In emacs -Q, C-x b foo . > > Now do M-: (length (buffer-marker-list)). It returns 9. Repeat. It > now returns 14. Then, successively, 19, 26, 31, 36, .... OK, between > the 19 and 26 I had finger trouble. > > But it would appear that the command loop, or something close to it, is > adding five frivolous point markers at each iteration. This is in my > "EXPERIMENTAL"ly patched master. It may be even worse in a vanilla > master. Or redisplay like in the mode-line case, as Pip found out. In this regard, I find the undo mechanism a bit unfortunate, but it has been that way maybe even since the beginning. The many "temporary" markers in the undo list should be an removed whit the next garbage-collect. The function compact_undo_list does that. It looks for markers that will be deleted because they are no longer references and removes the undo entries for them. It's a bit like a weak hash table containing markers. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 10:57:10 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 14:57:10 +0000 Received: from localhost ([127.0.0.1]:45661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul7Tx-0001nI-H2 for submit@debbugs.gnu.org; Sun, 10 Aug 2025 10:57:10 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:50485) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ul7Tu-0001mJ-IA for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 10:57:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1754837819; x=1755097019; bh=ETuvhVjeoBlUq4F8sWiB81kO3iYPhoL+Hvz+mwyqbkU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=zcdrEYQ2OKc8w2n3eq0J9WkABarxF1Iq7KGBFCkuUyn4GrAjr+64/KcwlnYw4VovO DUzLBAuOgL2BRCC9cQcZys71LsPo2BtKJmUeR0xt6i/6y4yQW0Ywb/N366B698e9Yv Rz+g6zDnStkhhPI4A/XoRO48hs43DLUVWBvDgdVlTKWeb47Y/JyZx/BoCmWl5aIQnu rVTKTScpX6thl1Fz8fac/dZ7NMh+wqHtVsfhzo2r2DU4FMJmK18pImmbkouFRS/z2a 6+Hk4dsrfnsOo5X+unk0MfLLnqCYMVgFvE4rxHL7OleH0wdXFqrNk+ePeWNbuBIxmc kWlJVskx5qdIw== Date: Sun, 10 Aug 2025 14:56:56 +0000 To: Alan Mackenzie From: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# In-Reply-To: References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 5402b47e5ee2a3372e1f920f066be2d6f4d0bf85 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= , =?utf-8?Q?=C3=93scar_Fuentes?= , Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Alan Mackenzie" writes: > Hello, Gerd. > > On Sun, Aug 10, 2025 at 06:55:45 +0200, Gerd M=C3=B6llmann wrote: >> Pip Cet writes: > >> >> - record_marker_adjustments undo.c:127 >> >> - record_delete record_delete:187 >> >> + casify_region casify_region:555 >> >> + adjust_after_replace adjust_after_replace:1408 >> >> + replace_range replace_range:1639 >> >> + del_range_2 del_range_2:2030 >> >> + record_change record_change:201 > >> >> where record_marker_adjustments puts basically all present markers in= a >> >> buffer's undo list. del_range_2 I would interpret that any text delet= ion >> >> might do that. > >> > I think it may make more sense to find out who goes around creating >> > markers and not cleaning up after them. But I suspect many places cann= ot >> > easily be fixed because the markers might be exposed to Lisp. > >> Probably. Good question is how to find these places, especially when >> they are created in Lisp :-/. I think the Lisp part is easy: we can simply capture a backtrace and attach it when creating the marker. >From f7a23531886fe458346f13ee08369d153b2de897 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sun, 10 Aug 2025 14:53:49 +0000 Subject: [PATCH] store Lisp backtraces for markers --- src/alloc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index 07ca8474bf3..c8426e3a4dc 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3812,6 +3812,12 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0,= 0, 0, p->next =3D NULL; p->insertion_type =3D 0; p->need_adjustment =3D 0; + if (!NILP (Vmarker_backtrace)) + { + Lisp_Object backtrace =3D make_nil_vector (32); + get_backtrace (XVECTOR (backtrace)->contents, 32); + Fputhash (make_lisp_ptr (p, Lisp_Vectorlike), backtrace, Vmarker_bac= ktrace); + } return make_lisp_ptr (p, Lisp_Vectorlike); } =20 @@ -3836,6 +3842,12 @@ build_marker (struct buffer *buf, ptrdiff_t charpos,= ptrdiff_t bytepos) m->need_adjustment =3D 0; m->next =3D BUF_MARKERS (buf); BUF_MARKERS (buf) =3D m; + if (!NILP (Vmarker_backtrace)) + { + Lisp_Object backtrace =3D make_nil_vector (32); + get_backtrace (XVECTOR (backtrace)->contents, 32); + Fputhash (make_lisp_ptr (m, Lisp_Vectorlike), backtrace, Vmarker_bac= ktrace); + } return make_lisp_ptr (m, Lisp_Vectorlike); } =20 @@ -7461,6 +7473,10 @@ syms_of_alloc (void) If this portion is smaller than `gc-cons-threshold', this is ignored. */)= ; Vgc_cons_percentage =3D make_float (0.1); =20 + DEFVAR_LISP ("marker-backtrace", Vmarker_backtrace, +=09 doc: /* */); + Vmarker_backtrace =3D CALLN (Fmake_hash_table, QCtest, Qeq, QCweakness, = Qkey); + DEFVAR_INT ("pure-bytes-used", pure_bytes_used, =09 doc: /* No longer used. */); =20 --=20 2.50.0 Use like this: (dolist (el buffer-undo-list) (and (consp el) (markerp (car el)) (message "%S %S" (car el) (gethash (car el) marker-backtrace)))) > I've made a start on this (see patch below). It's mainly in the C files, > where I grepped for Fpoint_marker and Fcopy_marker, and tidied up the > uses which didn't tidy up their uses of markers. But also in some Lisp > files, which are directly part of the command loop (simple.el), or called > from it in hooks (jit.el, electric.el). > > Unfortunately, this hasn't helped much. When I type "asdfasdf" into > *scratch* on emacs -Q, then , I still see five point markers > in buffer-undo-list. If I a second time, this adds on a > further ten point markers to b-u-list. > > It's worth mentioning that these markers aren't eq to eachother. At > least, not all of them. I have a strong suspicion that there are > duplicates in the 15 markers in buffer-undo-list after my two deletions. > > It is unclear whether the creates these markers, or just puts > existing markers into buffer-undo-list. Maybe we could do with a > primitive in marker.c which would print out the current buffer's list of > markers. That also sounds like a useful debugging aid! > >> >> I think a garbage-collect with the old GC will clean up the undo list >> >> eventually by calling compact_undo_list. With MPS, that doesn't work. >> >> The cleanup in compact_undo_list cannot be used because MPS's weak >> >> objects and GC work completely differently. > >> > That's my understanding, too. And it means that this probably isn't >> > horribly important to fix on the master branch. On feature/igc, it loo= ks >> > like something has to be done. > >> >> At the moment I'm a bit out of ideas. Waiting for a divine inspiratio= n, >> >> so to speak. > >> > Maybe some markers could be marked at creation time as not being >> > important enough to be recorded in the undo list? I'm not really sure >> > which markers are being recorded and which need to be for undo to work= . > > This might be a silly question, but why do we have to put markers into > buffer-undo-list at all? Surely they should "fix themselves" as other > changes in the buffer get undone? I don't know the answer. I assume it's necessary for text removals which result in two markers sharing a position when they didn't previously, so we can undo those properly? >> Might be possible but also requires to find where the markers are >> created, find out if they are nver required for undo, and so on. > > Here's a patch which tidies up several markers. Unfortunately it doesn't > seem to make a massive difference to the problem. Have you tried applying the patch I posted earlier, too? It doesn't appear to be included in your changes, but it made a difference here. This is against feature/igc, but the code looks unchanged from master. >From d5cf17f88fbba4cdfc61ebea725e12a2c8b9aa42 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sat, 9 Aug 2025 10:32:19 +0000 Subject: [PATCH] Detach markers explicitly so they don't wind up on the und= o list * src/xdisp.c (unwind_format_mode_line): Detach markers when we're done with them. --- src/xdisp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xdisp.c b/src/xdisp.c index 432dd5dceca..2406bb6f3d9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13828,6 +13828,7 @@ unwind_format_mode_line (Lisp_Object vector) =20 =09 current_buffer =3D XBUFFER (buffer); =09 set_point_from_marker (AREF (vector, 11)); +=09 detach_marker (AREF (vector, 11)); =09 ASET (vector, 11, Qnil); =09 current_buffer =3D cb; =09 } --=20 2.50.0 Pip From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 11:06:43 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 15:06:43 +0000 Received: from localhost ([127.0.0.1]:45677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul7dA-0002Fw-Eh for submit@debbugs.gnu.org; Sun, 10 Aug 2025 11:06:42 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:44509) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ul7cr-0002FH-B6 for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 11:06:34 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-451d41e1ad1so24202595e9.1 for <79200@debbugs.gnu.org>; Sun, 10 Aug 2025 08:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754838374; x=1755443174; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Osej5HMY9KIsDiVgCE4WKADlBtYjjW61j7MycFheykE=; b=jX5kbq99kuNHPxNCbtEf5sMaos4IV1CDGIIfrbCUwOLMZLu4Aff0xy+7EizyTEJ8Nn fnj0N6nzT8/Az8uysf+h4zPR533zk05fdis4B0YCOgYlXkTXE3h6enBw16aeJdBImCjp x5SJrXeDACU1H8Ba4j9EUnW/LarjAluKe2jF3ohsoqdkQ2mYYXO1rKjbVc5oLRs1/CnY TPi5mBe9Su9txUZwYdzepwbCyEjr27jFRcRDcCuy19/cqvdbZZJ90G3Oes+EPJGypZlO uS45qhQhsvvQIrsNaeyiG3wlkor+uoejUjoD2jTS+3Ex7rFvF+bwtaRP4uG4JKjt+/YA 8b8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754838374; x=1755443174; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Osej5HMY9KIsDiVgCE4WKADlBtYjjW61j7MycFheykE=; b=i5yOYhpD+BFl7Bo85KFyuIUYICbBUQz+101tX8pQu9ZnYkoetKpTzsAIUmx6xBzp4I YanJ+3F4xNNBdFoPW4m/FTWaTnMWqM4N9DajbScaQHPHbrNYB5AJLKab5Lmw6XrFDth6 wwAWDksPLW1hsovDO4CPEf8EonJpWlUY5XVYRlcV8WaXA+RfDe7Zs7ZsE2DBxpJHkT9k rL7KF1E5corocA7Y2tAFpvf7AuaDnCT48CGYLH/45QzaPnxYDpAGfkulpjLyjArofnHN Gd4uIXh7DMqFg5wGlTrwbaWs99qgXWyM79lgJhDFigiynm3JLJEx8/oiN1BwTRYCcGU5 V0Ng== X-Forwarded-Encrypted: i=1; AJvYcCUse8YFyyJylbVlflrCf8a0mKiXOI6Ai1akJuPCs4t/Y3GrMZv946P+r4rX5oxo+b29tZ/CKA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyL1SbI9DXwgPTLgJnAuX0raqHk/z+2oTr5gNKeuSOPrpkzWB4t /Lbz6l0fkxNxbb0gQgXZ23AsuCttBqfqkWSKchj+f5vwSqQfUtBuJo5AHqCvqgWg X-Gm-Gg: ASbGncuc65MGij6cw3wC+uNxPFYhHZkcw30TT9cnaga87vUvuVu7/6FQZd2CsiNfh/A YTrwkFXibu7iUEXKsW7zhMkA0Y/uwohXqCdfR87fzQLzhj3egrQHTeLPYAZMG+tVz8gQ0Jlu659 TNkf9U+XCCRs6dUuNd6dW1nIq/bC+ViZEo2sPIUqn2yQRbWhFxeNVGY3OVis5WgIn9xyoVmWtvj s8+U8ytV5wTf6yTf1eiIdh1ak505npnoIvZzWrMnEEX6kUnBs1caLiQHt2Lf4wI6vU0nBOcTWyO 1cDbaRINPEuR0VfRgTnXq703MNg+Rv86tLoww5zxyV6OI2noMEkEbCKZpMjb4EKCrNtExj80Yj+ 5F+Kn6yuW5RzPdScSCR2vM1n9wac0B2MhOOWtLrGiAH7VLvAdK8Gqs0+ME93a/DQS6J4OtSG+k0 BZhZGQy7k/g5Sbv6k2LiT/zQd5KdZCrw== X-Google-Smtp-Source: AGHT+IHjIshIzHsiXdNNZ7MXak5wxoIp7tOMxjhpFnJIOjp9NwTMnS/aGz8oX8ogj7ebsxVl6s17Ag== X-Received: by 2002:a05:600c:190d:b0:43b:ca39:6c75 with SMTP id 5b1f17b1804b1-459f4f9d9ddmr84996305e9.16.1754838374148; Sun, 10 Aug 2025 08:06:14 -0700 (PDT) Received: from pro2 (p200300e0b70c96007c360b79defb2b2f.dip0.t-ipconnect.de. [2003:e0:b70c:9600:7c36:b79:defb:2b2f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4533f1sm37779212f8f.42.2025.08.10.08.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Aug 2025 08:06:12 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> Date: Sun, 10 Aug 2025 17:06:12 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, Alan Mackenzie , Stefan Monnier , =?utf-8?Q?=C3=93scar?= Fuentes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pip Cet 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 10 12:35:27 2025 Received: (at 79200) by debbugs.gnu.org; 10 Aug 2025 16:35:27 +0000 Received: from localhost ([127.0.0.1]:45771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ul914-0006UM-H9 for submit@debbugs.gnu.org; Sun, 10 Aug 2025 12:35:27 -0400 Received: from mail.muc.de ([193.149.48.3]:21538) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ul90y-0006Qh-U8 for 79200@debbugs.gnu.org; Sun, 10 Aug 2025 12:35:24 -0400 Received: (qmail 54981 invoked by uid 3782); 10 Aug 2025 18:35:13 +0200 Received: from muc.de (pd953a559.dip0.t-ipconnect.de [217.83.165.89]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Aug 2025 18:35:12 +0200 Received: (qmail 13102 invoked by uid 1000); 10 Aug 2025 16:35:11 -0000 Date: Sun, 10 Aug 2025 16:35:11 +0000 To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bjon445a.fsf@protonmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: Gerd =?iso-8859-1?Q?M=F6llmann?= , =?iso-8859-1?Q?=D3scar?= Fuentes , acm@muc.de, Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Pip. On Sun, Aug 10, 2025 at 14:56:56 +0000, Pip Cet wrote: > "Alan Mackenzie" writes: > > Hello, Gerd. > > On Sun, Aug 10, 2025 at 06:55:45 +0200, Gerd Möllmann wrote: > >> Pip Cet writes: > >> >> - record_marker_adjustments undo.c:127 > >> >> - record_delete record_delete:187 > >> >> + casify_region casify_region:555 > >> >> + adjust_after_replace adjust_after_replace:1408 > >> >> + replace_range replace_range:1639 > >> >> + del_range_2 del_range_2:2030 > >> >> + record_change record_change:201 > >> >> where record_marker_adjustments puts basically all present markers in a > >> >> buffer's undo list. del_range_2 I would interpret that any text deletion > >> >> might do that. > >> > I think it may make more sense to find out who goes around creating > >> > markers and not cleaning up after them. But I suspect many places cannot > >> > easily be fixed because the markers might be exposed to Lisp. > >> Probably. Good question is how to find these places, especially when > >> they are created in Lisp :-/. > I think the Lisp part is easy: we can simply capture a backtrace and > attach it when creating the marker. I thought the C part was easy; just grepping for point_marker, and things like that. ;-) > >From f7a23531886fe458346f13ee08369d153b2de897 Mon Sep 17 00:00:00 2001 > From: Pip Cet > Date: Sun, 10 Aug 2025 14:53:49 +0000 > Subject: [PATCH] store Lisp backtraces for markers > --- > src/alloc.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > diff --git a/src/alloc.c b/src/alloc.c > index 07ca8474bf3..c8426e3a4dc 100644 > --- a/src/alloc.c > +++ b/src/alloc.c > @@ -3812,6 +3812,12 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, > p->next = NULL; > p->insertion_type = 0; > p->need_adjustment = 0; > + if (!NILP (Vmarker_backtrace)) > + { > + Lisp_Object backtrace = make_nil_vector (32); > + get_backtrace (XVECTOR (backtrace)->contents, 32); > + Fputhash (make_lisp_ptr (p, Lisp_Vectorlike), backtrace, Vmarker_backtrace); > + } > return make_lisp_ptr (p, Lisp_Vectorlike); > } > @@ -3836,6 +3842,12 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos) > m->need_adjustment = 0; > m->next = BUF_MARKERS (buf); > BUF_MARKERS (buf) = m; > + if (!NILP (Vmarker_backtrace)) > + { > + Lisp_Object backtrace = make_nil_vector (32); > + get_backtrace (XVECTOR (backtrace)->contents, 32); > + Fputhash (make_lisp_ptr (m, Lisp_Vectorlike), backtrace, Vmarker_backtrace); > + } > return make_lisp_ptr (m, Lisp_Vectorlike); > } > @@ -7461,6 +7473,10 @@ syms_of_alloc (void) > If this portion is smaller than `gc-cons-threshold', this is ignored. */); > Vgc_cons_percentage = make_float (0.1); > + DEFVAR_LISP ("marker-backtrace", Vmarker_backtrace, > + doc: /* */); > + Vmarker_backtrace = CALLN (Fmake_hash_table, QCtest, Qeq, QCweakness, Qkey); > + > DEFVAR_INT ("pure-bytes-used", pure_bytes_used, > doc: /* No longer used. */); > -- > 2.50.0 > Use like this: > (dolist (el buffer-undo-list) > (and (consp el) > (markerp (car el)) > (message "%S %S" (car el) (gethash (car el) marker-backtrace)))) Have you got any results back from this, yet? [ .... ] > > It is unclear whether the creates these markers, or just puts > > existing markers into buffer-undo-list. Maybe we could do with a > > primitive in marker.c which would print out the current buffer's list of > > markers. > That also sounds like a useful debugging aid! I posted it (Fbuffer_marker_list) in an earlier reply to Gerd. [ .... ] > >> Might be possible but also requires to find where the markers are > >> created, find out if they are nver required for undo, and so on. > > Here's a patch which tidies up several markers. Unfortunately it doesn't > > seem to make a massive difference to the problem. > Have you tried applying the patch I posted earlier, too? It doesn't > appear to be included in your changes, but it made a difference here. I've just tried it. Repeated M-: (length (buffer-marker-list)) in an empty buffer now reports an extra three markers per iteration rather than the previous five. So, thanks! We just need to track down those remaining three markers and remove them, somehow. :-) > This is against feature/igc, but the code looks unchanged from master. Indeed, yes. > >From d5cf17f88fbba4cdfc61ebea725e12a2c8b9aa42 Mon Sep 17 00:00:00 2001 > From: Pip Cet > Date: Sat, 9 Aug 2025 10:32:19 +0000 > Subject: [PATCH] Detach markers explicitly so they don't wind up on the undo > list > * src/xdisp.c (unwind_format_mode_line): Detach markers when we're > done with them. > --- > src/xdisp.c | 1 + > 1 file changed, 1 insertion(+) > diff --git a/src/xdisp.c b/src/xdisp.c > index 432dd5dceca..2406bb6f3d9 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -13828,6 +13828,7 @@ unwind_format_mode_line (Lisp_Object vector) > current_buffer = XBUFFER (buffer); > set_point_from_marker (AREF (vector, 11)); > + detach_marker (AREF (vector, 11)); > ASET (vector, 11, Qnil); > current_buffer = cb; > } > -- > 2.50.0 > Pip -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 11:48:30 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 15:48:31 +0000 Received: from localhost ([127.0.0.1]:49822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulUlC-0005g8-Gc for submit@debbugs.gnu.org; Mon, 11 Aug 2025 11:48:30 -0400 Received: from mail.muc.de ([193.149.48.3]:44459) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulUl5-0005fk-L7 for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 11:48:27 -0400 Received: (qmail 70743 invoked by uid 3782); 11 Aug 2025 17:48:14 +0200 Received: from muc.de (p4fe15e13.dip0.t-ipconnect.de [79.225.94.19]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 11 Aug 2025 17:48:13 +0200 Received: (qmail 11813 invoked by uid 1000); 11 Aug 2025 15:48:13 -0000 Date: Mon, 11 Aug 2025 15:48:13 +0000 To: Pip Cet Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: Gerd =?iso-8859-1?Q?M=F6llmann?= , =?iso-8859-1?Q?=D3scar?= Fuentes , acm@muc.de, Stefan Monnier , 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello again, Pip. On Sun, Aug 10, 2025 at 16:35:11 +0000, Alan Mackenzie wrote: > On Sun, Aug 10, 2025 at 14:56:56 +0000, Pip Cet wrote: > > "Alan Mackenzie" writes: > > > On Sun, Aug 10, 2025 at 06:55:45 +0200, Gerd Möllmann wrote: > > >> Pip Cet writes: > > >> >> - record_marker_adjustments undo.c:127 > > >> >> - record_delete record_delete:187 > > >> >> + casify_region casify_region:555 > > >> >> + adjust_after_replace adjust_after_replace:1408 > > >> >> + replace_range replace_range:1639 > > >> >> + del_range_2 del_range_2:2030 > > >> >> + record_change record_change:201 > > I think the Lisp part is easy: we can simply capture a backtrace and > > attach it when creating the marker. [ .... ] > Have you got any results back from this, yet? I've got some results. With my modified master, when I repeatedly do M-: (length (buffer-marker-list)), I get three extra markers each iteration. Tracking them with (a slight modification of) your (Pip's) tool, I see that all three are ostensibly created by read-from-minibuffer. [ .... ] > We just need to track down those remaining three markers and remove them, > somehow. :-) Fread_from_minibuffer just calls read_minibuf. By perusing the source, it seems that two of the three repeating markers are created in save_window_save, called from Fcurrent_window_configuration (which is called from read_minibuf). With a bit of refactoring, we could arrange for (at least) two of these three regularly created markers to be nullified. This would be tedious rather than difficult. Is it worth the effort, though? It is unclear how much this would help the OP's (Óscar's) problem, though it would surely help a bit. > > This is against feature/igc, but the code looks unchanged from master. > Indeed, yes. > > Pip -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 12:21:36 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 16:21:36 +0000 Received: from localhost ([127.0.0.1]:49893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulVHE-0007Ij-Dg for submit@debbugs.gnu.org; Mon, 11 Aug 2025 12:21:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33648) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulVHA-0007IM-EX for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 12:21:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ulVH1-0001kD-3A; Mon, 11 Aug 2025 12:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=R4Ld98H6Zdx1nRQx6zbG9Kb0cPcxc5yDvNdPvX9VCLc=; b=Ghyt3fo8nLIWxYNHsN/I frd82c+5wQBsm+M13UfeiqTIj1EH9Ubf01KX+ELHDCdqppNpXZbFpILt6EjlcQ6TsbrXDmx2XLtkS CPlAEa9Fi7Lar/5hjrhl4wKoOMxA7+VRtcKDLibMciKnzO4HuwBELHiLJjLBcKO/8zHXeG2H5pI/f e5UzdRn0R0A3hFpiM9+u97/8sbnblGp9xlFh4nheUiN/Z4iw83XVt6jf81/AOyERRu2xCRpsKllcm vrV90bh3NEH+s20gthbDhP/sE1r7I4SPAeVAzJfoc4LJHDbUdcJyAbCHz7i2Z8SSYZ+14kz4Wyq+r 0X0j+MOyU3U8/g==; Date: Mon, 11 Aug 2025 19:20:43 +0300 Message-Id: <86zfc5akys.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-Reply-To: (message from Alan Mackenzie on Mon, 11 Aug 2025 15:48:13 +0000) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, gerd.moellmann@gmail.com, oscarfv@eclipso.eu, monnier@iro.umontreal.ca, acm@muc.de, 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Gerd Möllmann , > Óscar Fuentes , acm@muc.de, > Stefan Monnier , 79200@debbugs.gnu.org > Date: Mon, 11 Aug 2025 15:48:13 +0000 > From: Alan Mackenzie > > Fread_from_minibuffer just calls read_minibuf. By perusing the source, > it seems that two of the three repeating markers are created in > save_window_save, called from Fcurrent_window_configuration (which is > called from read_minibuf). > > With a bit of refactoring, we could arrange for (at least) two of these > three regularly created markers to be nullified. This would be tedious > rather than difficult. Why aren't they collected by GC? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 12:35:39 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 16:35:39 +0000 Received: from localhost ([127.0.0.1]:49927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulVUo-0002MJ-SH for submit@debbugs.gnu.org; Mon, 11 Aug 2025 12:35:39 -0400 Received: from mail.muc.de ([193.149.48.3]:42935) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulVUg-0002Lv-7c for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 12:35:33 -0400 Received: (qmail 32031 invoked by uid 3782); 11 Aug 2025 18:35:23 +0200 Received: from muc.de (p4fe15e13.dip0.t-ipconnect.de [79.225.94.19]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 11 Aug 2025 18:35:23 +0200 Received: (qmail 12701 invoked by uid 1000); 11 Aug 2025 16:35:22 -0000 Date: Mon, 11 Aug 2025 16:35:22 +0000 To: Eli Zaretskii Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86zfc5akys.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, gerd.moellmann@gmail.com, oscarfv@eclipso.eu, monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Mon, Aug 11, 2025 at 19:20:43 +0300, Eli Zaretskii wrote: > > Cc: Gerd Möllmann , > > Óscar Fuentes , acm@muc.de, > > Stefan Monnier , 79200@debbugs.gnu.org > > Date: Mon, 11 Aug 2025 15:48:13 +0000 > > From: Alan Mackenzie > > Fread_from_minibuffer just calls read_minibuf. By perusing the source, > > it seems that two of the three repeating markers are created in > > save_window_save, called from Fcurrent_window_configuration (which is > > called from read_minibuf). > > With a bit of refactoring, we could arrange for (at least) two of these > > three regularly created markers to be nullified. This would be tedious > > rather than difficult. > Why aren't they collected by GC? They are, eventually. But my hypothesis is that between GC runs many hundreds of useless markers clog up the buffer's list of markers, and these in turn clog up the OP's (Óscar's) undo list. And that if we could reduce the number of useless live markers we leave to GC, we could resolve the OP's problem. It may even be that the vast numbers of markers we suspect get created are slowing Emacs down noticeably, though there's no firm evidence for this at the moment. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 12:54:24 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 16:54:24 +0000 Received: from localhost ([127.0.0.1]:49992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulVmy-0003AP-A1 for submit@debbugs.gnu.org; Mon, 11 Aug 2025 12:54:24 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:56339) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulVms-0003A6-QB for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 12:54:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-459ddada9b1so43259935e9.0 for <79200@debbugs.gnu.org>; Mon, 11 Aug 2025 09:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754931251; x=1755536051; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=D1xGWRI5HA89Pzj7wiCFC4ylxPzA6T3XNKp1hzIclZ8=; b=CXZcQ3qJzgdrZn+hpNpRwTfrQ/OUpd5CdhhVmFqeFEh2jAYyz7N75ICD/lPPqd+BKu bUUmWQwIwDGqAf7xe5cVZug2pC/sClVMfldMCocxX/SRaUKiVw7JqnUigj70IjH30iEj HM/T9QC9l4uMIRnWYmPFq/65JnpDM+EJI8P2iq8U0IfrBqhAPkJn1AVUsawmT/gtSm+L zcwDUajTXhGL+JsltAL/Bvx98PjqXrGk9IGyd98WvbjfhJ3nMeODFi/nJ8UK/Q4n+ZA/ qTATKzXrzp2HdS6gfAmzVWVi7z4L3RATSHORRqRq3JpjkX2/nhhDe1zrH+oJ6aQMUSGD l4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754931251; x=1755536051; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D1xGWRI5HA89Pzj7wiCFC4ylxPzA6T3XNKp1hzIclZ8=; b=bIMzyJ3+VlSTB+DVJYLu30r4Q2Uh1QJzPSwjDm9qJRB95Rx4ROW0Ooa0dnEV28rs9T GtJTTJn/LGlLiXJzHUeg+sPZP1MbRFr8XmahH2AlhtuPZV2HVXJNd8yeuaQB9xk8O3DD DMmE0z3l8r2DntK3EhdhwBBm2jqBUm5pCugdhO+fzB8XW95Mu6OG6T0VunOjnp6t5ifn MjWBTJPKqtiw3I+nDFK4wVk8ShYde9L6kxvM983KSsZJBCdIdmFxf/8CrQFhTAUKLO7V TaYG38353dfh8O9uRmVf1ak//c/CL/fSNm03AN8dV3lD+TfijtDA2dhuc6fPiJGCtH7R Fh+A== X-Forwarded-Encrypted: i=1; AJvYcCVBXxSrQhVstFrM9FyHRKGViBRQ2lHzTMDq464mNdxz4TrMWSayEcEX3JWTfRv5cOvEa6Zdxg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxuhdZlpfIkIJCXmweTSbLHZVbzmQcx0nf9smfCmHZOS7pa01uE yMiGbE1KgUT5RRTYqut/pSSncECzXxe7L8CNsfrVW/puw7+0FRVd1ybiwqjbnrXx X-Gm-Gg: ASbGncvcaXJYIXW+HucJ3Feduu467TpuNDuVt8uMu5FpL3YRoYmhwxGr/dmVocLdZrj MFs5siqitOietuYcfvjyDggE6bHU8P9gNFKj+QFjoqcWF/ZPQtBY2Yp1HAfNFJOZN/Vrlv74IB1 +TsKfTISmSj2IqLURvNToaQvlizU20CHkphPuO9aJUykCUcYGgeOQkH1+r5mPz1rSYTC2uO7+MQ B0qg6OdbABDgv6WY14Kc1671HbyQz0by9SWGH0luZAm3H078i3HVhDH3na1zeM6YAWJlGd4DCwV /bgTc7iX8vRRLDgFe0P/jVvrlFMdRPUjc4YnzrKt4o59Tmc3ToUlezW5wy5eur82Kn8v5IhWxCW nvT8f9OwRnBXOkDKrnlXrcOWB6JmCcuQDjOXElwwzM2ymm/EqSnCe2c/UWPlJIaGJ0UIVYP4xEY VlDSMYiwHXu9GoERdVc3O3PrBOKhuocFU= X-Google-Smtp-Source: AGHT+IEr9RF793HblToGxDFJ4doaLmNps5BEQkEYZrX5+K1CI76bBkzowUqza6hDeHTYcvN9F2/bMA== X-Received: by 2002:a05:600c:1988:b0:458:bfe1:4a81 with SMTP id 5b1f17b1804b1-459f4f039dfmr127773195e9.17.1754931250888; Mon, 11 Aug 2025 09:54:10 -0700 (PDT) Received: from pro2 (p200300e0b714c200c403ca86915316a6.dip0.t-ipconnect.de. [2003:e0:b714:c200:c403:ca86:9153:16a6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3ac093sm43344394f8f.9.2025.08.11.09.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 09:54:10 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> Date: Mon, 11 Aug 2025 18:54:09 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org, oscarfv@eclipso.eu, Eli Zaretskii , pipcet@protonmail.com, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > It may even be that the vast numbers of markers we suspect get created > are slowing Emacs down noticeably, though there's no firm evidence for > this at the moment. I suspect that too, but who knows. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 12:58:25 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 16:58:25 +0000 Received: from localhost ([127.0.0.1]:50015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulVqq-0003NB-Gt for submit@debbugs.gnu.org; Mon, 11 Aug 2025 12:58:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47590) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulVqh-0003Mp-Aw for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 12:58:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ulVqS-0008WO-GL; Mon, 11 Aug 2025 12:58:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=tZjWu+lhsPWbfwvJ19Fbxnp3l33y/20SYw/lFJ/TYXE=; b=saBWdVkiCTq2Iids8iju 8s7cZKAKsEfxXbTbHgGdDk8VZ9YAr1WN99UYNUHqAqmuKwwc8bnYmqv0O4LhsP2NE0TSL9aD1jpL1 vcQIRU7gOo3lpKg6sSi6YgUozHQKvlCWd/RzJHGcQE0JuiHM6o7LN/UoyWzxsclayukW1SY3FR+xc 6BwFa/kby3xyV1vy0h+2NJdgAzmqrezr1oC3pQLtx3LtiOYNmZlYWVL4c3r8f1C8fM65SHOZp7hey FBNohQE/tyvEI6pRXmDEa1v9hliurHXYTGMdGmsqN/lg8cAna8Xn8K1UY2xJRLyBQChKQz7CtIIo9 TCYUmb+gXMiNlw==; Date: Mon, 11 Aug 2025 19:57:53 +0300 Message-Id: <86v7mtaj8u.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-Reply-To: (message from Alan Mackenzie on Mon, 11 Aug 2025 16:35:22 +0000) Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, gerd.moellmann@gmail.com, oscarfv@eclipso.eu, monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 11 Aug 2025 16:35:22 +0000 > Cc: pipcet@protonmail.com, gerd.moellmann@gmail.com, oscarfv@eclipso.eu, > monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > On Mon, Aug 11, 2025 at 19:20:43 +0300, Eli Zaretskii wrote: > > > Cc: Gerd Möllmann , > > > Óscar Fuentes , acm@muc.de, > > > Stefan Monnier , 79200@debbugs.gnu.org > > > Date: Mon, 11 Aug 2025 15:48:13 +0000 > > > From: Alan Mackenzie > > > > Fread_from_minibuffer just calls read_minibuf. By perusing the source, > > > it seems that two of the three repeating markers are created in > > > save_window_save, called from Fcurrent_window_configuration (which is > > > called from read_minibuf). > > > > With a bit of refactoring, we could arrange for (at least) two of these > > > three regularly created markers to be nullified. This would be tedious > > > rather than difficult. > > > Why aren't they collected by GC? > > They are, eventually. > > But my hypothesis is that between GC runs many hundreds of useless > markers clog up the buffer's list of markers, and these in turn clog up > the OP's (Óscar's) undo list. GC runs quite frequently, and will both collect these markers and compact the undo list. So I don't think this is a part of Óscar's problem, at least not on the master branch. (On the igc branch we currently have no solution for compacting the undo list, and I hope we will find one soon.) > And that if we could reduce the number of useless live markers we leave > to GC, we could resolve the OP's problem. It may even be that the vast > numbers of markers we suspect get created are slowing Emacs down > noticeably, though there's no firm evidence for this at the moment. If GC solves the problem, I don't think we should waste energy and make the code trickier by trying to get rid of these markers faster. We have other objects in Emacs that take their time to be collected (example: font objects), and we don't consider that a problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 16:54:34 2025 Received: (at 79200) by debbugs.gnu.org; 11 Aug 2025 20:54:35 +0000 Received: from localhost ([127.0.0.1]:50443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulZXO-000664-J3 for submit@debbugs.gnu.org; Mon, 11 Aug 2025 16:54:34 -0400 Received: from mail.eclipso.de ([217.69.254.104]:39456) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulZXI-00065k-9r for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 16:54:30 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754945661; bh=NpL3xihaEakbNw1BoJq2zMEeNqY6cGM4RJM+FA8efGg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=tImS5kMvt7igqAR+rEC3E9zCD3SA/7IEtuqlRryJmfMYWLy40r780G/AUZLN9BmWy vQ2vv7Kn5UUUd/RamkiU8/PweP8Og855wTs/7nuUNQiW3zdjF79d23jh84ldZbkLm8 9ZxUK9JaGNIEljcohVT87SsICfjs2ydswfwu1F8N6miil0RtskFnrCO0pdzS/FheL7 JgtvAAixC//9CiNncEOLy1HeIyVNLNM1P8HCfqRLlVv8Myb1aM32QCoXgkROKHysmt XYnmRdg3SAFD3Uopouud8fq5+tQuIwbBgWzHf1scM/YFe8Ro254L6fIAjoS6fMKq3Y HerJ37Rt6oURg== To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> Date: Mon, 11 Aug 2025 22:54:19 +0200 Message-ID: <87wm79r344.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: gerd.moellmann@gmail.com, 79200@debbugs.gnu.org, Eli Zaretskii , pipcet@protonmail.com, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Alan Mackenzie writes: >> Why aren't they collected by GC? > > They are, eventually. > > But my hypothesis is that between GC runs many hundreds of useless > markers clog up the buffer's list of markers, and these in turn clog up > the OP's (=C3=93scar's) undo list. > > And that if we could reduce the number of useless live markers we leave > to GC, we could resolve the OP's problem. It may even be that the vast > numbers of markers we suspect get created are slowing Emacs down > noticeably, though there's no firm evidence for this at the moment. Since yesterday I'm running igc with 6f494d74f645d6c reverted, Pip's detach_marker patch and this in .emacs: (defun delete-markers-from-buffer-undo-list () (when (sequencep buffer-undo-list) (setq buffer-undo-list (cl-delete-if (lambda (el) (and (consp el) (markerp (car el)))) buffer-undo-list :end 500)))) (defvar delete-markers-from-buffer-undo-list-timer (run-with-idle-timer 3.0 t 'delete-markers-from-buffer-undo-list)) I'm aware that something like this can cause nasal demons, but so far no ill effects observed. I think Emacs/igc is using less memory than usual (in my past experience at this time it should be well over 1GB, but it's stabilized on 0.8GB.) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 23:44:42 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 03:44:42 +0000 Received: from localhost ([127.0.0.1]:51023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulfwI-00009i-2c for submit@debbugs.gnu.org; Mon, 11 Aug 2025 23:44:42 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:61726) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulfwB-00008y-Po for 79200@debbugs.gnu.org; Mon, 11 Aug 2025 23:44:38 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-459e20ec1d9so49328115e9.3 for <79200@debbugs.gnu.org>; Mon, 11 Aug 2025 20:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754970269; x=1755575069; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O6LZ6xykgv25YsqS4bKcVy9UFzWpbbilpMhZRyq/v1A=; b=aJAFpEeZrB44pPs4pJQ7hrfM6o7ke/wmGegshrN2RUN9hpAVgi8tE5YHC4wwdasv+j Ns6GctvZbqjsxwGX7ZLxAjA/ReTrFGiw8/W5zWtViQNcMDNfb/6hE1eipSvQAqvXJVFl fslBvQMbz0iYt8EDo1QrdFe0biLPHzx9v9E1FToqn9fuFAtlH3piQLSetf55pZLGuv6h l++K6VDicTjy1AyojUXWXRHaVexm754Jfg5nE/RiF0fn3FbsjQM0KFi7IhJGpVV462uI OsA9xflZ5l4BI17i1HJHBXpjoqOh8+7fbuOZ+CMi8k/eRQ3oUVGdaGFdqPL9IVybJEGD X0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754970269; x=1755575069; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=O6LZ6xykgv25YsqS4bKcVy9UFzWpbbilpMhZRyq/v1A=; b=KZwHoBbspWX2BuLV3zZ4F8iYNjh39ZCe3JHC/kYeVCPaH6d6JZEujOd9oqnSjgTipE kIQj7qd6Dp3N7uWxVhDhEnebP+h6pAgCG3gGjRzguTqdqQPrPjM5NGICjtDe5Gj6Sk/6 ka1WpqwBlLQWVaylC8JG/OXUEdSrJY0vOQElxgN8i2Lq48M60RY1ZznMkEq+2x2AasmT m5L4ifoueUAgZUd1AO/ZzfdDyAOev8juYgeZP7ylY+ipVZGuFTcY0O85uqzmoL6roTT7 EJkRyRVAO8Fl7HNsVi58JDLDJhdZVlkCCVlitSrpmz+4UJotgmYPPh/xQpxNHdumwXcR gXHA== X-Forwarded-Encrypted: i=1; AJvYcCXMgFcki9s+WmxPZ/mUTE/QvgNAJuXLQeZPbr9NtDXiE8CYVww6GI/g6de6xEI+yieWAPBgRw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwewtR1Fo3TGWuLt9y6XlMU5tBmqILjcjmNvMlXfAYOtp7IALdJ dd7x7ss/uDtumqL73qsHUqckvmcDAKDnWc3CmfpbyHrfEGcOhlUVR5hA X-Gm-Gg: ASbGncvKgLcrRw4xk9sv7Alj8p9obuR9/iDfZZpbrNs8lp47+UD+XFvawxoyVJz00Og clYNFnkh5c6QWuGzZIiSwkxqP8QLHuMF8xTYjSIlHH5U7w0jGBdzz+Uhibcm535WdGBpFbPkd71 JzzS2BnAm4OOF/20tiOh+78roCfPW0sWkFXnwOYY+nhLC89rF0d/qIwLKs8ldZ5YrEalLoxFYd5 M9VRB4GQjXAaqkPshpl3XUdTjUgN5Yolp2vUZYSX7u/QnKIn4Uvo0WGXyRDQbA1DycSyvwEtl/l yR/h520mWcVjsTSnbnmqFTlG48gff3x+OzZjaN38h6Znnnhf+Q+aO0Hr7MgP6uwI5MEozSaZEyw Rz1+pNoRykLG/F93kEy5q6VeBQexVk4VcXw1Hm6HEKJ2mMhdznv+Zfbn2ZoeCPj5GARq0B+zGLf mTDSl2GH96Kk+ihZngcekfpMTjHWrDUiI= X-Google-Smtp-Source: AGHT+IFTAjXzgyx/PsOIuf+fjw0k/EpXmm4iTvxR5x36DVuu3tElJEF6BftOcQaBxM0kah5NDSwyxQ== X-Received: by 2002:a05:600c:b93:b0:43c:fcbc:9680 with SMTP id 5b1f17b1804b1-459f4fac9e1mr125839245e9.25.1754970268867; Mon, 11 Aug 2025 20:44:28 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-458bb04c612sm396816765e9.0.2025.08.11.20.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 20:44:28 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 05:44:27 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > I think Emacs/igc is using less memory than usual (in my past experience > at this time it should be well over 1GB, but it's stabilized on > 0.8GB.) I still don't understand why these marker entries in the undo list are made. Maybe someone else knows? I mean, when we undo, markers may have to be adjusted, that's clear. But why only specific markers, the ones having marker entries? Why not go go over all buffer markers and adjust them according to what is undone? I don't get it :-/. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 00:50:09 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 04:50:09 +0000 Received: from localhost ([127.0.0.1]:51136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulgxc-0003HE-Mj for submit@debbugs.gnu.org; Tue, 12 Aug 2025 00:50:09 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:57827) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulgxX-0003GX-1H for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 00:50:04 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4563cfac2d2so43433575e9.3 for <79200@debbugs.gnu.org>; Mon, 11 Aug 2025 21:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754974196; x=1755578996; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/XbnVx05VkI6Bu+XD3lrv9nQML13O8YzcXNghKu7KrY=; b=aW92LW7SbT2lzOcE3TsXUAa4rsoB6FW+Ik5Gm5z5row2eOAlvqm8A8g9bWU++9vEAw 7E75/8+1in1D/SDaZOEildXfj82KO9XaUAawy01dn/qiO34FbfaOT3Kb/dN9BMfbwo7K ufpyM3+G9tDzi5/Q5JMiZuL8p28y821avLANTaJIt+0iqMSYmNSxKX6CTBkbhy+TYaiv j3LawPIL7ufGWUJaEeMO/KtlosfotkZzR9g2aL53qchvppeu/WBjLo7Vw+GuGYRVo3xk ZBt4Bg0HWifCR9iDXQT67LRf8Zy+4Sv0eX8vu0l6l5GRgAh5OQdZMdMR1sBAuUtsgGCc ZK8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754974196; x=1755578996; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/XbnVx05VkI6Bu+XD3lrv9nQML13O8YzcXNghKu7KrY=; b=Ia5zRHS288ZkS6ddvSdxP6JusPhLHXy+zIWwZvD0ydCfnMyX4few8GitjxACvUofGc mFBDz5MPok0ASYpaIkS05CzTyUWZRvKJu1E6sS21lGEb+x5Kpqmd9unrMuyy/vj+py7p 5gGwpc5J4sBPysy/DFlxU0f+ysj3ms3WLWoslxRFrbS8wcBz+61IxPWdKp2Lu1Bj+xrc S/VVa0XHNHLLGf6+2ujOPy2bbr3cBN31u6ufCuqqqby2rabQM5+byR6mZxSDLugjHTpA shlbQSIV/83tX6iogjXK3FXsiQsc0OFhx1hAisEgvFWGMcGpMUm4THTGcFzVNtTwAXpW Udeg== X-Forwarded-Encrypted: i=1; AJvYcCVLpVqbQ/PhSCh2M5EhdEcUdqbmDgHXiNZXBIIFundeA5ZKH6oHS98TFJnrjlz0VbJqSGaMZA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy7ki7/wyZbyyKDkYJ+tIBWPrbUSq5GiuKTFvjJ7wivLZplXq/J 86hn04ylwMjG+4kXo4QI0yAU4YPD1bbP0QNV28ZQdyeG2bh26rZTy0oC X-Gm-Gg: ASbGncvr5CLqjQu4BBgP9NnB8qGnBFilDRB64GJ3Dw3240rWatAt75n7mgWV+j9ndzc 9BuY8i25yKG3Ol7XmBjRb6D6xgdiA7YFxhSmKdsxJ4IHOg5FnuDc7ugBKg8QNMnWoGf1iM8CiAk YrBAgIA4P9gTotZu/ZfjJEWgRDGdNjZNaG745rJYLTmtYp7xMXmjEwHmWchUld+UleCmOcjaMhB kh3RDOmzBaAJsCIS9R6bdyNgE00oWoYART4RkWcTv+h1bUMGPDbjueT8kp4bIrMvjjmFt9IkKal SqaDrJEzQ3MmyuKBFGi1sZYLAEtZYvHXF7wA2C++QVD4ZNO+O0PyWBcMuCv6ILwMfN1WaMDOyqn J0GkV1hUP6FqDj3DgVRHU8uUq0EzOdV5i3sqvvHvxmTz/YH5QQQgpTeqjcRwtNYoo4hkUZBpoG5 mXJQ/aEclnkm/wFks0fBiG0Nr13QFFsQM= X-Google-Smtp-Source: AGHT+IGL2jUP8iVNzUNNFH85Vty+HMWclvFDB7sIMib0+wSBPAyzEEWEAaDpHcmUCI9ilGOfltfSCw== X-Received: by 2002:a05:600c:35cb:b0:456:1c4a:82b2 with SMTP id 5b1f17b1804b1-459f4eaf75emr154176835e9.10.1754974196262; Mon, 11 Aug 2025 21:49:56 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5873c43sm302209995e9.22.2025.08.11.21.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Aug 2025 21:49:55 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 06:49:54 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > =C3=93scar Fuentes writes: > >> I think Emacs/igc is using less memory than usual (in my past experience >> at this time it should be well over 1GB, but it's stabilized on >> 0.8GB.) > > I still don't understand why these marker entries in the undo list are > made. Maybe someone else knows? > > I mean, when we undo, markers may have to be adjusted, that's clear. But > why only specific markers, the ones having marker entries? Why not go > go over all buffer markers and adjust them according to what is undone? > > I don't get it :-/. Whatever. After landing here 37ea8275f7faad1192ddaba9f4a0789580675e17 Author: Barry O'Reilly AuthorDate: Mon Mar 24 22:47:39 2014 -0400 Commit: Barry O'Reilly CommitDate: Mon Mar 24 22:47:39 2014 -0400 in the history, I doubt it is wise to pursue the idea of removing marker entries further, unless we have someone who knows the undo code in and out. An alternative for igc, maybe, could be to make the markers in the marker adjustment entries weak references. We'd need such weak references, though, as Lisp objects. I have a vague memory that igc had that at some point, does someone remember? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 03:56:44 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 07:56:44 +0000 Received: from localhost ([127.0.0.1]:51564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uljsC-0004CN-18 for submit@debbugs.gnu.org; Tue, 12 Aug 2025 03:56:44 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30931) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uljs8-0004C6-AN for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 03:56:42 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 60CFF80AF8; Tue, 12 Aug 2025 03:56:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1754985393; bh=H2JnFKevSV/dHIPNsDNw8mJFmSv3L5mv9GbS06HQJDE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JIDygSgGaD9+rwdqxMcZxDqrSJep+n8l6mobXBqFMXidsJH/fGOyxIu4s1pxmwKS8 H/FeXCoh9iClFSB9tyt5hSzQrGJzFIKB3yCaEl1wablOOIKafzzkvdgAYHfmfjrk4i ECoKwT3Rhw1jFio83YdQAoy5kg7vB8Q3H/8VgHyq+KOycvUIiuyI++bpZauKEil4Cb f5ZLjshWvvmhNwCX6RNR/VplVmFDGyoJW24GC/PMCrZAxJxyjTyo0LNsgIYmXL1ws6 iDwm2g3h/z4qTMdrTA967Pv/+f8wfC0PzIgVTsMtfo4F9hK3CYzkQZ5kGMrZfydtpn LX+OnBH/UCjDQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 447708071A; Tue, 12 Aug 2025 03:56:33 -0400 (EDT) Received: from asado (dyn.144-85-254-173.dsl.vtx.ch [144.85.254.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 76A1A1202FC; Tue, 12 Aug 2025 03:56:31 -0400 (EDT) From: Stefan Monnier To: Gerd =?windows-1252?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# Message-ID: References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 03:56:28 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?windows-1252?Q?=D3scar?= Fuentes , Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I still don't understand why these marker entries in the undo list are > made. Maybe someone else knows? The automatic update of markers is insufficiently precise when the we undo a text deletion, because all the markers that were anywhere within the deleted text end up with the same position after the deletion. So we have to record the offset for those markers that were in the middle of the deleted text such that when we re-insert the text we can put those markers back to where they were. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 04:03:13 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 08:03:13 +0000 Received: from localhost ([127.0.0.1]:51584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uljyS-0004V1-O2 for submit@debbugs.gnu.org; Tue, 12 Aug 2025 04:03:13 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:57798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uljyP-0004Uk-Nt for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 04:03:10 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3b780bdda21so4256877f8f.3 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 01:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754985783; x=1755590583; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=J+3nO/zXag/E/jKosVd5fPaZ+1sQq5F7efRzfKx0hdM=; b=ZtdZXdlyT22avq1hSiDWQ4cFOt8dNbKWjdYFPxj9Pcuw1ahul32TRdN6S4X5RR0M5l EKd9VYCua1ljzG+JjMSwjQjMiV+AcvFbKSDipIJ7+NoamjcuOnx/SxFcJGbymTGWY9M2 UUH8MYxDdGy0AyzoTqRsErJMg1XhZylPwQOnrrz2xbWVm0ooiwRtbveJHN07smEtrUr9 fgeAfuXR3gl+n2U9IvqOdwbbEdTboiSDBlM8UvBWU8C8JXBRzm/18PGwEpZ0aHUiznth WlqqWR14DZfm/nPvtsoGOOXNK7MD8oEvPLlTkRhmWJUM6z+BX5JZCjrDzramqXrFVFdH gR+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754985783; x=1755590583; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J+3nO/zXag/E/jKosVd5fPaZ+1sQq5F7efRzfKx0hdM=; b=jqSCkLl0cjIaswuIx6C3t70wk9sm9gBWbwCiIv+/XXmIZlNhpJBLh1CCpX2UA20koj i2ox3Ui9uwl9q/apS8/01GBQYOqGJCO7JZTPl6qTHtbmnIsDw3Yp29wXGGBIpYnUCAF4 oBsH7A8zbUuKB9bgP2hUFJtppL06wR9kGAAn+BTu+LL647VWLarXHbe06ho8SxTu1PWX 6X+5qNqXRi/azvOeFjyU8RQEtrAVUO3BACQiQ9xT7Qk0hB0dBPQVu8FX1ZLiDigY369e m5DmkUp5kXSl8UCphYIJ1+IZfOvxnwiEAqClxWMhSPAZqmlHSJnHB5S+Q8sxApL+1BPc ec7A== X-Forwarded-Encrypted: i=1; AJvYcCWrgrB8+xtHpSOi+6hCgRWrhyAHr18uqMR0omLBAbzhTHTfwJYaIvHPszpGYdIBCO+vjH+upA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwAuZt5NXlbNs6ENIyE7VAJNna2/DHIuzMuZ5QeMqrJQyR573c+ N7Hmt20/7k5m3JOQkQivDxTo5Y+osRe1yTUhY2V/BEo4wqu+Sxp0x+SE X-Gm-Gg: ASbGncvi5DCyvjFy9dGwYxLZCi8m48PCUTouL+AJdhhSWJ+6ZeEeb/QFerOQAt1Xb5O 80khCOb+QIK+IOD+lsR06QVMhD9SddNIPNgNrQuukurD2bH2xEgyFXE6e2R5JTyenOrgRen6TS9 UyQAg+sv9bUsa9/GfDk1gyDzZInwgvvxAFM/SPN77WppVKiKDpQ/PeK7rewkmlMU5rfKDtZs/51 aR7eCcR/12/CLjBfIfLQtR51W/gZsbIk0OUbUSorD87junOgiLnU3YprWoMoDXZEm5zaDOlevGi 0iMQ0acz7yT17Uw1wsKjRaMJvyKMzFZnRqRD85ALEAtz4GevMb1t4DfkzO74fdhN7BJg5jbxJ/U SVR/9gucgYbBvSNi0dzCA9/jBRBKMH7JKjS0yulAfoj0v6/60iYMEnD9w2kq8QiboUuQjM7IUxV cbsy78uKIPAiRd2I9+jWwJRe14fNbYnnQ= X-Google-Smtp-Source: AGHT+IFENHugtAzr26XkrkFq4MC3aFdptZVpXEuvzhUMddSGduWtldZa/SUMXv7MZVvXcbgh4u+HDw== X-Received: by 2002:a05:6000:40de:b0:3b3:c4b1:a212 with SMTP id ffacd0b85a97d-3b900b4713bmr11972512f8f.7.1754985782479; Tue, 12 Aug 2025 01:03:02 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c469582sm42416970f8f.52.2025.08.12.01.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:03:02 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Stefan Monnier Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 10:03:01 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> I still don't understand why these marker entries in the undo list are >> made. Maybe someone else knows? > > The automatic update of markers is insufficiently precise when the we > undo a text deletion, because all the markers that were anywhere within > the deleted text end up with the same position after the deletion. > So we have to record the offset for those markers that were in the > middle of the deleted text such that when we re-insert the text we can > put those markers back to where they were. Ah, right, of course! Thanks! From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 04:09:40 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 08:09:40 +0000 Received: from localhost ([127.0.0.1]:51601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulk4h-0004lv-TS for submit@debbugs.gnu.org; Tue, 12 Aug 2025 04:09:40 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:44527) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulk4e-0004lY-2j for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 04:09:37 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-6152faff57eso8255663a12.1 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 01:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754986169; x=1755590969; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o9uyE15fEMmxrkfH/teneWS9sQH5NifjU2V6EAPo+FM=; b=QuHYTs3PDhcbIkfy0CrpwO5Nm1zTRNKfQpCFNL77DO6WlKFweqEfblUEQGNpbFqrxo Vrvbpapp3yaikxo9dDE8oI8MWTzA1Lx3Tzogj/+U2vnPIuP29rELTeiwdIPgQb77XCtL o1a1kxIyOt6yonM/NNsj/g2JeYSETUftr4pSe/eZGQM09wY2J4nASUYq1eRXc2uwsXw1 D9cO32SKOCiUVVTEuxPC3lVskXbboRIg1JtIEEG0XUB274DxiMAB160b9agcKVID49eF kHBq7Cl3USaHWQp1crl5L5cSN4LaNdAjHMuBeXKYC2J0BTNKJUHKed53wBmfP68OK30B An+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754986169; x=1755590969; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=o9uyE15fEMmxrkfH/teneWS9sQH5NifjU2V6EAPo+FM=; b=vyj8JihW9RHJnn6FotvQLqv8vNazttlnMUvTj/AmKTR4jO2/uJ99a/yP0ali0wcR8Z bwj2pNGXAPYEub637Xc5nwUlWgOOFXzkBBAVcGoSrfsSK/WWMpIvftqxbeGFWoyJ7Y9a k5b9ZNeICc3BehVpK/bQor0xs+dFxwEAgNAjZNOQkZrepx7hKxB3jJt9q3AzQH8Y1Ouj 8pgJPWZp1SoTaw+ngaee/4kdEBI1r+ELjngtAyqtgpE8hrzxlP4VBMON9vVyVrfwL2ie qlCMKX6L80a4VbC+MQm/Cs6IQQw9dNiHGmcd9LGvNdm7zE3wkVk/gAMwHy7hNDZ+DDPh 17Cw== X-Forwarded-Encrypted: i=1; AJvYcCUjy4E0pJ49ixxtDa6KwI3JiloH++HPtKB4w2U+cfE2VBJRjXAoNUR0Xi649WuW7jUFOy6oLA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxwKq6VynV2wkbFTIu0o7HP7nqmd9bjFDL1u81zlijVmrVMRouW kAyf17Gi//5Q54gJUM/jJJtK2rGpM8rNNpw3H5i4VaNrZAXn9Yr6BBVIrzrQrqkj X-Gm-Gg: ASbGnctieL1WVbEN1jcUQKH1ReofJ2IW+ZlYqE6JTupT+YzBnHYZhsS+ev92+5r5Q73 EDORjV3vhLDubwV4Fw74jcLxuVbLmBuG11SzWbrCkdhlrF6HbmC8aYXuDXlA6xGlfwKRLTSSTwY Oyhrdsi3udkIWu0EqL1En1ug5DjLIJBGS36ya+hzBKQcwecRIqxyyvxO5LIROo0I51Jx4Q8gzjq 2dHCxfmscC6+ZOxC2JkjI3B0m+6l1ZcYAvZwELsdjB5JJdsHY01LDyV0GOigMQGGUPiSo2cBsnG TPJE+PVhnNCDcVngXvNlukV5Xv5TBlGoS7W703C3RrcAlchHrazfLsravgM9E45MSAhmS6dQbM6 WEvA3lBZpuQ7qCbpwEly3 X-Google-Smtp-Source: AGHT+IF59kAmYFtNDXNXor4yik4KznAH20yQCSKVF1L0kqWq4nsMg/1GTzoRajMZR3sN1idpln4zEg== X-Received: by 2002:a17:907:1ca4:b0:ae0:df46:abd1 with SMTP id a640c23a62f3a-afa1e15a6aemr234403366b.45.1754986169058; Tue, 12 Aug 2025 01:09:29 -0700 (PDT) Received: from caladan ([31.177.112.212]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-af91a07670bsm2183115566b.8.2025.08.12.01.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:09:28 -0700 (PDT) From: Helmut Eller To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 10:09:26 +0200 Message-ID: <87y0rpq7ux.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > An alternative for igc, maybe, could be to make the markers in the > marker adjustment entries weak references. We'd need such weak > references, though, as Lisp objects. I have a vague memory that igc had > that at some point, does someone remember? For a time we had weak-ref Lisp objects. I suppose putting such weak-refs in the undo list would still break some code. Instead of weak-refs one could also use another layer of indirection, e.g. put a fixnum in the undo list and the fixnum is a key in a weak hashtable that holds markers weakly. Even better would be if we could put positions instead of markers in the undo list. After undoing, positions should be correct again; in an ideal world anyway. Helmut From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 04:27:12 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 08:27:12 +0000 Received: from localhost ([127.0.0.1]:51640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulkLf-0005es-Sh for submit@debbugs.gnu.org; Tue, 12 Aug 2025 04:27:12 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42410) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulkLX-0005eA-Kn for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 04:27:04 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3b783ea502eso3565910f8f.1 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 01:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754987216; x=1755592016; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hF0gGpa64P8tbA24tq5JmnlKKfS0TxBUIuC4XUdsCnc=; b=Mg4Fw2xZfnEZcnQNX668ik2X5MnrbhbJQNZsWAkj16SV5ZMrMsOv4Iotu5NPKa4yoo lQ5lvUTcUudQT+aPkneP5IuuIjYnEHs+NJFXN7IynVGlf731aONaBz0FsAjNg4S6Yjcn kz/9NwzjGqUM44SP2NuX9MqQvKq2p+0G55RLlanVVTajJe6+lMecq5CQQqLzA4ZMAG5C fPnkJ5zSP+UqtvUQYLGFcFdAqghrYXwdeamhv6fRObGwL6J6ChKOi6jfzJGCrH5DKtr9 /Rn9XQCFxPgtGudk0J+OpqKGgomeT+onseIfABSxDsM6fQWclrZ4k3qvEKOAabsA3OZh k/+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987216; x=1755592016; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hF0gGpa64P8tbA24tq5JmnlKKfS0TxBUIuC4XUdsCnc=; b=l4hG4NB8QP+FIr8cn4Vlb/o7Vxga4JDnndO+1NqALrjoVnHf6Tq1t1hs4GtMjfsdpH aEXStSyMnxRzEsP1LjqfrG8UrjtHCbU+3XLn1rKWoj2VF8OiCysZBC48yz2e68Qhj+nl p49gEQJ4wqx5jQlSWFoxUrCCNAdXlRfhjt/VL8Fz0C0jdl27zPrkjbFOIFxwqnmb61hZ llsLm/JAxwN4E70mH2e0h8Bgyo/QG2Q6bTtz4+Kihl+SiB1XYaVj34Y8nInljIxWK8bh mXRjYoR9Z74JcuFO+VPxitkShu1Hf4WHcZAmkCto4uT/ajuoNMIlZrv2haWSmD8kXaEf J5JA== X-Forwarded-Encrypted: i=1; AJvYcCVDD1RZsAybJQjMn2Tsxyv/FtMq98En0srlFGOKSgY3Q8oGVXAFZWneC3poG8Mm+W/1IWLsMQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx+v+bozImLk77Ap8Wf6mauwsrPfOLQ7maoJNszNDkojDb2zIG4 u7VL5J9WQcwzjEOPOw73Z4FUyLuizgTyQaPgfal8Q2aM/xEb9qDKGtI2HpJbrLl2 X-Gm-Gg: ASbGncsjBIxN6JC+h8OwZUrUgln6BLnJUDM0msKi0a84C9zfcTCyk6exKmXLkycXZSY NycxU2d3hXdM8LLcJWuyqnrMStFtJaCv9E2ij31Cm77YKPetBrmjKgjaOVKzj5XyakoBo+1l8zg gumnFODS0Nj6YNk5OMCFPtGWsnk3MgyBJ7ue8N1PBnPCR0Y43w4tx7icfQ/bz/kpw14EZqPcYng u1PC3Y6+W8ccoSQgRwEYsoRqjhifOQCZq0Sj8BGT/uLTO912pnnqXH1Yqz8vtmkAVJ4FI1WKDK0 K/wBnULxMG1XHOU8cwsgRxPeWFOCojZCXfB4OhSyxG3ptDzdry91n9srYQoFcCeNkIeaLkeSF21 pitLqmx7m0Lj3I0wRaRaCQ23tFRj4fgA0vFyVuBYTgu8SgdOIn8hZ28JLe71KGHitFAFvn/EmaV f9SlAu0OO7lpH8E0mjb1TCuu6I39dnxDU= X-Google-Smtp-Source: AGHT+IGrrMJrfvCKhNhruszvstOIbuPVMcLbPtf5KorLa47OlKl1F9uVz5iEvCzg2i4cIAL9A3dlXg== X-Received: by 2002:adf:e549:0:b0:3b7:8ed8:1c80 with SMTP id ffacd0b85a97d-3b91113c95dmr1370771f8f.3.1754987216272; Tue, 12 Aug 2025 01:26:56 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c469582sm42492255f8f.52.2025.08.12.01.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:26:55 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> Date: Tue, 12 Aug 2025 10:26:54 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Helmut Eller writes: > On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > >> An alternative for igc, maybe, could be to make the markers in the >> marker adjustment entries weak references. We'd need such weak >> references, though, as Lisp objects. I have a vague memory that igc had >> that at some point, does someone remember? > > For a time we had weak-ref Lisp objects. I suppose putting such > weak-refs in the undo list would still break some code. Instead of > weak-refs one could also use another layer of indirection, e.g. put a > fixnum in the undo list and the fixnum is a key in a weak hashtable that > holds markers weakly. Yes. Or one could give markers a unique integer id, store that instead of the marker itself in the marker adjustment entries. Then, primitive-undo could iterate over the buffer's markers and only do something for those markers it has an id entry for. If that would work, we wouldn't need to employ weakness, which I think might be a win. It's of course fiddly again. How to find all places relying on the fact that markers are in the entries, with some certainty? What breakage are you thinking of? > Even better would be if we could put positions instead of markers in the > undo list. After undoing, positions should be correct again; in an > ideal world anyway. After Stef reminded me: All markers in the deleted range get the same position (ignoring details) after the deletion, so I think a position alone wouldn't suffice.=20 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 04:48:21 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 08:48:21 +0000 Received: from localhost ([127.0.0.1]:51687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulkg8-0006e4-Tx for submit@debbugs.gnu.org; Tue, 12 Aug 2025 04:48:21 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:52393) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulkg4-0006di-Ut for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 04:48:17 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-615460d9897so5953676a12.0 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 01:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754988490; x=1755593290; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IvazLEbx36+SLrnv+6wuR/HsfxgVNL0/1TZxqiFonNE=; b=UNi+JOeDZGsCnh8ObA1H+P8u3jy0ecNR6nbZ8TGZKR5PWnK7xS0AXDwhERwbLuLp+U T7iNJ/EPA+Xqw4a80TnuuneqCJzWcC51fuARqvVkscrgBGrCr32ToL8GAVFj1+fy8QPU LdNRvrKQFi0gPxmbqs/ZgMMxejT9LQb5mOhhOEIVuVrdAFxjUoVMDNbOkl5Xist1pMJM ZpVdO6tujbmTSFlAQbazPbZjcoIXZE6OXF/P1vGxCE3VT3rntts0p6Vg+/7JVmHFYYiu kfX751PbqHZdr+b4IpeF3Eg5YfHNCf+asrLOUuF5fjHtVGsrHzOh9LN0IBLTLLGPPt8/ 42RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754988490; x=1755593290; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IvazLEbx36+SLrnv+6wuR/HsfxgVNL0/1TZxqiFonNE=; b=DRYexAWzbL0uvUjZWWLdHPdZHg2wWgbAjVIfFZcAR+HaHbSmyCtMG+jxKdL/RnCZ9h O9FX2EpliO0Js35NXPtgjigd4WH97OQ7BV47b038Fj/qNgYECaZmA21P9r5sqEtsV+xP 6pTnvTJfR0HKhpHW3ALzoElbDLfF2F4EaEuuCeyuAUp8gRQ7z3hNJ1qWo4YWsfgYsHgN Gm1Hk1BouiELiWeh3QkpeolOP/o4Vnq/Gct1VfVMHDpmUEESPHzcnVUMtJ5WaRqx407A 0H0mMDnbdWZghhN2OxtHySeKVy66OvmVe4WsZWCDCj2VKmsbwWl9PrSZeQ9EABWuSPRW n84Q== X-Forwarded-Encrypted: i=1; AJvYcCUf74AtEP1Jn0kxcOG7SdNeNI6WS0HIn/DppLlr9gcubVGEjEeAMuy2cXvr2WzkgDUQsG7oKA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwjBahtVBHliGLdy1nP8n/9WaHUv3YpYtQR9jjQLvhfWQadE0Uc Hf2CXVXXIAyKGbZ3/xc/pWaqTKVugWv4DdCJ4h66rTjqJcAXF3fQswZ0iLahg9lH X-Gm-Gg: ASbGncuzXH8rDE/kvLINDYXCSiNpQ2Ps7uSJOg7dkKykdBl////9zR50KfOUkNdlYlX PfQWOPLhEqsj4Bs7+miQlIldFok42Tdf8faT9woBm2S053OycFPbcfBGSt/3CngXl/GySomJiDb Qv/I+BGU3prXQEV92DUPG/K0SsIEz8SveL7YMuquTuwJl3F/qOQhmymfL920VFwE/BsJn7NMPQY N2HC/8nXKisoPpog2w2GoOosdSn5F1fv3OVRd0tkqe0wVmiKe3eo87hLsfQuhOe1awFC3AanO9y lZx0JVkcV5xJtN07R/ATYSoy397Hv5ant/OkkohjENlCPs1ud99zHLQSM+dx5IrFKaxSPpciDme ceoe/11YCDX8FZ8CmTXNM X-Google-Smtp-Source: AGHT+IEvDyA/JT+/hlW+VvdSyECbbWVuHeCzrYRfoaGkUeJoT5u+OTWtDs35VMblyVFw8LT6+2BfeQ== X-Received: by 2002:a05:6402:13c9:b0:618:1e1:c204 with SMTP id 4fb4d7f45d1cf-6184ec57bb1mr1742879a12.12.1754988489959; Tue, 12 Aug 2025 01:48:09 -0700 (PDT) Received: from caladan ([31.177.112.212]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-615a8eff60esm20127653a12.13.2025.08.12.01.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 01:48:09 -0700 (PDT) From: Helmut Eller To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> Date: Tue, 12 Aug 2025 10:48:08 +0200 Message-ID: <87sehxq62f.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: [...] >> For a time we had weak-ref Lisp objects. I suppose putting such >> weak-refs in the undo list would still break some code. Instead of >> weak-refs one could also use another layer of indirection, e.g. put a >> fixnum in the undo list and the fixnum is a key in a weak hashtable that >> holds markers weakly. > > Yes. Or one could give markers a unique integer id, store that instead > of the marker itself in the marker adjustment entries. Then, > primitive-undo could iterate over the buffer's markers and only do > something for those markers it has an id entry for. > > If that would work, we wouldn't need to employ weakness, which I think > might be a win. It's of course fiddly again. How to find all places > relying on the fact that markers are in the entries, with some > certainty? Maybe we could create a new kind of entry, e.g (adjust-marker MARKER-ID ADJUSTMENT) instead of (MARKER . ADJUSTMENT). Or create (apply FUN . ARGS). > What breakage are you thinking of? Code in the wild that is inspecting the undo list. >> Even better would be if we could put positions instead of markers in the >> undo list. After undoing, positions should be correct again; in an >> ideal world anyway. > > After Stef reminded me: All markers in the deleted range get the same > position (ignoring details) after the deletion, so I think a position > alone wouldn't suffice.=20 Ah, I see. Helmut From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 05:23:03 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 09:23:03 +0000 Received: from localhost ([127.0.0.1]:51970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ullDi-000060-OY for submit@debbugs.gnu.org; Tue, 12 Aug 2025 05:23:03 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:50501) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ullDf-00005P-L8 for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 05:23:00 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-458b2d9dba5so33348085e9.1 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 02:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754990573; x=1755595373; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=djZuJoH3srsys+ynGuYqQ3QVX38eQ1eTmYEl34y6z1M=; b=lXP+Vm4PSyXMx5POnUd51C0JkOOdsxBuai1S8ppeknLlg85oKpUTxkDecE1+puZmap nh/Lww4rRJvgGuXhjWVhvOuMBbn89vMyyyEZOX8poOdvPKOZ12XaD8otOiuK7OyBMiQ6 cbTc+xXnclIwGQqBypDkYte2hVDW5uue7Y4sjW4IgwQm1vagcPeTUpKtfFBaENK/DPBm COYD+EFmdTwwYS/3pYZBVGdcvVceQnqZiBKku5SBUPT/EjspxXT2jxZC3IrPmNnzc2lQ 6qXbCxsd/Brv5jYPREb1ENUfQRxmLWHbAPXaqbCealmgZnKuCw7LDocEM+6vP0YverVL pslQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754990573; x=1755595373; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=djZuJoH3srsys+ynGuYqQ3QVX38eQ1eTmYEl34y6z1M=; b=kzg01sSeqOxPVJJPx5e3qGFTa4yVaX9GnddLJ0B3/7X41orsvm32PsPJURLkJy9ZTz vj/s6Nh7j+eCC9RsEbjUL1rjtyZaszYFXsT9ZG/6MiUDQG+Jrd+Kq2G0qhcH2U2+ivTT amWkWin22xkoAo+dLVD99fcGK7VNRhy/C0cSKSQpe672N0cuXumXqdeBLHvpWEbLJ5qb 1Y8pPvd7tkUk5gmsMtyr/AsVJziE4uz1cfnszO6Ig1dMnEIJCSkdTHaeECNICJEzm4TP eRVEzp/b2Fa3pPNyIawwoKDzTH3R+LC4krfZ+5iRkwQfRxQ1BdXuk49rYIl1eQNXEfJj Z/qQ== X-Forwarded-Encrypted: i=1; AJvYcCWkaXczKCJ7C2IH4KQTHeLkIqkaen9tysyVyliQXprtIwyJ3lr/zt4+VmhqElLay0CiI8UNbA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzbDr5OzDOGKDH+eC7GBvj0vwGGrJfOwta1MOos4rm7WUWbVbbu M/8qePO2WkPFfLefNKPzfbHtMWBvRUyo98cMDp+AaQmi0pjrg5bQwMJxHAyvISch X-Gm-Gg: ASbGncvRNPDJ3LN9sSb2dx5nSOzi+axJw9THqdbBdkkR2kJ8/2rt11wl4kgXG+L3N3O 6Oku07j5Uf+nHBqdStDw1cjrZ9ZbLppvRDjjijVZjwotsftb7vwpR2NDxvXEgylDUC8zyHtcoKN 4+p/iaLJ1f7eFc8digkNmxePNrl3emvwfS/oUCS/PwQZPDhY+cvP7Dvu0z1yzGXULadLBLJQ7cF GLN4rmPiq1Yjh/eN1Orl0B1QUdlC36XTwiAF3NocThgYeNXOHZHevFjbZuOt45kSuu4dP2SJ1sI v+oQ8yFJZ8E5pvU0atKMpuPTd+Mk820Ok1VsZ5zwUtNWzwK9imR19CYNH9+ESjdJvK3GPJopdne xy0o89y/B1gGeRoaQn4tk9bBcEB+6Sx1JuOuarh6FzzPs8nrQE+8iEDF8sVXwoalNKbm8N6HlNL jpa0TsqPMIbdzEK5kHDFrOAKbKY6q9cNw= X-Google-Smtp-Source: AGHT+IHXmvo1mz9uJPmSLJ6ABAXtHYp7G7yLXf6pMuu/f25EUS0PGTDNoN7EebDFIFk0GcSi8X+pdQ== X-Received: by 2002:a05:600c:1c1b:b0:43d:9d5:474d with SMTP id 5b1f17b1804b1-45a11f1b0e9mr13987055e9.0.1754990572297; Tue, 12 Aug 2025 02:22:52 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459db13fc9fsm362708745e9.7.2025.08.12.02.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 02:22:51 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> Date: Tue, 12 Aug 2025 11:22:50 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Helmut Eller writes: > On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > > [...] >>> For a time we had weak-ref Lisp objects. I suppose putting such >>> weak-refs in the undo list would still break some code. Instead of >>> weak-refs one could also use another layer of indirection, e.g. put a >>> fixnum in the undo list and the fixnum is a key in a weak hashtable that >>> holds markers weakly. >> >> Yes. Or one could give markers a unique integer id, store that instead >> of the marker itself in the marker adjustment entries. Then, >> primitive-undo could iterate over the buffer's markers and only do >> something for those markers it has an id entry for. >> >> If that would work, we wouldn't need to employ weakness, which I think >> might be a win. It's of course fiddly again. How to find all places >> relying on the fact that markers are in the entries, with some >> certainty? > > Maybe we could create a new kind of entry, e.g > > (adjust-marker MARKER-ID ADJUSTMENT) That looks good. We could extend Elisp manual, which currently says =E2=80=98(MARKER . ADJUSTMENT)=E2=80=99 This kind of element records the fact that the marker MARKER was relocated due to deletion of surrounding text, and that it moved ADJUSTMENT character positions. If the marker's location is consistent with the (TEXT . POSITION) element preceding it in the undo list, then undoing this element moves MARKER =E2=88=92 ADJUSTMENT characters. And the new entry would use 3 or 2 conses, but who cares. Managing an id could be tricky though. I don't know how to handle pdumped markers in this regard. Maybe one could arrange that pdumped markers get ids from 0...N, or negative ones perhaps, and newly created markers would then start with N+1 or 0. WDYT? > instead of (MARKER . ADJUSTMENT). Or create (apply FUN . ARGS). > >> What breakage are you thinking of? > > Code in the wild that is inspecting the undo list. Hadn't thought about that. But I guess a new entry format would handle that. New Emacs version, new record -> extend your hack. Let's see what the others think about such a plan.=20 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 07:02:35 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 11:02:35 +0000 Received: from localhost ([127.0.0.1]:52280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulmm2-0004y1-EQ for submit@debbugs.gnu.org; Tue, 12 Aug 2025 07:02:34 -0400 Received: from mail.eclipso.de ([217.69.254.104]:33198) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulmly-0004xa-Gs for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 07:02:31 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1754996544; bh=se36lH0WwwZtnot9yg+6M1zpc5pjSKWizDUM0QmODVo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kcH9bOSbPi7c0RIBC01c0axRPHZzqeHmqpf/I4zLxPG3pnuCs2IDQNPWsfE/7Pjvn sr+9Rj6ozd2Vd4StB2aGvPA7nPscknafjAejKxNAjfWkFZmQ8ofJd7FWlSidVtiupt xDAtrpPrVvgdIF13REhNuMMljjKAU14ZOE/+sG0cfXXcwjuw6v4BtoSPGQ/Wd1OH/9 R+fYGUyvRUirpQ8KyibX2UslkXdO3mCBEJxsYzg3BV90XLafI+jfyJPa6wvGRNnAgE taLHx3AygPTk3Bznhq3X2gSjJQ2csQKJV6g27B+YNQQQ/Kac1X3elb+Fdz8KNNtwRV WvtqLlUHqOoLQ== To: Stefan Monnier Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> Date: Tue, 12 Aug 2025 13:02:22 +0200 Message-ID: <87qzxgref5.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , Gerd =?utf-8?Q?M=C3=B6llmann?= , 79200@debbugs.gnu.org, Alan Mackenzie , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Monnier writes: >> I still don't understand why these marker entries in the undo list are >> made. Maybe someone else knows? > > The automatic update of markers is insufficiently precise when the we > undo a text deletion, because all the markers that were anywhere within > the deleted text end up with the same position after the deletion. > So we have to record the offset for those markers that were in the > middle of the deleted text such that when we re-insert the text we can > put those markers back to where they were. Yeah, I was suspecting that and expecting some breakage due to my barbaric workaround. However, the fact that still no breakage was observed makes me think that those markers are created for a very brief use (within the execution span of a single command, for instance.) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 10:08:38 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 14:08:38 +0000 Received: from localhost ([127.0.0.1]:54113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulpg5-0003FH-MI for submit@debbugs.gnu.org; Tue, 12 Aug 2025 10:08:38 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53537) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulpg1-0003Ew-9g for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 10:08:34 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-45a12b3f4b3so5090145e9.3 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 07:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755007706; x=1755612506; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=axIdid5NYBMxw59MwfSTKbrYo2oN1LKGbLw1g4isi40=; b=dqa6VhvzvA2uPSxH9SxuTMSRCc0EATdz99koaGBhplMqcPmg5e5j0OWSM/HMGIGhFW 1TI70ItKwvTaAPT6sXKTmD01Zy8Fl/jAglSRB/Oen4ZeOF5eOMVLwuZTyEjlEGfVneEr irz4gwh/8NvleDjh0QtOTFKpGis2r+IjpOpFK+s6epb4+p0SkWfEn6LcleWDXI/TMTG6 7Ysgz1A0AJunu+tn0QZT68CzycZ/+eTKUHC5o+4ViXSk5zUEgDQdxyyszG7FrqIfYqEr oj0mkEuP0tWrE3CXlXifKob4ehLnR3aSnmn4I2AStahEUw114SWbULyGxRb+obUIZG/F 57mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755007706; x=1755612506; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=axIdid5NYBMxw59MwfSTKbrYo2oN1LKGbLw1g4isi40=; b=frIiUvX7NN41J2vZrGVAzTJeDkzmfPyd2m1CbnGQaWsuTj7Gz1pa9vvN8O/5+B/AwH UxvjVe7DpHbDgLrf7rXFm/cjWkUSCFgfsdz8+eD0g/FoANfNovQkfCZ1rY4bMFvk8qWH ELXp+RhOUh9tiWMkgkLi1GBM3YalJyv37s1O9jVI/zw+b8bxEgAuXipIZQTIgu/hxTB2 iZZMGe7nupMRUDeyNmbRRi/0nydBZKsqWY6WRI62n2MtqBb5xvs3hcPbGcsG6i8J1x07 KPAGTtfLyeiFgU+omn+2Ghdxh1otbGsnCJCLeIFaUloxpW+Yt0gehMuXSmeJ6vSWGo0r rgKQ== X-Forwarded-Encrypted: i=1; AJvYcCUWckYz/SeKFOvZxKCad1MUl3pavaHWs//nsck3EdRtD5wCMOxDb63idUotFJxU+I3btEkRtw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy2ILIxaeuGSwDeNyvbbSNAPo9zvD0Q8h8k/sMQODxTsR5HcChu 96Zpe5LN5wW3o6tvqI+PSfjsf16O39GIh8iaqMlJu2BUlEC7g3ul6tTOdCengk0J X-Gm-Gg: ASbGncugQ+e+fnZ4DrrxAxxTA8hvX6lhtPlDXI/RaIgSYf5NLR3CUWbRKYIkMNP7hHU fQZG74/t01OeLzz/uNML23i3yU+QhSisIBopAWmjE4G5a49N+EqvjTWJJ2kOKS1nKNU9pUBl6fF vJhkrg4aEtxzvmN2Bqf/q+JHX24u5xIsLL4Fxlw8vTKCY7VoQvTTevxHhT2/dailVKMLKlHcL2i VgHpIN59ZrqAPFC12fXoJqco6t29BCGx7c90YrRqjtBJgHHYef1LyEJfIya/cKO/hIWNcPS7EXc SGe4QbyC6YOlAgybLWWQB9wdwnZRZE5lzmZKULxo9EFD5M9oByGtRU1Zuretd4sByEYpr8f/CKC CGLtUYAFjkYY/OHKN+jx0nVRjslvMFQ7miiZtGueSU9uzHUQMrIZtM/dl5VNWYLScDRVu06lvsT maC55bQsdHwzejzMLjQBv0ZjLrPw== X-Google-Smtp-Source: AGHT+IFxnXFKFVlajvmRwFSrluZSidoEUUvTsrxCUkZ0lFWL+6PS7TqSmkVZiS/iHzLjpueALjENJg== X-Received: by 2002:a05:600c:1d0c:b0:453:2066:4a26 with SMTP id 5b1f17b1804b1-45a10be7d2bmr32924435e9.16.1755007705931; Tue, 12 Aug 2025 07:08:25 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3abed3sm44253898f8f.10.2025.08.12.07.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 07:08:25 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> Date: Tue, 12 Aug 2025 16:08:24 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Let's see what the others think about such a plan.=20 Please find attached a patch which gives an impression what that could look like. Entirely untested of course, plus for my Emacs, which has a different marker implementation, plus I'm not certain which other Lisp or C could be affected by such a change. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-adjust-marker-entries-in-undo-lists.patch >From f67933803031460bee7db7be4dcd8e0b60c0bce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 15:58:54 +0200 Subject: [PATCH] Use adjust-marker entries in undo-lists * src/alloc.c (next_marker_id): Return the next marker id to use. (Fmake_marker, build_marker): Assign ids to markers. * src/lisp.h (Lisp_Marker): Add id member. * src/marker-vector.c (marker_vector_adjust_for_replace): New function. * src/marker-vector.h: Declare it. * src/marker.c (Fmarker_id): New DEFUN. (Fmarker_with_id): New DEFUN. (syms_of_marker): defsubr new DEFUNs * src/pdumper.c (dump_marker): Dump marker id as negative number. * src/undo.c (record_marker_adjustments): Produce adust-marker entries. (syms_of_undo): New DEFSYM. * lisp/simple.el (primitive-undo): Use adjust-marker entries. --- lisp/simple.el | 17 ++++++++++------- src/alloc.c | 9 +++++++++ src/lisp.h | 2 ++ src/marker-vector.c | 11 +++++++++++ src/marker-vector.h | 3 +++ src/marker.c | 22 ++++++++++++++++++++++ src/pdumper.c | 2 ++ src/undo.c | 5 +++-- 8 files changed, 62 insertions(+), 9 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 9d6feeecfe6..49034518d08 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3740,13 +3740,16 @@ primitive-undo ;; the markers haven't moved. We check their validity ;; before reinserting the string so as we don't need to ;; mind marker insertion-type. - (while (and (markerp (car-safe (car list))) - (integerp (cdr-safe (car list)))) - (let* ((marker-adj (pop list)) - (m (car marker-adj))) - (and (eq (marker-buffer m) (current-buffer)) - (= apos m) - (push marker-adj valid-marker-adjustments)))) + (while (eq 'adjust-marker (car-safe (car list))) + (let* ((entry (cdr-safe (car list))) + (id (car entry)) + (offset (cdr entry)) + (marker (marker-with-id id))) + (pop list) + (when (and marker + (eq (marker-buffer marker) (current-buffer)) + (= apos marker)) + (push (cons marker offset) valid-marker-adjustments)))) ;; Insert string and adjust point (if (< pos 0) (progn diff --git a/src/alloc.c b/src/alloc.c index 07272c6c373..3ab0b5357c1 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3944,12 +3944,20 @@ build_overlay (bool front_advance, bool rear_advance, return overlay; } +static ptrdiff_t +next_marker_id (void) +{ + static ptrdiff_t next = 0; + return next++; +} + DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, doc: /* Return a newly allocated marker which does not point at any place. */) (void) { struct Lisp_Marker *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker, PVEC_MARKER); + p->id = next_marker_id (); p->buffer = 0; p->entry = 0; p->insertion_type = 0; @@ -3968,6 +3976,7 @@ build_marker (struct buffer *buf, ptrdiff_t charpos) struct Lisp_Marker *m = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker, PVEC_MARKER); + m->id = next_marker_id (); m->buffer = buf; m->insertion_type = 0; m->need_adjustment = 0; diff --git a/src/lisp.h b/src/lisp.h index a0ce6e4dc13..9120001e654 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3074,6 +3074,8 @@ knuth_hash (hash_hash_t hash, unsigned bits) { struct vectorlike_header header; + ptrdiff_t id; + /* This is the buffer that the marker points into, or 0 if it points nowhere. Note: a chain of markers can contain markers pointing into different buffers (the chain is per buffer_text rather than per buffer, so it's diff --git a/src/marker-vector.c b/src/marker-vector.c index b8a87d72d86..0e1d80a3b86 100644 --- a/src/marker-vector.c +++ b/src/marker-vector.c @@ -375,3 +375,14 @@ marker_vector_adjust_for_replace (struct buffer *b, CHARPOS (v, m->entry) = make_fixnum (from_charpos); } } + +struct Lisp_Marker * +marker_vector_marker_with_id (struct buffer *b, ptrdiff_t id) +{ + FOR_EACH_MARKER (b, m) + { + if (id == m->id) + return m; + } + return NULL; +} diff --git a/src/marker-vector.h b/src/marker-vector.h index 6a0ee8a9507..3410c18947f 100644 --- a/src/marker-vector.h +++ b/src/marker-vector.h @@ -102,5 +102,8 @@ #define FOR_EACH_MARKER(b, m) \ void marker_vector_adjust_for_replace (struct buffer *b, ptrdiff_t from, ptrdiff_t old_chars, ptrdiff_t new_chars); ptrdiff_t marker_vector_last_charpos (const struct Lisp_Marker *m); +struct Lisp_Marker * +marker_vector_marker_with_id (struct buffer *b, ptrdiff_t id); + #endif /* EMACS_MARKER_VECTOR_H */ diff --git a/src/marker.c b/src/marker.c index e36c05d0f2e..2e8fd1164fa 100644 --- a/src/marker.c +++ b/src/marker.c @@ -101,6 +101,26 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) /* Operations on markers. */ +DEFUN ("marker-id", Fmarker_id, Smarker_id, 1, 1, 0, + doc: /* Return the id of MARKER. */) + (Lisp_Object marker) +{ + CHECK_MARKER (marker); + return make_fixnum (XMARKER (marker)->id); +} + +DEFUN ("marker-with-id", Fmarker_with_id, Smarker_with_id, 1, 1, 0, + doc: /* Return the marker in the current buffer with id ID. +Value is nil if no such marker exists. */) + (Lisp_Object id) +{ + CHECK_FIXNUM (id); + struct Lisp_Marker *m = marker_vector_marker_with_id (current_buffer, XFIXNUM (id)); + if (m == NULL) + return Qnil; + return make_lisp_ptr (m, Lisp_Vectorlike); +} + DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0, doc: /* Return the buffer that MARKER points into, or nil if none. Returns nil if MARKER points into a dead buffer. */) @@ -463,6 +483,8 @@ syms_of_marker (void) { defsubr (&Smarker_position); defsubr (&Smarker_last_position); + defsubr (&Smarker_id); + defsubr (&Smarker_with_id); defsubr (&Smarker_buffer); defsubr (&Sset_marker); defsubr (&Scopy_marker); diff --git a/src/pdumper.c b/src/pdumper.c index 92bc3089267..b9583a69b3d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2228,6 +2228,8 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) dump_pseudovector_lisp_fields (ctx, &out->header, &marker->header); DUMP_FIELD_COPY (out, marker, need_adjustment); DUMP_FIELD_COPY (out, marker, insertion_type); + DUMP_FIELD_COPY (out, marker, id); + out->id *= -1; if (marker->buffer) { dump_field_lv_rawptr (ctx, out, marker, &marker->buffer, diff --git a/src/undo.c b/src/undo.c index aa05a9aee14..9f07ac5d4b6 100644 --- a/src/undo.c +++ b/src/undo.c @@ -146,10 +146,10 @@ record_marker_adjustments (ptrdiff_t from, ptrdiff_t to) if (adjustment) { - Lisp_Object marker = make_lisp_ptr (m, Lisp_Vectorlike); + Lisp_Object id = make_fixnum (m->id); bset_undo_list (current_buffer, - Fcons (Fcons (marker, make_fixnum (adjustment)), + Fcons (Fcons (Qadjust_marker, Fcons (id, make_fixnum (adjustment))), BVAR (current_buffer, undo_list))); } } @@ -432,6 +432,7 @@ syms_of_undo (void) /* Marker for function call undo list elements. */ DEFSYM (Qapply, "apply"); + DEFSYM (Qadjust_marker, "adjust_marker"); pending_boundary = Qnil; staticpro (&pending_boundary); -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 10:40:44 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 14:40:44 +0000 Received: from localhost ([127.0.0.1]:54180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulqBA-0004tR-3I for submit@debbugs.gnu.org; Tue, 12 Aug 2025 10:40:44 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:58548) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulqAx-0004sJ-IA for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 10:40:39 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-459ddf83023so34198215e9.0 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 07:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755009624; x=1755614424; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=6wPghg5Hf753qsPrvlF8p5Pi+NGwtbDkfk3/pRJN+Fw=; b=Rs9/qTzeesfJ1RNQjECTf4ZVef+jdbNgeKA1Ja2aLUeFIhRXw44jwucGZx/DGSdiUv I29+3VavlKH4K5OFr/kWcR0Qh8BtVuHUeed1LenwkkGgfBVvmYejkZpEGjncm0VEHmN1 dlO2iMnUFQy0ntY+L+JJs35EkqdWcxRoSEu7UWjbjw+G5VMg9ITvlSxzHW3XYbWxKhnz 3gbLvhhKjnNroSf0aJl5f1XEDMcmz1kaS3wjzlTRdQ5tCJmeNlm/MXV04FMHBRZO+V2F +WxEqHTQ0s7rR42osxX8oWbfopCIpiZFunnQT5S8OWMq+Ut8BUllclsQHNN7vjJlqylt tY5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755009624; x=1755614424; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6wPghg5Hf753qsPrvlF8p5Pi+NGwtbDkfk3/pRJN+Fw=; b=e0t+icY9klp/ECDetL2au5IFurMVhxyClr2iiRDf4lgM/aPNMwpyTZtOLfZ/xxpe+f KcU+2hy/VtUYez3nK5niH9lqkLvmHouucOxaiCLm7KETtSOOFO4CC56hTjLVFUncGz9X Tl5VCGX1EXkwzLvNqZLuysTct9m5UlnDfikLVwcun6oblDHa7mKD2/jTNn16lAkfcITV Vam4Nz2p7SlViC5PLJ/ZQ1YIcDCgSXrstWhxChHku9lv/byv8LKILdy/OIdzv0ezY04R xHhkSREkymv5j+8VYqFQXv4hvK+cUdaxS/XYEHX1NnsOywMiDuNosVSrr+i4UzpPE9e/ 6wVQ== X-Forwarded-Encrypted: i=1; AJvYcCVlN/QkhH84engn+BROsK7CETHiTODoGt8dH+6eHuFLgCg02SCpN/QqbHZjQ5Y45euYHSLLeg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzqpQFw1XGMvCYFsx8GqjeW+6/SGGqslZhI/uDbMYCRzbSCNdNz B+X/cg8Y4oRwrv6+N7+qYeDpWSD5qb1oKiPEfmbAFkDDBSrewf2FnxdLJuipHuti X-Gm-Gg: ASbGnculATqAnONboWSCpLQtsLGzbfzXNKe98qSSv8zLUqC1nxOGRfoAFzEQ6bx2Vfu RuKusothnOMVkTCPIHTKYfgV/hbqCYbyGCUfNYETf1HQRzBg8l1e685AUN1vyhw4MIfvbptCqUt PBfkqnLEEp6qmfdoDfhKQUfRPKplqO8r5OLSg6pXVl0oCK9dN7lzIoT7enapC4T42quCQUTrcUn pYZVyA7vdEG2Mfw3Lg4FJKaVd5LLLiZj2ajzsR1Xol1/zRkMoBbqPha9xDffneix1bgkehGBY71 a/kftjEsrLYvML0kuoOToBcZBT9bveaUN9mSfTlblw5wL7yBw67GGghGuEDM73atd59oNa8VmDL z8JGOy/Ob9GruhX8vDmefowlPZo+f+MBrGLyt71HdDMmh3TEsj5G2n0+JQmCE5MomN4DOGKl4nW uglDaEp5q2ML8Z9mQmdCAs9zukHA== X-Google-Smtp-Source: AGHT+IEdGqySjB8hB9H6LLlB2VVYO3/lbIwWdSsbjFybZWgyeSDYEp/BySFPctD7zLvCcur5+BjdWQ== X-Received: by 2002:a05:600c:1c14:b0:456:f00:4b5d with SMTP id 5b1f17b1804b1-45a15b405bemr511715e9.22.1755009624193; Tue, 12 Aug 2025 07:40:24 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5d0b1afsm294180485e9.26.2025.08.12.07.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 07:40:23 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> Date: Tue, 12 Aug 2025 16:40:22 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Let's see what the others think about such a plan.=20 > > Please find attached a patch which gives an impression what that could > look like. Entirely untested of course, plus for my Emacs, which has a > different marker implementation, plus I'm not certain which other Lisp > or C could be affected by such a change. Had the DEFSYM wrong. With that a simple undo works in emacs -q. YMMV. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-DEFSYM.patch >From 988d930c8cfe1fe5404bc28d542eab36df4edabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 16:37:33 +0200 Subject: [PATCH] ; Fix DEFSYM * src/undo.c (syms_of_undo): adjust_marker -> adjust-marker. --- src/undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/undo.c b/src/undo.c index 9f07ac5d4b6..8702d937ed5 100644 --- a/src/undo.c +++ b/src/undo.c @@ -432,7 +432,7 @@ syms_of_undo (void) /* Marker for function call undo list elements. */ DEFSYM (Qapply, "apply"); - DEFSYM (Qadjust_marker, "adjust_marker"); + DEFSYM (Qadjust_marker, "adjust-marker"); pending_boundary = Qnil; staticpro (&pending_boundary); -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 11:15:06 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 15:15:06 +0000 Received: from localhost ([127.0.0.1]:54311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulqiP-0006cs-Fs for submit@debbugs.gnu.org; Tue, 12 Aug 2025 11:15:05 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:60458) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulqiH-0006br-Lb for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 11:14:59 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-61553a028dfso7380782a12.0 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 08:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755011691; x=1755616491; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lEdN2r6Ah9KR0MHw15MeZ5UQc3UkKjM8dNl+6esdxm8=; b=VQsHImT0yS908bgXIDuYg34AvAR2lnggI57jTMJT6t+uSygMxDKRfCrIFV26tT+4c4 b4pDajVzakg2IVKPJpkgK1CDnx+nGNNt6b+Ssb/ZIvRUfJ60nVs7G0N65z8X1LLq9Rtw noy8dUvBXO0Ns1Ffpn+CG+wJopEkRqeJLJW/ufkRmMxFOfNQnEMeWv6BKTnP74Cn3RCD ddPX6uebAd9bx8AV6yhVTIvE1sZnWt1/wE+bKjRk3LWSF2T+6/2uu+g9PdXqdQa7UjU7 Iy8M0ZOV4Zvg83UUYHcDfIiWkmZnbbdTlfPsguB0Ix+SgJHya8kp4JEDiwPf65pnV/RL lhpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755011691; x=1755616491; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lEdN2r6Ah9KR0MHw15MeZ5UQc3UkKjM8dNl+6esdxm8=; b=KS+Z5T2SCiW61fROWvKjzxf6ouUKtWgnfZjwzNqdrERpJth8YRlxBWu4FQuTgg1G8R WnwE+XdCYZuI1xnus16yzqVwUBLZ9ImJC2KmZNxL5bNh/yLF6mwe6Q7aJ9QjcuUPnJWA plAGjH3J37ugUeKZYjxHm79WX6EauQEUx0JV+at6xhm1VTfXs7dmKLKkBPxtjqibaJ+z r4Om5LNw9aSkTl+nCa2KetsFtACGdQrxhFzN0oK804CxTsiS8IxWC2eTuuTH0awjMRfT G/mbscC4Qo2bSvQKQmRYmQEgKcN3sgnkR6cgg7zlXRTdqlJZIQqQtO/h8qFL78B8fpZm j3KA== X-Forwarded-Encrypted: i=1; AJvYcCXZIdTDVQcR88RRbzc4mtc2PC8EnRewFas69nmK3V2aT9AA9LeU2VNyTOnwuliRkU/rhcYd3A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz056dKpItQodlnRUy6iJtc13AJsoU0PCI8Igm4QT6uetwmY6Aq x7XXJGWe/8ndZSRPaFaizkXiAt82B4r5ngaxM0PXU6mdxeoMiJh3q2NW2DOGGg== X-Gm-Gg: ASbGncuLKEwKyhsfmG8PQh98URLjxrAiy0h23f9fhXu30DzQHtL0IeGW/yBRfyJIalO 79/IooWVMMBy6Co5hyrux82t2X4HAHyxM+EG823/0VXTq6ruAfZonRiRgzrCnDmp3BVjLxQCAo0 b/MSyl6sjCHbrsxUDGoVHLvBzl/ZFHoyb+7KqulkaopLDxyu1ADtr6yqlI5vypagzuRL7TodRSN qk27//66GPbQi+IEvA6BWiCfzm6qIXVRgjiSuTad3H/57wQX5SR7f5UHZgMs8QSY5i1abCnDkAY ZXlBQmm8Jh3SrRDgxJidPhNKnhXpOOXQmpPoRrRxGxy/w3dVACGIIzXarq5jk8sNUJz0bM29urA +kW+g8x8PSGVq/zmqc4Mx X-Google-Smtp-Source: AGHT+IEWMS6CHxGzaDNc0Z46PfKq8FUK+6BW5dPvPLKjrWe4P4vqOpN7cV83zvYAyXv4FBMucCVprQ== X-Received: by 2002:a50:c308:0:b0:615:920d:4de5 with SMTP id 4fb4d7f45d1cf-61867001245mr109898a12.12.1755011690716; Tue, 12 Aug 2025 08:14:50 -0700 (PDT) Received: from caladan ([31.177.112.212]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-615a8eff60esm20617038a12.13.2025.08.12.08.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 08:14:50 -0700 (PDT) From: Helmut Eller To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> Date: Tue, 12 Aug 2025 17:14:49 +0200 Message-ID: <87v7mswp06.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > +static ptrdiff_t > +next_marker_id (void) > +{ > + static ptrdiff_t next =3D 0; > + return next++; > +} [...] > DUMP_FIELD_COPY (out, marker, insertion_type); > + DUMP_FIELD_COPY (out, marker, id); > + out->id *=3D -1; I wonder if we shouldn't simply dump and restore the next id counter (with pdumper_remember_scalar). Helmut From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 11:24:25 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 15:24:25 +0000 Received: from localhost ([127.0.0.1]:54377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulqrR-000771-6I for submit@debbugs.gnu.org; Tue, 12 Aug 2025 11:24:25 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:51414) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulqrN-00076j-4W for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 11:24:22 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45a0dc77a15so12207865e9.2 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 08:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755012254; x=1755617054; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OYrXNXqf9mAEyEYPWRh9eg78ZC25VCFMUndG/hXfJX0=; b=hi+D43RM5YAtYdOJAASiq+nT0cd0HYVyWpcPKbbT2eZvBntBpMCt1y8//9pIWhV5QQ 0LfNQhA9K5FaW3XDqB4QzNy3CMbSDCYAFl3yCoV57ESNOaEmlIn+JiKmzhCPrZfTT0S7 Ul/a3brbjdsFTfZK64IyFsr9UP43W4RpVrG3M/mhVzynmr/0Jjc4HG8QXydJjeAnRfdC VLFLcWvy83K6wIeCEchdo7pIKBlC7fJdybCFfCFa5hpun6fa1yCC2744chPVi/9TeK/A NYaPxRacMDL5VVc1nqoB2hLXajxqpCMm5hFFsLPZs2wqzZOcOjMbZVpTRDv4gMf/+JIJ zKKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755012254; x=1755617054; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OYrXNXqf9mAEyEYPWRh9eg78ZC25VCFMUndG/hXfJX0=; b=tYrWPXhi3QeQx84vab3S8jCjXEJXOy5PbJfSkUUgoEAN5lDGlLnb+lPXKcval9WCvc YFcweVx+CLFM84RsSVwCq4Gdt+XAqHlOJR1r8WVMkXvKfLSFB1U5eqaygZzh7e5yRmD8 7WOUUvu2a+R+GRDFjXaKRUzboyPAPcTuBCVQs1fh9QEEiz9loh3N7+g9eEG062RVAZB8 PIN+1YR2f2DDS2ZSUNzXvv3p3Ch9JEYzU/23LE5JnoFFPzqOBWpHBUdgVSIaIySeauTQ XyUXB3DukuVpLU+B4vkjEis1AutTJ1jpSSsfK5rKW9qmBCSy1wt7FBRfrLjFou1wASvy ZTbA== X-Forwarded-Encrypted: i=1; AJvYcCUVJnNTWZNRhWzsrWsQEEdnn+KvLxiuT9psQH8Yj0ZBUQ7uRFfZPCU9moytQHp9jBkiysUadA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxqZpXpeTUDNb1zfCIqoep8bRlIcW017iXnQS9O/QywLDn7nyje 3s2VZIsxpgCLkycIwG2FIVWiXrtR5GzyUtb1vU46o7rNnu5LhcV7JSGimc50bGyq X-Gm-Gg: ASbGncu4Hl9Af2ucIvXNFxsa2dtN6da5uArzSCnI5roNQtNTMGZLADYaPrWGuGikB1t ld9plkWEUifiJ2qFvSIuGUPozIl7X50ykAFQ8DWM9eGtlzzPkvwGSyQnk6JoaePKC7Js7VXTb+x tlmBOEHOHg4SvqA9/wIK54SI/zaMTHCuDvgNY1zJe6bMUqBER6QYIoilvSKCz0HbdgnYobUPBOk mv3oCnuLZ+mdCC4+oqJ2tCmPRq3yOyHd7w33rOg69etlNTUrfhnlfNgTnNu0CXHi6xOgY9YY0Jz CcENYUin8BuT/CGAfmESNKdRiw/8XW2NmRwTXdP40M0geDI3ejQ+sFJ2nJalg1cMh67L1Fkhow/ nVoRFFLCFuTBmfA0vJXGILB+g4KfNAYO5oIdeaVs4UZ9kem6vtc5ja0oYJjA= X-Google-Smtp-Source: AGHT+IEynG9fWG3fAzIKybvvAW5UKTGmLbuW178sSElQ8PfQcnilq1lticlelpjHpvX3teRNVzTXjA== X-Received: by 2002:a05:600c:4ecb:b0:43d:9d5:474d with SMTP id 5b1f17b1804b1-45a15ab3c9cmr2794465e9.0.1755012253325; Tue, 12 Aug 2025 08:24:13 -0700 (PDT) Received: from pro2 (p4fe3a013.dip0.t-ipconnect.de. [79.227.160.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e5868fd7sm323384185e9.18.2025.08.12.08.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 08:24:12 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> Date: Tue, 12 Aug 2025 17:24:11 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Helmut Eller writes: > On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > >> +static ptrdiff_t >> +next_marker_id (void) >> +{ >> + static ptrdiff_t next =3D 0; >> + return next++; >> +} > [...] >> DUMP_FIELD_COPY (out, marker, insertion_type); >> + DUMP_FIELD_COPY (out, marker, id); >> + out->id *=3D -1; > > I wonder if we shouldn't simply dump and restore the next id counter > (with pdumper_remember_scalar). Yeah, I think that's better. The above isn't correct anyway if we dump an Emacs that has a dump loaded. In that case the marker to be dumped could have a negative id already, and so on. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 11:47:52 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 15:47:52 +0000 Received: from localhost ([127.0.0.1]:54408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulrE7-0008Eb-8A for submit@debbugs.gnu.org; Tue, 12 Aug 2025 11:47:51 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:56498) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulrDw-0008EA-L7 for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 11:47:46 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-459ddada9b1so52302095e9.0 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 08:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755013653; x=1755618453; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=6D5tREPrpQMmKa/2R8ayW7qRmW5MvWf+ULpgd+Wfgqc=; b=OwUU5GPQAfW8+A5VCaEt3zi/4jEpNbgHsxrDyHkhXxoNo3Q93G6XvYiUtA/f2BGvsp S5Bvl6RPR6K2cO2oLkQa8eMfJ++TU2rtLyQbjIGZPMnYQJ5mds9ux0Wsel62uZgoA3J4 oS13Mtg+gM763qw2cXOjC4ZABBAmRJXGgXHFRFCwsKr6tcRKmHhah/dTiwT6myd+6u46 IpfN4XP0XzEfvR2+moo8MfibkUFtKld1Tr2uWa4KD2TaIO+M0Pk12rqTO92BQVMhrBDx pXDcbD4fj+EWv3LvzYeZeVctyZ6/4d9fvKzQAIEGXxLpav6nK1KCi1TB+6odz1B/Y395 k5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755013653; x=1755618453; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6D5tREPrpQMmKa/2R8ayW7qRmW5MvWf+ULpgd+Wfgqc=; b=QQ6PbthatGKmYAYDMYW8bmIIXOfTXkpH7W1yZOqGvlOnWnrtgg3LxZaZEq2Bd8Hvbb bYt5FuSekLbclia2xFbCaYhVxwOuWCCcUzSdAVMVVV4C4gBmtGGiFueCfGKZb5OqWOE5 SKQQHaSp3xAHZaeS8u9P79x8UgB6OI/8Q6zWaS2XD+nSi5TzexHFuJ9kCh7P94nXHpif B0XfMnffPQ8brAWm8rzDSC34DfTxRwbvMTEFLlaFNHCWVAd4Va+X/Y/IrZ/3gA6c+hj/ EABwxH14dY7nzYjTWmR5wpl6pE1pm/YEzBiaXoSeg4LYQXhgmiYuNFHt0Y52wXw5doO5 AmwA== X-Forwarded-Encrypted: i=1; AJvYcCXl6I+FDvQPN2wg6OCnVqR58fObTr3Gd0+670sgpyWnc4lPXvI3qEqHjFAC0GsG6le41ri31Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YziToA7+DREImionRiUY/JWmJJDu8/N1R4+QLegjonQj7lsCRfA JBVBaQnsxJo646urCZvft84+H6vPSJaxFB8oT4rHLweEJZlvtvFZ2LmhGdVHMd66 X-Gm-Gg: ASbGncsM+K9JyfhGl/5wV51wvgWUXpX/cbJbCOuYPf67QdT0iGUpMQ8Q52jgx/nr5lT gMu4jDVEQFiGjjVjjzCRa5RKxbZBYa6VKQ8Q/bS2AusdKQK4wlz2R+y8AcbXZfcKpGQJ5Ye9RNP ri7H2uKQA0M8HifXhCtjdQwRPGiQZk2Frpi/v2oTcvW+sdhw0mUobH0h7qgk0Gzq9xqyPwWrHoh /Bfuhw1HH/sYdy5dnEoEzBb5oPfXC94Kxn0KUDOgNQxN3TJf57PfAdIGazmPN0DKYKSa4p2LRmG ctD/l/1HpoAvDONhFnXk/jmJMWjOgxWWyesFp7ecuoynhrFOsS7LO8Y894owDPTwF6cjmOEFlP7 h1/igUDrBQH/5lzmTpIIITQWR0KOEAdObnDTLQ/jtrsgHH9KH6PnNjXIF2plkXp/hU2HvuJ5Fpr nA+L6Xwo1cJyccIb/Zry0ONOv35g== X-Google-Smtp-Source: AGHT+IHiN3E6RDklpXCsg+3d81GaYxKtHZYmY2s6i/sX4nYPkRqd4/fhX005eC08zp2pZ2KtCWrecg== X-Received: by 2002:a05:600c:a48:b0:456:1bca:7faf with SMTP id 5b1f17b1804b1-45a15b46aaamr2963065e9.16.1755013653114; Tue, 12 Aug 2025 08:47:33 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459db13fc9fsm375778605e9.7.2025.08.12.08.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 08:47:32 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> Date: Tue, 12 Aug 2025 17:47:31 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Helmut Eller writes: > >> On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: >> >>> +static ptrdiff_t >>> +next_marker_id (void) >>> +{ >>> + static ptrdiff_t next =3D 0; >>> + return next++; >>> +} >> [...] >>> DUMP_FIELD_COPY (out, marker, insertion_type); >>> + DUMP_FIELD_COPY (out, marker, id); >>> + out->id *=3D -1; >> >> I wonder if we shouldn't simply dump and restore the next id counter >> (with pdumper_remember_scalar). > > Yeah, I think that's better. > > The above isn't correct anyway if we dump an Emacs that has a dump > loaded. In that case the marker to be dumped could have a negative id > already, and so on. Like so, I think: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Don-t-use-negative-marker-ids.patch >From c2032d15361944cc172b33eec34939e650ad680e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 17:45:11 +0200 Subject: [PATCH] Don't use negative marker ids * src/alloc.c (syms_of_alloc): New DEFVAR_INT for next marker id. (next_marker_id): Use it. * src/pdumper.c (dump_marker): Store id as-is. --- src/alloc.c | 9 +++++++-- src/pdumper.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 3ab0b5357c1..63af4443b2e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3947,8 +3947,9 @@ build_overlay (bool front_advance, bool rear_advance, static ptrdiff_t next_marker_id (void) { - static ptrdiff_t next = 0; - return next++; + if (next__marker_id == PTRDIFF_MAX) + next__marker_id = 0; + return next__marker_id++; } DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, @@ -7865,6 +7866,10 @@ syms_of_alloc (void) #endif DEFSYM (Qalloc, "alloc"); DEFSYM (QCemergency, ":emergency"); + + DEFVAR_INT ("next--marker-id", next__marker_id, + doc: /* Next marker id (internal use only.. */); + next__marker_id = 0; } #ifdef HAVE_MPS diff --git a/src/pdumper.c b/src/pdumper.c index b9583a69b3d..a832ecfba4b 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2229,7 +2229,7 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) DUMP_FIELD_COPY (out, marker, need_adjustment); DUMP_FIELD_COPY (out, marker, insertion_type); DUMP_FIELD_COPY (out, marker, id); - out->id *= -1; + if (marker->buffer) { dump_field_lv_rawptr (ctx, out, marker, &marker->buffer, -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 11:58:22 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 15:58:22 +0000 Received: from localhost ([127.0.0.1]:54428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulrOI-0000HP-2x for submit@debbugs.gnu.org; Tue, 12 Aug 2025 11:58:22 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:59485) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulrO7-0000Gv-4j for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 11:58:17 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-6180b9e4e74so6638798a12.2 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 08:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755014284; x=1755619084; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1ivysQeAPpMtLH02mDvaNvM0zxakiwPw5HDYVP0xf6I=; b=Gpl0kfEM2k/z/FbFEEwZXgRHsLXfXSCuQKmUCv8vMv5btLp43AJ1OpmiRVflEHGi8L i7Y9SSWcG7Hagm7LQArXb8g6eHwZPhVsNVyk6y+k7DchqWsvrT8EeTD468mI4ONHil4O ZCx8TJ4+AXYrMJ0ciloSAVEr7WVv3C21xueSmErPriOHtqgdU0TRW5sSdjJb/xhoDKwY ur6T0PeBMWF+2NEq+yte7lW3TvXDNHhOg0gnepHh5LtvxWpD2ilKm1VGvvrGkfeS5NZV P5Vb3gPz/GbykELNi4NISwdp/yY8NVdzxGdZm7r7n4tiMsdTbkHoao5XPI/hmjurpgmF ngnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755014284; x=1755619084; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1ivysQeAPpMtLH02mDvaNvM0zxakiwPw5HDYVP0xf6I=; b=m5mnrcVUPxkIEJHFNPTJ/pIqWbVkVN2b7kVYVFK+84wGfx2sMwujGqcftTSZkSaItb FI+wDZIHPADEBhyl+h02UCXlthoch0HgnfqikYl9CZWNOc4WlYiYEUm1gc2qrodUNUhQ lpz3wx0LXtT+a8EX3RE6A9ILYsX3JDA4C1XD1V5Se28vWqt8Htyu+Ys7pCFiEZIHJ6zN Tq2Tnhld6BvgkXGKM810isXffJXauRWGSVmTct2erXfUtF7aTxOzkhkH6uwdOkZeakwD wRzJN1j7IgASdRzY3CgJpRKXFErh4+pm/5ValMCx6rgWOfBxcRwgF89Qw9vUf8JXW8ja mQkw== X-Forwarded-Encrypted: i=1; AJvYcCVjUxR5sD+/6bKmOC3CA+YfiK2P881AigzePpTbLL4nWzq2CM11cyU6fUqyb4ZPHythHrrMkQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwGvhompgWTUl1EfyY5jHhwS8FmOHg0szRz/vkRgqNGzxlnRnL+ YYx9Zb2H2vagw4RUbXzoxJCju+vpUJ5R0S9WUNUPtw7LsfseTs7vmcY0akpoOQ== X-Gm-Gg: ASbGnctSoCuYR80jQm/Cb9o9VtsZcycrDfsMW7RyRWSzbLvTF6VtVJBCaLbxxNW0aws i+bPcwrB6+n7QJecwfeJPEtiljtZQCzQ7vmhcMke++u9hHh+uPiyOJWIUdnH6R6/JQiC6bLY+qb vnPyOJ1EEW8NJ5N6ebhdokGRoc0jPW4qnJ/JCjkYLAwk3GfvCFiZ8hIWfcsQxuONho6vTtegjE9 3FRpBnc+AgsVcx+uBcviLTzanW8+0grzHbkPvtViEvJhwF7VNjVUih1/iDh4U3vLx/zX+hGJlHb nYDwWTsTnABrcmHagaDjglcPxzeg/uq3bcxUs2Eiu4/dhy0YkT8JqKdMcBrXhY2NJmR4a10boSe kH52sxcFxpa+w1sSYgrpT X-Google-Smtp-Source: AGHT+IEqunAKoLDWLNAtR7gcBMzgCcgQVRjpoA96xWP31rObSU3c0t9VgR8ihI3C5uLmMLogjqpgCA== X-Received: by 2002:a17:907:7203:b0:ae8:e6f9:7cf with SMTP id a640c23a62f3a-afca391c6b1mr25303466b.23.1755014283727; Tue, 12 Aug 2025 08:58:03 -0700 (PDT) Received: from caladan ([31.177.112.212]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-af91a0763e4sm2232702466b.1.2025.08.12.08.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 08:58:03 -0700 (PDT) From: Helmut Eller To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> Date: Tue, 12 Aug 2025 17:58:02 +0200 Message-ID: <87pld0wn05.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > Like so, I think: I think the DEFVAR_INT is not needed. Something like this: static ptrdiff_t next_marker_id; static ptrdiff_t next_marker_id (void) { return next_marker_id++; } and in syms_of_alloc PDUMPER_REMEMBER_SCALAR(next_marker_id); should also work. Helmut From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 12:27:24 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 16:27:24 +0000 Received: from localhost ([127.0.0.1]:54475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulrqJ-0001fL-Ct for submit@debbugs.gnu.org; Tue, 12 Aug 2025 12:27:24 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:61699) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ulrq9-0001eh-83 for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 12:27:14 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3b792b0b829so5542250f8f.3 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 09:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755016022; x=1755620822; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3+1zMNemA1pjjAErzmSOGvxrnJr905VGV0/wyq8kMgc=; b=TehjBd1EfQ7bKSGWWSaQzjuObVGYtS0V7I27LNh7odMYsOVqUeywszaO2/hFDBFD7m ODB68cJMh2EWj7kVyu3IK4/QrZNiufGwTjKxGGAVaee/FYcl2A4pMKC8zsuHGEHDrp7a S6cOPPKeNzxk4l0x6PITHV/hxJGLXL0jE07/zgRZRxDTC4Fk8uh2DxH26q9jfl9KqBGc znH9SKYdftbNiQGnR4/e8ALAMbShmYHR40TsBSl5epbmDHASRFG1Z7+uBH3P6tBLSXh+ lHYHK9hMUQfnjnI1k6GP65KH6Kn29qu9DSio5/MGJc1L4ww2tLqXm3Zbf+j7wSvw2Z9y I1oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755016022; x=1755620822; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3+1zMNemA1pjjAErzmSOGvxrnJr905VGV0/wyq8kMgc=; b=RLFEXHaQYcRmDjtHTp1eEd0TlXbJGTg2cke3E39x1Cm9ZuVO86snnS6qzGvSJ+F3n1 aehomfcI8zggkgPTUpFXZQIdR4UqvuxsTE705H+aNpxGfHmJst/RSXL1Up6nLjkq8j7n Vu4jJ1J5yGINOoLNbLPfYJ+OM+sbjSkzxFrzIApzwJyxMDBQDCOk2aIl1DaJI62WAllp 3Sdex5stltBOHe2bWbPi1vHLEkYuv6PthCLaSZuZT8J6Sh5v7ftvC7Ml08BJkybtW/pW XwIlvLnxeKBogyqI6vCMrzFlwp1Z57qgwFfE4SosNGKMSUwywjeYDuM3/gCrEH+65vtx 6Qww== X-Forwarded-Encrypted: i=1; AJvYcCXQR96+Uvjcq5bWh4mtHzCYVROVpAG+YCSTXELclH7sG09GGq4/uEon/iqu47kQbImjI6wJaw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw8sRklS4eIkWP/NgFnJi6sZwziproI/2meDVJlinOp1lMY+5R2 IGRNlGBLmXV3oSCAPDLAQjv3ZxqcrfjTFx2FARRO6oPV467Gc8nWAzdQ5UKc+tO9 X-Gm-Gg: ASbGncvws94l86Pc8KvfK/ZWDu1TnwWvEtitgc4Vbp1wO5Wc4AbG8jVdkfy0slj7vFm nE1c2CIwike+6XXErj6ojIPbILQe05Sji13joypInDsLtRrSfG4FhTNzoaRn4WKRwcjImADM0RF H8OrEmpGoFvpURzqulKtXt4IG6Ao7PukHyjzcO92m+3eB2oJQBl/6fK+tcQdDTQXRTD2si2IQ2m 1G/JuXbVWNGh+acjcw1V7nkK5t8n3N1XO+o07tMeU0B9iD4A989a9sGYMbSo01sdpNxGU8wPp22 E2dqCAaGdGCJ7xxShAqJDdeZQOHQlCV45+ghzP4uZPb4FeY1adMbgPGespIwFE8j9m+QLxoSaiR UdVhNoEW2KI8o5IMYx/0n+BAdwyGGeh3ukRwjqzRSOZzDDJY1NHml93TCF1Aiu6ZZ5Hd6KeYBRA JZ94chuwrLZyJR1Oeh/43WoLUnvQ== X-Google-Smtp-Source: AGHT+IH8iROONCdIIuTRvfV/vArb+UHeGnGZ556dJxY2l2nhwUEddIIkZbxQ7K9JyvreyVnFJ8e63Q== X-Received: by 2002:a05:6000:420e:b0:3b8:d69b:93b with SMTP id ffacd0b85a97d-3b91732d0ebmr21178f8f.52.1755016021357; Tue, 12 Aug 2025 09:27:01 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3bf970sm44555248f8f.25.2025.08.12.09.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 09:27:00 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mw4aco.fsf@protonmail.com> <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Tue, 12 Aug 2025 18:26:59 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Helmut Eller writes: > On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: > >> Like so, I think: > > I think the DEFVAR_INT is not needed. Something like this: > > static ptrdiff_t next_marker_id; > > static ptrdiff_t > next_marker_id (void) > { > return next_marker_id++; > } > > and in syms_of_alloc > > PDUMPER_REMEMBER_SCALAR(next_marker_id); > > should also work. That's true. I've made it a DEFVAR mainly because I wanted to be able to see it easily :-). Don't know if the wrap-around check in next_marker_id is really necessary; that's just paranoia, I guess, or maybe laziness, not wanting to calculate :-). From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 13:50:50 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 17:50:51 +0000 Received: from localhost ([127.0.0.1]:54679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ult97-000064-O8 for submit@debbugs.gnu.org; Tue, 12 Aug 2025 13:50:50 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:48231) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ult8y-00005b-D5 for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 13:50:46 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-458bdde7dedso40115215e9.0 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 10:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755021033; x=1755625833; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BmZ6AI1oYZUN3kBAeRcqk0hjcQlQg+dobbuvMUfrXcw=; b=Y+wnZmnoL3VF1wtZMzOf7HNmbKDXc9reybEa/tHjzaBiVltHhxT0N7RMva6G2QQ+Ki wwrGFR4F/I4oISoJ4l8WcHjx3roehVupYGDryF2wX/zDYLMH4Y6Uci7hJ6T8kBzdbhbc x9B4Goqt1anhVOSWISOhiTozUiIJipxNMjIaaksBPIMdLvs2BiglfbQGhBaCB3KVRycu hjpws4vU7HHi/vbyxDPgdFaDp01NWqZJfDOZVl93IydjA01gfcA6qJje+5WL9maTmdRG UvyJugHPA0uhJMg+5pw5hVKbi++7Vr2JGWcVAKEw7nkPOcGrPuHTWMgoogfbG7cUjpZt H4bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755021033; x=1755625833; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BmZ6AI1oYZUN3kBAeRcqk0hjcQlQg+dobbuvMUfrXcw=; b=W262RQvjUNwbdVoXgUpPIC/2huioZ08EDdQ9KSMRrTCmzQ/YfE2G0bmjSH/fIoBGwR gG0mLu9j/N39PcxXQZNADnwzsEyFojtwf0zjgfXPLTmOAT7gQbjaZkxKwUW20OaPe+PK RMAVzjRy/fLpa6SpMIrPRpOWIPCgSzGbauHiyWFgjiD129yK7WOKhcbBVBoOhLZffzZW fb2XYQFU5BAHd5BHJh4lmMuCGpSERA3Fazck8368q0i3hgOhWhrjQdk9wJFwrvjUQKQ7 Ga6s42f4dfDSW9YX0tsmmwrqSyQg6TyqnT2LnwqrmI+wz9bxj+We6+pTPNDlPNA+reVb DV6g== X-Forwarded-Encrypted: i=1; AJvYcCUIoQRfIibH/TO3qNEFXZ7SRLFUmCq6Z5Qsv7QpTlBX63AbUa+c4tdz3NFOxrHeZrF0p+o4lw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzdk3V8PyuEModuK09cRrEfLV4bbyQScrX1NrdtI7PlA1b7+uXg zMnRljv308gConHqLtF9vtgEIk/UFXmDDWuPfB88qVYjVcwfS2pcaZ29qhIZkcvT X-Gm-Gg: ASbGncu5OZjo22jXVbE1/dGas7ROyy0mUvn90GeM4tfJyfjSpDF37EleUxDH5d6Tuxr Ucc5NF8IWMwb5BVi7w0EU86g5I+fdc9gctScUjlSHt0ZDHD8HgVuAkSaGwoXiEfhh1RtmKU2Ggr aggUq9sd+i645mLexwp4yW9aS5+JasrllXcBFvTCO4keZfgJ76zCHw46GZc3vcyZUhR+eaLnaR4 6CcAYYW3tkOEF43ahiv+Z9bSqqIpFcnhWhNEeMQzZ7qK/faBDt+Gxm2U3h2WpZUY05eZwDj2FHq DYIhQaTK8rKUy0IiY8pbNc6BqeUHyPE//U9pvYdT625xVaPqFZ8LrJjjxpjoKyrQBZA+nz+o+3N kbMlZP+PazBCEyKP13Fw5kuCblnW/MXTIRa8aKpZskex9zJHGApIAO2rGRehhR91zYnn0qS6tNI prxgAIPcZygpYQKKuR2Jef6/Pc5g== X-Google-Smtp-Source: AGHT+IHb1TAxcoPKqUpLDa/SxEvV3nbppPejZLNEo5WYxi9ogyNwWlie/JNFy36to22FKnpuw6WHqw== X-Received: by 2002:a05:600c:548f:b0:458:bfe1:4a82 with SMTP id 5b1f17b1804b1-45a165e430fmr630365e9.16.1755021032743; Tue, 12 Aug 2025 10:50:32 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-459e584302csm330175175e9.7.2025.08.12.10.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 10:50:32 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 12 Aug 2025 19:50:31 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Helmut Eller writes: > >> On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: >> >>> Like so, I think: >> >> I think the DEFVAR_INT is not needed. Something like this: >> >> static ptrdiff_t next_marker_id; >> >> static ptrdiff_t >> next_marker_id (void) >> { >> return next_marker_id++; >> } >> >> and in syms_of_alloc >> >> PDUMPER_REMEMBER_SCALAR(next_marker_id); >> >> should also work. > > That's true. > > I've made it a DEFVAR mainly because I wanted to be able to see it > easily :-). > > Don't know if the wrap-around check in next_marker_id is really > necessary; that's just paranoia, I guess, or maybe laziness, not wanting > to calculate :-). gmake -C test undo-tests ELC src/undo-tests.elc GEN src/undo-tests.log Running 19 tests (2025-08-12 19:45:59+0200, selector `(not (or (tag :unstab= le) (tag :nativecomp)))') Undo passed 1/19 undo-test-buffer-modified (0.000154 sec) passed 2/19 undo-test-combine-change-calls-1 (0.002497 sec) passed 3/19 undo-test-combine-change-calls-2 (0.002259 sec) passed 4/19 undo-test-combine-change-calls-3 (0.003523 sec) Undo passed 5/19 undo-test-file-modified (0.002142 sec) Undo passed 6/19 undo-test-marker-adjustment-moved (0.000036 sec) Undo passed 7/19 undo-test-marker-adjustment-nominal (0.000037 sec) Undo in region passed 8/19 undo-test-region-deletion (0.000045 sec) Undo Undo in region passed 9/19 undo-test-region-eob (0.000045 sec) Undo in region Undo in region passed 10/19 undo-test-region-example (0.000053 sec) Undo Undo in region passed 11/19 undo-test-region-mark-adjustment (0.000053 sec) Undo in region passed 12/19 undo-test-region-not-most-recent (0.000038 sec) Undo in region passed 13/19 undo-test-region-t-marker (0.000035 sec) Undo passed 14/19 undo-test-skip-invalidated-markers (0.000083 sec) Undo passed 15/19 undo-test0 (0.000069 sec) Undo Undo passed 16/19 undo-test1 (0.000045 sec) Undo Undo passed 17/19 undo-test2 (0.000047 sec) Undo Undo passed 18/19 undo-test4 (0.435426 sec) Undo passed 19/19 undo-test5 (0.000120 sec) Ran 19 tests, 19 results as expected, 0 unexpected (2025-08-12 19:46:00+020= 0, 0.447184 sec) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 14:22:21 2025 Received: (at 79200) by debbugs.gnu.org; 12 Aug 2025 18:22:21 +0000 Received: from localhost ([127.0.0.1]:54767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ultdc-0004S5-GX for submit@debbugs.gnu.org; Tue, 12 Aug 2025 14:22:21 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:54766) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ultdW-0004Rl-BD for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 14:22:17 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-458b49c98a7so37880965e9.1 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 11:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755022928; x=1755627728; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=d++x9ON4vExfSOOblss9r9gfwCee/1wRRolMRenDtz4=; b=TopT0AaFu7yXeziIogVSc6FW2B83ID0YMpOUkZNBt2Q1WernB2HFexF4vA5lkCGGob LEdt618Bp1AbSZKHlzjGK5zcQAcdD6eeKoRpb7VewKIBXmkaclnqU8jFPKTkpU9RCfpC 5eaTpZdwGgxwXFoV6+9+SIN8NXY1mRzVNyLt7DQ9ucdH6+qUDjRyVaCSWPyZBv9rT8aN JB6qLpZJj3279gDJoQwhC5OOWG7pfncWbNtyxirqQqvKcyIDa164JjZD/v0wqmKSRG63 cFZqISIy7EcquJmago+eXQAuhK/Cx4dVaH1LUqB6THTbTK0DYKDcBRuPlqblkosjE6ge xUsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755022928; x=1755627728; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d++x9ON4vExfSOOblss9r9gfwCee/1wRRolMRenDtz4=; b=KgU9jWSNO+/5CuioP3qnWRkt78eeVHA333nuPRXh/UCtJZU+6W+fuvxzj0JZ0UDcOC laFakkEAjSa1z/uWW9YqKqTIUhuufOqAKpDUKKfgLNrzgAZGlfH5lFESJbyDICL/REOv yNLn42W3qd3KBzc1asjX7xX9hWiQt7FfgaYeiThtDHZgCPquqbiKKcsU19hk1RkaoQkk 8v0gAPkOF55cQdMpbBzJH6LmoP1oG2z/vJmleyChCwJtub2SqolZWP2aCAnFhgHJPy5W +/8cG+RH6n2oHnSL6OgY8qaHa5g/smwsuHR2yss+hjwiugTDNfHoAVgtBHNn9JbhZa2+ MqoQ== X-Forwarded-Encrypted: i=1; AJvYcCXtIKD3MDmaWG6e20kcZ+QN6wKcZqIIGxfrWpVyycNNIVCOo5Yf9/jTDgMwkA9+i6xk20xUJA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxbejo37dExCAnDUwiYY0ZjtZifGVc3mHKYO+Jn5b9s4KDi8YKw 7A5IBSwoHrdytm9TWh5y0DbVyeynWZlnefJ0Gd+GKjCJscXf0x4kzafpa3pawrKj X-Gm-Gg: ASbGncu4zwsU4r+9JatxIs46oJwBigbmBC83wTpsNF7KiCXKbH2C33HruWUA6vnV7gq Si1zeBVipmM1Cq9j1ydYJ8ym3SS9bhCD1xh36K2p8ychIaAYH0pYgQb6dMdEy9XW7U+ho7twT6c cpYKz/GzB+r1z1DzBmBx4WmJN01M0UkmhvD7dyQnNoWKvznVFdQbrmfNaltvE3IOD8NHkZUgjui /0ec3B3MgaYSeM/InoN1M98UIhKyloZyjVd7ZoqtB1RQwIjhBdHWpe6BL4wmFVPKC9kHJk7bW1D xr23kAzVfe5ZxLtMsECfH/dVPqSVYfbtZNLE0459H+lGAhrpwX4HcOixi/qIOiLqQqbhu07i/cI Nb3VnfSfDujtpDig6R+L2K5nz4LAdW6/z8ypYjsAT+TPrVzrT7VXUYv2u4dogp3nzXRUNNcmmeZ 2MlDlsf1422n2k7cBfgqGltaNdew== X-Google-Smtp-Source: AGHT+IHLKXH4E/FsASz58eZDBkyeB7LB9NVgqZn/IDeDP7Oiu4K08Prrv9x4tLiknR1XINdUQiwWEg== X-Received: by 2002:a05:600c:3b1f:b0:456:2698:d4d9 with SMTP id 5b1f17b1804b1-45a165a7cedmr1786575e9.3.1755022927518; Tue, 12 Aug 2025 11:22:07 -0700 (PDT) Received: from pro2 (p200300e0b71f2400d85dfed4b3b9e9ef.dip0.t-ipconnect.de. [2003:e0:b71f:2400:d85d:fed4:b3b9:e9ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c485444sm45620597f8f.66.2025.08.12.11.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 11:22:06 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Tue, 12 Aug 2025 20:22:05 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: Please find a port to feature/igc attached, for testing if you like. I'll run with these changes in my Emacs and see what happens. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-adjust-marker-entries-in-undo-lists.patch >From f769f8133efc75101589761bfe05db47e6beb987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 15:58:54 +0200 Subject: [PATCH 1/4] Use adjust-marker entries in undo-lists * src/alloc.c (next_marker_id): Return the next marker id to use. (Fmake_marker, build_marker): Assign ids to markers. * src/lisp.h (Lisp_Marker): Add id member. * src/marker-vector.c (marker_vector_adjust_for_replace): New function. * src/marker-vector.h: Declare it. * src/marker.c (Fmarker_id): New DEFUN. (Fmarker_with_id): New DEFUN. (syms_of_marker): defsubr new DEFUNs * src/pdumper.c (dump_marker): Dump marker id as negative number. * src/undo.c (record_marker_adjustments): Produce adust-marker entries. (syms_of_undo): New DEFSYM. * lisp/simple.el (primitive-undo): Use adjust-marker entries. --- lisp/simple.el | 17 ++++++++++------- src/alloc.c | 9 +++++++++ src/lisp.h | 2 ++ src/marker.c | 22 ++++++++++++++++++++++ src/pdumper.c | 2 ++ src/undo.c | 5 +++-- 6 files changed, 48 insertions(+), 9 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index f7f059793ca..42541a952fe 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3727,13 +3727,16 @@ primitive-undo ;; the markers haven't moved. We check their validity ;; before reinserting the string so as we don't need to ;; mind marker insertion-type. - (while (and (markerp (car-safe (car list))) - (integerp (cdr-safe (car list)))) - (let* ((marker-adj (pop list)) - (m (car marker-adj))) - (and (eq (marker-buffer m) (current-buffer)) - (= apos m) - (push marker-adj valid-marker-adjustments)))) + (while (eq 'adjust-marker (car-safe (car list))) + (let* ((entry (cdr-safe (car list))) + (id (car entry)) + (offset (cdr entry)) + (marker (marker-with-id id))) + (pop list) + (when (and marker + (eq (marker-buffer marker) (current-buffer)) + (= apos marker)) + (push (cons marker offset) valid-marker-adjustments)))) ;; Insert string and adjust point (if (< pos 0) (progn diff --git a/src/alloc.c b/src/alloc.c index ceda62f5ed6..c0793221acb 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3953,12 +3953,20 @@ build_overlay (bool front_advance, bool rear_advance, return overlay; } +static ptrdiff_t +next_marker_id (void) +{ + static ptrdiff_t next = 0; + return next++; +} + DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, doc: /* Return a newly allocated marker which does not point at any place. */) (void) { struct Lisp_Marker *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker, PVEC_MARKER); + p->id = next_marker_id (); p->buffer = 0; p->bytepos = 0; p->charpos = 0; @@ -3984,6 +3992,7 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos) struct Lisp_Marker *m = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker, PVEC_MARKER); + m->id = next_marker_id (); m->buffer = buf; m->charpos = charpos; m->bytepos = bytepos; diff --git a/src/lisp.h b/src/lisp.h index 79ae7d4758a..5e528f2ecd9 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3066,6 +3066,8 @@ knuth_hash (hash_hash_t hash, unsigned bits) { struct vectorlike_header header; + ptrdiff_t id; + /* This is the buffer that the marker points into, or 0 if it points nowhere. Note: a chain of markers can contain markers pointing into different buffers (the chain is per buffer_text rather than per buffer, so it's diff --git a/src/marker.c b/src/marker.c index 12d53ad12b8..73e0eb1f492 100644 --- a/src/marker.c +++ b/src/marker.c @@ -440,6 +440,26 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) /* Operations on markers. */ +DEFUN ("marker-id", Fmarker_id, Smarker_id, 1, 1, 0, + doc: /* Return the id of MARKER. */) + (Lisp_Object marker) +{ + CHECK_MARKER (marker); + return make_fixnum (XMARKER (marker)->id); +} + +DEFUN ("marker-with-id", Fmarker_with_id, Smarker_with_id, 1, 1, 0, + doc: /* Return the marker in the current buffer with id ID. +Value is nil if no such marker exists. */) + (Lisp_Object id) +{ + CHECK_FIXNUM (id); + struct Lisp_Marker *m = marker_vector_marker_with_id (current_buffer, XFIXNUM (id)); + if (m == NULL) + return Qnil; + return make_lisp_ptr (m, Lisp_Vectorlike); +} + DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0, doc: /* Return the buffer that MARKER points into, or nil if none. Returns nil if MARKER points into a dead buffer. */) @@ -859,6 +879,8 @@ syms_of_marker (void) { defsubr (&Smarker_position); defsubr (&Smarker_last_position); + defsubr (&Smarker_id); + defsubr (&Smarker_with_id); defsubr (&Smarker_buffer); defsubr (&Sset_marker); defsubr (&Scopy_marker); diff --git a/src/pdumper.c b/src/pdumper.c index 2b98d4600fb..bdadfedc4de 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2229,6 +2229,8 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) dump_pseudovector_lisp_fields (ctx, &out->header, &marker->header); DUMP_FIELD_COPY (out, marker, need_adjustment); DUMP_FIELD_COPY (out, marker, insertion_type); + DUMP_FIELD_COPY (out, marker, id); + out->id *= -1; if (marker->buffer) { dump_field_lv_rawptr (ctx, out, marker, &marker->buffer, diff --git a/src/undo.c b/src/undo.c index 1a91aca01aa..a56834f8cfe 100644 --- a/src/undo.c +++ b/src/undo.c @@ -146,10 +146,10 @@ record_marker_adjustments (ptrdiff_t from, ptrdiff_t to) if (adjustment) { - Lisp_Object marker = make_lisp_ptr (m, Lisp_Vectorlike); + Lisp_Object id = make_fixnum (m->id); bset_undo_list (current_buffer, - Fcons (Fcons (marker, make_fixnum (adjustment)), + Fcons (Fcons (Qadjust_marker, Fcons (id, make_fixnum (adjustment))), BVAR (current_buffer, undo_list))); } } @@ -433,6 +433,7 @@ syms_of_undo (void) /* Marker for function call undo list elements. */ DEFSYM (Qapply, "apply"); + DEFSYM (Qadjust_marker, "adjust_marker"); pending_boundary = Qnil; staticpro (&pending_boundary); -- 2.50.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Fix-DEFSYM.patch >From eeb806de8553c1fe17c25d59fb49c091b3c4e320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 16:37:33 +0200 Subject: [PATCH 2/4] ; Fix DEFSYM * src/undo.c (syms_of_undo): adjust_marker -> adjust-marker. --- src/undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/undo.c b/src/undo.c index a56834f8cfe..95038b16b6c 100644 --- a/src/undo.c +++ b/src/undo.c @@ -433,7 +433,7 @@ syms_of_undo (void) /* Marker for function call undo list elements. */ DEFSYM (Qapply, "apply"); - DEFSYM (Qadjust_marker, "adjust_marker"); + DEFSYM (Qadjust_marker, "adjust-marker"); pending_boundary = Qnil; staticpro (&pending_boundary); -- 2.50.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Don-t-use-negative-marker-ids.patch >From 686bfcb46781d696884576bcd2c560507730b2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 17:45:11 +0200 Subject: [PATCH 3/4] Don't use negative marker ids * src/alloc.c (syms_of_alloc): New DEFVAR_INT for next marker id. (next_marker_id): Use it. * src/pdumper.c (dump_marker): Store id as-is. --- src/alloc.c | 9 +++++++-- src/pdumper.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index c0793221acb..df47cd2fa9f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3956,8 +3956,9 @@ build_overlay (bool front_advance, bool rear_advance, static ptrdiff_t next_marker_id (void) { - static ptrdiff_t next = 0; - return next++; + if (next__marker_id == PTRDIFF_MAX) + next__marker_id = 0; + return next__marker_id++; } DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, @@ -7894,6 +7895,10 @@ syms_of_alloc (void) #endif DEFSYM (Qalloc, "alloc"); DEFSYM (QCemergency, ":emergency"); + + DEFVAR_INT ("next--marker-id", next__marker_id, + doc: /* Next marker id (internal use only.. */); + next__marker_id = 0; } #ifdef HAVE_MPS diff --git a/src/pdumper.c b/src/pdumper.c index bdadfedc4de..74cbe88bb94 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2230,7 +2230,7 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) DUMP_FIELD_COPY (out, marker, need_adjustment); DUMP_FIELD_COPY (out, marker, insertion_type); DUMP_FIELD_COPY (out, marker, id); - out->id *= -1; + if (marker->buffer) { dump_field_lv_rawptr (ctx, out, marker, &marker->buffer, -- 2.50.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-Port-marker-with-id.patch >From 5014504eb21371852b18607346f7a958be983ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 12 Aug 2025 20:16:33 +0200 Subject: [PATCH 4/4] Port marker-with-id --- src/marker.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/marker.c b/src/marker.c index 73e0eb1f492..fd88743b0b3 100644 --- a/src/marker.c +++ b/src/marker.c @@ -454,10 +454,15 @@ DEFUN ("marker-with-id", Fmarker_with_id, Smarker_with_id, 1, 1, 0, (Lisp_Object id) { CHECK_FIXNUM (id); - struct Lisp_Marker *m = marker_vector_marker_with_id (current_buffer, XFIXNUM (id)); - if (m == NULL) - return Qnil; - return make_lisp_ptr (m, Lisp_Vectorlike); + + DO_MARKERS (current_buffer, m) + { + if (m->id == XFIXNUM (id)) + return make_lisp_ptr (m, Lisp_Vectorlike); + } + END_DO_MARKERS; + + return Qnil; } DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0, -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 23:29:37 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 03:29:37 +0000 Received: from localhost ([127.0.0.1]:55679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1um2BF-0000UK-51 for submit@debbugs.gnu.org; Tue, 12 Aug 2025 23:29:37 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:50610) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1um2BB-0000U2-8f for 79200@debbugs.gnu.org; Tue, 12 Aug 2025 23:29:34 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3b79bd3b1f7so2908640f8f.1 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 20:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755055766; x=1755660566; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=K8WQWAaTIBua6k2PAwzw5agR7AITr/dRZ9+RxGyKEo0=; b=XiNSXho4mggB7GxVAfvF2UT3wQFtJoK00+S8RIQPDJrz+TVO539TpohwNfor+qjIjV E5JlyxfvkGruLuDRbrEt0j4LpXsnmJML69LBiykTOlJOGSJuFDDl8tSXe3VoWD8hFIwL DGJOWs0p3IQvlTemOvGbgd8CHU6A0Ggqqe8BGkmvXFHKm9M9V5akKG3B4xzfmm9UrYQk oqjRHalNEhU5UdOkuYE0z4uaNZd9s4xY0rxvzkhoAUCRprE8uBnjaayBBF2qagcEUorS G2if+eMEqE6W6UIJXYH111AKpfYd+EdDFRroQbb0xZqIwSr+2kcOybeyR6FfudFQ2uRu q5og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755055766; x=1755660566; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K8WQWAaTIBua6k2PAwzw5agR7AITr/dRZ9+RxGyKEo0=; b=ZyvxIzdFSZRETjyvOelAV5ySGXB7OZLyORbVOqOIpbuQVsnnNAKuECModHZzbezCei awm58hfW/doo7RtlBM0wiA5k/5NhFpIWqiO6JExVO6D8gz0c9b7o6Dz9rf0FFQb/ghXJ SL+EZJQgCbqlW98d/cf9eBhVyRxfzsyCvEJ2R9Og7pF4q2B7pNA3KxZGI40bp2XQLUZi aK+jNu7F+FX8aUYST69mo0VRT9KkjIExC7DPxikJf622IuUkDEZ7f2HatO8dnz5XWsEc UwY0TIeyVYhxIuI2J2wS8raEnKxZV1s3fCqSUzOowcKgE3yUJmQKGxcLAAds6n5UFwL8 Y2sg== X-Forwarded-Encrypted: i=1; AJvYcCX77lif6eWbp2VKg6PBML5mHwAaQIDjl3t/OUAD9tTWyEpbk83R0K9IinKu+KkCWr5a0MPvmw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzO4Ni1CYOENWFFdwTqO3+0LpUmCqMLdwZmoAG/4hJ1nDrrrusL 1+ScnGxFl9FkUDO0SZlMPg3O40zXyNbrPCEeHdmg1JWCnDWTO2GJzujjpaU2YA== X-Gm-Gg: ASbGncs0Q9wlJ0Pf+ScNRJ5fPRSloQC7BrBH8Us1A0vp88PIkY739aHCDhaI4DuGg99 KaoNgNSgTaczsCmjRt5PeCVhcyvULjH2v5x844WPf8HkGpiMyFLcP8krJjelW5aVogLPc35xUtk 9xuQL1xx414UmKMYdHVAk5Y84SVB5qhW/dvXTBN5/m45+Alle3os2jklkIVPsYT2H4roIgBGC7X WY7t5mAiCnprwtfLEQzpWkxkJLflXW1XOvHpldZtqLEe3Zi3TyWZ9pd5I75mVDI/u981kB2XIQs HUPJ/a8px+4aGYyE5hPSXewOJ2nql+wQZ4LqHJCX4hvxvcB0Dsn1CeyvaHlf+S4aPOyQ2wiOxKx IuF4u13K632cdisDcPXMDY7MtXW7jadVo3lw0eyYuaTMOOUz6fldKyujsd6QPltIt0SGfVLvpfr DPWDi7dXnEE1udu9Kd7dJfFm+H X-Google-Smtp-Source: AGHT+IFjjfgUUjBUdrAVtJ6lvtAFCjYBVk6o6zxLj0l1hJg66ahn+381CPK1fMKsVUupSz3O4S0gJw== X-Received: by 2002:a05:6000:402a:b0:3b7:8fcd:d145 with SMTP id ffacd0b85a97d-3b917d2b1b8mr800573f8f.5.1755055766180; Tue, 12 Aug 2025 20:29:26 -0700 (PDT) Received: from pro2 (p200300e0b707020029a388f728cb1d07.dip0.t-ipconnect.de. [2003:e0:b707:200:29a3:88f7:28cb:1d07]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b8e04c7407sm36771805f8f.13.2025.08.12.20.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 20:29:25 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Wed, 13 Aug 2025 05:29:24 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > > Please find a port to feature/igc attached, for testing if you like. > I'll run with these changes in my Emacs and see what happens. Forfot to compact the undo list: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Compact-undo-list.patch >From 8a61087d2b2bb1b82b933a0e2b8e0df4d402ef94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Wed, 13 Aug 2025 05:22:42 +0200 Subject: [PATCH] Compact undo list * src/marker.c (Fmarker_with_id): Add buffer parameter. * src/alloc.c (compact_undo_list): Re-implement. (garbage_collect): Pass buffer to compact_undo_list. * lisp/simple.el (primitive-undo): Use marker-with-id with buffer argument. --- lisp/simple.el | 2 +- src/alloc.c | 35 ++++++++++++++++++++++++----------- src/marker.c | 11 ++++++----- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 42541a952fe..2547b5b5820 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3731,7 +3731,7 @@ primitive-undo (let* ((entry (cdr-safe (car list))) (id (car entry)) (offset (cdr entry)) - (marker (marker-with-id id))) + (marker (marker-with-id id (current-buffer)))) (pop list) (when (and marker (eq (marker-buffer marker) (current-buffer)) diff --git a/src/alloc.c b/src/alloc.c index df47cd2fa9f..fb239fbc04e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5839,25 +5839,38 @@ #define compact_font_caches() (void)(0) #endif /* HAVE_WINDOW_SYSTEM */ -/* Remove (MARKER . DATA) entries with unmarked MARKER +/* Remove marker adjustment entries with unmarked MARKER from buffer undo LIST and return changed list. */ static Lisp_Object -compact_undo_list (Lisp_Object list) +compact_undo_list (Lisp_Object buffer) { -#ifndef HAVE_MPS + struct buffer *b = XBUFFER (buffer); + Lisp_Object list = BVAR (b, undo_list); 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); - } + Lisp_Object entry = XCAR (tail); + if (CONSP (entry) && EQ (Qadjust_marker, XCAR (entry))) + { + Lisp_Object id = XCAR (XCDR (entry)); + Lisp_Object marker = Fmarker_with_id (id, buffer); +#ifdef HAVE_MPS + if (NILP (marker)) + *prev = XCDR (tail); + else + prev = xcdr_addr (tail); +#else + if (MARKERP (marker) + && !vectorlike_marked_p (&XMARKER (marker)->header)) + *prev = XCDR (tail); + else + prev = xcdr_addr (tail); #endif + } + } + return list; } @@ -6209,7 +6222,7 @@ garbage_collect (void) { struct buffer *nextb = XBUFFER (buffer); if (!EQ (BVAR (nextb, undo_list), Qt)) - bset_undo_list (nextb, compact_undo_list (BVAR (nextb, undo_list))); + bset_undo_list (nextb, compact_undo_list (buffer)); #ifndef HAVE_MPS /* Now that we have stripped the elements that need not be in the undo_list any more, we can finally mark the list. */ diff --git a/src/marker.c b/src/marker.c index fd88743b0b3..15b26b18ad3 100644 --- a/src/marker.c +++ b/src/marker.c @@ -448,14 +448,15 @@ DEFUN ("marker-id", Fmarker_id, Smarker_id, 1, 1, 0, return make_fixnum (XMARKER (marker)->id); } -DEFUN ("marker-with-id", Fmarker_with_id, Smarker_with_id, 1, 1, 0, - doc: /* Return the marker in the current buffer with id ID. +DEFUN ("marker-with-id", Fmarker_with_id, Smarker_with_id, 2, 2, 0, + doc: /* Return the marker with id ID in BUFFER. Value is nil if no such marker exists. */) - (Lisp_Object id) + (Lisp_Object id, Lisp_Object buffer) { CHECK_FIXNUM (id); - - DO_MARKERS (current_buffer, m) + CHECK_BUFFER (buffer); + struct buffer *b = XBUFFER (buffer); + DO_MARKERS (b, m) { if (m->id == XFIXNUM (id)) return make_lisp_ptr (m, Lisp_Vectorlike); -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 02:39:27 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 06:39:27 +0000 Received: from localhost ([127.0.0.1]:55981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1um58w-0001cU-UR for submit@debbugs.gnu.org; Wed, 13 Aug 2025 02:39:27 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:61798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1um58r-0001cC-1J for 79200@debbugs.gnu.org; Wed, 13 Aug 2025 02:39:21 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3b792b0b829so6124996f8f.3 for <79200@debbugs.gnu.org>; Tue, 12 Aug 2025 23:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755067153; x=1755671953; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z6us8lGnkX3unQjnkG/XlNo0z+A+qA1z5ue650Xmqfo=; b=AeKRqZZHkWbWDP1glw02K3Y4rRq+kav2ml6z72b/dwJZc8KKFPcfl0f8sIg0mvzc5y 1LcsNV+ybdFtqnMUoOlbdOrM/aw6MVHp8V02wQJ/M7M3AE26EtsfDisBa/Jri8Vftde3 r6WPkFemKbuwc4XcPH9fCtU1mkTW4rvnLPn8LrsPWf3+WNeMl4VoU9tXDTJfQEzjyb3X 03wb+P1Qu1NEdrIawQkWFu3f2lrCt+OcVz0hEew0mGAvZYbEHSpSGFXVDF0pULSU9Cr2 iEgowIdr3gABLLSvKYLjU8ZH1d0MTfNfnrj8eaD+kNTK4gNPRemIpCca8QUkE5tAarzY f7iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755067153; x=1755671953; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=z6us8lGnkX3unQjnkG/XlNo0z+A+qA1z5ue650Xmqfo=; b=Y5d4lXhOWDem8zH7lSGynG8yk0wwhSkAP1RoHcpAtgI/IlTdN/S6cKXUNezbFLlQxO 6au2OAUbI85rx3g0RQ+u3vhDfpg4HG5Wth2UpOREyFa3cA/wp7R3sWF9UVL+0nrJLyw/ QwDSvQp6/XKk28Bfn4mfDHFJa2kwGWyze7R8i39ODisoOdTYP0Xqk0OXnTQ/4eS5+CL4 3w4B6XLhkiXhcRK0fWygtoImAfeUGrOfa4g7Jzc1pSPl9UprfQClqnRkha3NuNK3WCfK /i9Qz37SN+TYOQ7cQic+U6KIumz0NI5HDNK1Hxb6x7u5Ylj4laVYV8XcLnHg6TDnNhbv iROA== X-Forwarded-Encrypted: i=1; AJvYcCUYCEoskouO0Sh57bjkMf+4HKSTlKGprN7xdkLvsfNPAjaHiKzgqU4w97A1xGaIqeV+VkfLjA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywf2otBLQx/QC8Ol9qVNHt8zI9/XLTbghG92suuVYLmmnyVF8cH N8nYvHHkoQR3R00QhfFtytLN+lP4JF98F7Rpb1qENIDGhRPWhjDOqE7z+McMCw== X-Gm-Gg: ASbGnctyODTk7kpowNKAsi3ByeGTDhVX9SdrLwRUa1+QH5FNjTtlG4OC7zZxYTjjyd1 i7Dbb/MGxQf8UstinDfGLuqVrk0yRjpsaUkPFNN9P+S+GNQtu3F2Z1VoTp/uu4j/lmo+xCxSjgG o5BshRTeHIB2fzlt8RMqdtp9hKAzDoW+CcQF/wldUU4VqKW1099OhIDjF74ktn2c9ysAzA+w9k1 6Q1TbWzDvq9Df8BFxRL+v6DKmhuqb0+5ccc2RnuUpmFLJdrDYobY6ycQOkiYb3j0rdShr6sHKmw b/+UVPb85DUhWWhpt1W/OXw/AQBXi0hVO2CrVh1ncvbkhLfXMQnYWokd35h4xu2G598v0qiyP4P 7BbwP29xEn4H7RSJXGSD6UpTWv+c56QN3hk0DBtkOQGueCCS9XbN6WmELabdUbfM5NmA9sfy/6n nvNFKU49gyzMUPhwmGcdfpXIAjeQqeIQ== X-Google-Smtp-Source: AGHT+IEq9wW20sKX33wTVmO9qF77zwcUKXQdtt7nCHkfSnzpx9UN12GS07968pLU1yJDh4EPbG3TMA== X-Received: by 2002:a05:6000:22c8:b0:3b7:9141:f044 with SMTP id ffacd0b85a97d-3b917e9271fmr1061281f8f.21.1755067153262; Tue, 12 Aug 2025 23:39:13 -0700 (PDT) Received: from pro2 (p200300e0b707020029a388f728cb1d07.dip0.t-ipconnect.de. [2003:e0:b707:200:29a3:88f7:28cb:1d07]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a16ddb5a1sm16366425e9.8.2025.08.12.23.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 23:39:12 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Helmut Eller Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87bjon445a.fsf@protonmail.com> <86zfc5akys.fsf@gnu.org> <87wm79r344.fsf@telefonica.net> <87y0rpq7ux.fsf@gmail.com> <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Wed, 13 Aug 2025 08:39:11 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Helmut Eller writes: > >> On Tue, Aug 12 2025, Gerd M=C3=B6llmann wrote: >> >>> Like so, I think: >> >> I think the DEFVAR_INT is not needed. Something like this: >> >> static ptrdiff_t next_marker_id; >> >> static ptrdiff_t >> next_marker_id (void) >> { >> return next_marker_id++; >> } >> >> and in syms_of_alloc >> >> PDUMPER_REMEMBER_SCALAR(next_marker_id); >> >> should also work. > > That's true. > > I've made it a DEFVAR mainly because I wanted to be able to see it > easily :-). > > Don't know if the wrap-around check in next_marker_id is really > necessary; that's just paranoia, I guess, or maybe laziness, not wanting > to calculate :-). BTW, C-h v next--marker-id and 'g' to refresh is somwwhat interesting. In my mac GUI session each 'g' shows 472 markers have been made. Whatever that means. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 04:19:50 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 08:19:50 +0000 Received: from localhost ([127.0.0.1]:56215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1um6i6-0006g5-1l for submit@debbugs.gnu.org; Wed, 13 Aug 2025 04:19:50 -0400 Received: from mail.muc.de ([193.149.48.3]:35524) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1um6i0-0006fi-Lj for 79200@debbugs.gnu.org; Wed, 13 Aug 2025 04:19:45 -0400 Received: (qmail 7056 invoked by uid 3782); 13 Aug 2025 10:19:37 +0200 Received: from muc.de (pd953a08a.dip0.t-ipconnect.de [217.83.160.138]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 13 Aug 2025 10:19:37 +0200 Received: (qmail 9664 invoked by uid 1000); 13 Aug 2025 08:19:36 -0000 Date: Wed, 13 Aug 2025 08:19:36 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?iso-8859-1?Q?=D3scar?= Fuentes , monnier@iro.umontreal.ca, acm@muc.de, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Gerd. On Wed, Aug 13, 2025 at 08:39:11 +0200, Gerd Möllmann wrote: > Gerd Möllmann writes: > > Helmut Eller writes: > >> On Tue, Aug 12 2025, Gerd Möllmann wrote: > >>> Like so, I think: > >> I think the DEFVAR_INT is not needed. Something like this: > >> static ptrdiff_t next_marker_id; > >> static ptrdiff_t > >> next_marker_id (void) > >> { > >> return next_marker_id++; > >> } > >> and in syms_of_alloc > >> PDUMPER_REMEMBER_SCALAR(next_marker_id); > >> should also work. > > That's true. > > I've made it a DEFVAR mainly because I wanted to be able to see it > > easily :-). > > Don't know if the wrap-around check in next_marker_id is really > > necessary; that's just paranoia, I guess, or maybe laziness, not wanting > > to calculate :-). > BTW, C-h v next--marker-id and 'g' to refresh is somwwhat interesting. > In my mac GUI session each 'g' shows 472 markers have been made. > Whatever that means. That sounds a lot, but .... many of these markers will have a short lifetime, being rapidly terminated with (set-marker foo nil) or the like. What matters more is surely the number of markers which persist and can get into buffer-undo-list. In your current version, have you built my function buffer-marker-list into it? M-: (length (buffer-marker-list)) is revealing. Currently when I run that form repeatedly, I'm getting an extra 3 markers per repetition. That's in my version which takes care to eliminate markers as soon as possible after they're not needed. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 04:38:10 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 08:38:10 +0000 Received: from localhost ([127.0.0.1]:56236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1um6zq-0007bs-AO for submit@debbugs.gnu.org; Wed, 13 Aug 2025 04:38:10 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:59568) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1um6ze-0007bC-Jl for 79200@debbugs.gnu.org; Wed, 13 Aug 2025 04:38:05 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3b914a9c77dso1056731f8f.2 for <79200@debbugs.gnu.org>; Wed, 13 Aug 2025 01:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755074271; x=1755679071; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=/z08gRpFD7Eje4y2GLKVFZvsL6jVmqEn6LVkhVmFmoc=; b=MgpQf+K5bC/W3T9fey1s5YqTiij6M5jvZDJ9awsub8p89+crHVpzRBCgrltOf2U1F2 KRnC3nlTVGqAcqAK7/W6uObEMiQl2H8QYDYkKu6NKG63huPaTjdLSAURvgq01dW0pply lnCw9O1bI2LoDSWMfRQ7RU4dP8i3xMsLJiF07fxnBJqQqu297rln9hYpxmGexvdMB2XF 0JzB9HYt5YfE+9LoVXgr6mxCLWmbeM+f4cQ7GkJulzmKCVQ3N3kShTjHaK18U4F5/VTc cQ0M8Qvmc0lJ8En037/rcjkIrrxhpE5EzoLQr2zjXn9OCwZ8KSzWQ9VBKI+KZAqvwQxZ VthA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755074271; x=1755679071; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/z08gRpFD7Eje4y2GLKVFZvsL6jVmqEn6LVkhVmFmoc=; b=o8lL5qeMhXDuVRTHax+lpTnn4IGHqk1GncsIYkWU2jmfNxW3gIrcCVHfqev0aSpx6s jzb3xBDqT15FxsmNv8A7sCrsVs76QwtCHPENHav9skPhByI8dBdTQxvMu9SJElOKiFcD tpKh8rphltBhaDBGWzwW+B13Gvm3/922CN/NXJh1/66s5mGA3xlCx1HhwqtPxzBKrV6R 4wIVX2Kx3pMlNNyHNPNqtpLHCeJTXgBr508L9Dj2YcsGvhbFGbZgT73l3Gg2lhSf2QRs tyOFgTYprbaUBjfLpWovfUrtPQLoIldjIvFgMLjqFDKRbJFTGCLS86Kyd9F6A9D36lO4 EhYw== X-Forwarded-Encrypted: i=1; AJvYcCV/p2KRW6bp/ul2gykx1mnpQcggTLlI97/2+Z9ujfp3hJKhN3VVbpmrBgUxIOyZSf1D87rgkQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw1MCNoBaRJgAg/nx7Jsvu0llwLzeNyJzORHoyIZP9T9ZrpfGUH +30l5owQxHE7R1aJ0qbmyb1hr2xgzQvjS3fVeeYCWRhYfuOkGDq8LZNGX5KwEg== X-Gm-Gg: ASbGncsjasVUSwsl0Rq6NZ2HE+5qyuIxgJrpYQT7AZx+yBb/CqXrn7fMMGznD0+1T8I K0M4pM3ZSiBtr8G1YhdIxEndMNq5pYoYkOHOdjlVEJlYxsZBJIbhE/B+wdy7q5QwurYzbUquhys pJ1or+NNS5VKt7M3sovsssnTDmSTrXDigzEkKgwXqKEqOsK8H6+xbWQJL58yDuieLbnL+sJczfc tgMZ2JZVu0aupLgswj8eO5vHavqQlANJZx28RsYmGGzYm8ZDJ642N6qN6iqu5O69Nnwu0ROoY7P u/7X0+0iM6R12cRaS9Xc2TmJRau4oaKwrVbwG+UZh2bC6xm4MszJmZfId7Wjbw6VllaD6+kBfum 7R3gTUwxxBxjGjEnyHYiV7uBzNIzqOVxtmw08ZlV1vLy9v1G6QJoz41rwDGAMXV7A1VpDRWg4pE 4x2bk2sNPFW4f+5om4GLKwHNbpJ5enPg== X-Google-Smtp-Source: AGHT+IECQultVj0t1Ihw5IB/2hlv88k4cGVg4u1aRPw//OmFc1oCmyvPkr210pPzu8BgUkuXV1W9AA== X-Received: by 2002:a05:6000:290d:b0:3b7:926f:894c with SMTP id ffacd0b85a97d-3b917e32344mr1322239f8f.23.1755074270531; Wed, 13 Aug 2025 01:37:50 -0700 (PDT) Received: from pro2 (p200300e0b707020029a388f728cb1d07.dip0.t-ipconnect.de. [2003:e0:b707:200:29a3:88f7:28cb:1d07]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b8e04c7407sm37520870f8f.13.2025.08.13.01.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Aug 2025 01:37:50 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87sehxq62f.fsf@gmail.com> <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Wed, 13 Aug 2025 10:37:49 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: >> BTW, C-h v next--marker-id and 'g' to refresh is somwwhat interesting. >> In my mac GUI session each 'g' shows 472 markers have been made. >> Whatever that means. Hi Alan. > That sounds a lot, but .... many of these markers will have a short > lifetime, being rapidly terminated with (set-marker foo nil) or the > like. One would hope so, yes :-). > What matters more is surely the number of markers which persist and can > get into buffer-undo-list. In your current version, have you built my > function buffer-marker-list into it? M-: (length (buffer-marker-list)) > is revealing. Currently when I run that form repeatedly, I'm getting an > extra 3 markers per repetition. That's in my version which takes care to > eliminate markers as soon as possible after they're not needed. No, I don't have your function. Reason is that there are currently 3 implementations of BUF_MARKERS, and porting to all the variants was to much for me, ATM. (1) in mainstream BUF_MARKERS is a list (2) in igc it's a "marker array" (3) in my Emacs it's a different kind of marker array. That's because Stef asked if I could port the marker array from (2) to mainstream, and that ended up also with a different marker implementation. That I ported back to mainstream in feature/text-index, text-index.[ch] and marker-array.[ch]. Don't know what Stef's plans are wrt to that. It's complicated ;-). From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 09:11:32 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 13:11:32 +0000 Received: from localhost ([127.0.0.1]:56823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umBGO-0007gU-1K for submit@debbugs.gnu.org; Wed, 13 Aug 2025 09:11:32 -0400 Received: from mail.muc.de ([193.149.48.3]:60451) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umBGI-0007g8-Uc for 79200@debbugs.gnu.org; Wed, 13 Aug 2025 09:11:28 -0400 Received: (qmail 83656 invoked by uid 3782); 13 Aug 2025 15:11:19 +0200 Received: from muc.de (pd953a08a.dip0.t-ipconnect.de [217.83.160.138]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 13 Aug 2025 15:11:19 +0200 Received: (qmail 14680 invoked by uid 1000); 13 Aug 2025 13:11:18 -0000 Date: Wed, 13 Aug 2025 13:11:18 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?iso-8859-1?Q?=D3scar?= Fuentes , monnier@iro.umontreal.ca, acm@muc.de, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Gerd. On Wed, Aug 13, 2025 at 10:37:49 +0200, Gerd Möllmann wrote: > Alan Mackenzie writes: > >> BTW, C-h v next--marker-id and 'g' to refresh is somwwhat interesting. > >> In my mac GUI session each 'g' shows 472 markers have been made. > >> Whatever that means. > Hi Alan. > > That sounds a lot, but .... many of these markers will have a short > > lifetime, being rapidly terminated with (set-marker foo nil) or the > > like. > One would hope so, yes :-). > > What matters more is surely the number of markers which persist and can > > get into buffer-undo-list. In your current version, have you built my > > function buffer-marker-list into it? M-: (length (buffer-marker-list)) > > is revealing. Currently when I run that form repeatedly, I'm getting an > > extra 3 markers per repetition. That's in my version which takes care to > > eliminate markers as soon as possible after they're not needed. > No, I don't have your function. Reason is that there are currently 3 > implementations of BUF_MARKERS, and porting to all the variants was to > much for me, ATM. > (1) in mainstream BUF_MARKERS is a list > (2) in igc it's a "marker array" > (3) in my Emacs it's a different kind of marker array. That's because > Stef asked if I could port the marker array from (2) to mainstream, > and that ended up also with a different marker implementation. That > I ported back to mainstream in feature/text-index, text-index.[ch] > and marker-array.[ch]. Don't know what Stef's plans are wrt to that. > It's complicated ;-). For what it's worth, I put next--marker-id into my Emacs, just as a counter, nothing else. In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated g to refresh it. I get just 76 markers made at each iteration. That makes your 472 look high indeed. Might it possibly be there's a bug with DEFVAR_INT somewhere, and that 472 = 8 * 59 has wrongly got the 3 type bits in it, and is really just 59? Just a suggestion. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 13 09:20:44 2025 Received: (at 79200) by debbugs.gnu.org; 13 Aug 2025 13:20:44 +0000 Received: from localhost ([127.0.0.1]:56840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umBPH-0008A7-Qj for submit@debbugs.gnu.org; Wed, 13 Aug 2025 09:20:44 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:52268) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umBPD-00089a-3Y for 79200@debbugs.gnu.org; Wed, 13 Aug 2025 09:20:40 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3b78315ff04so5577307f8f.0 for <79200@debbugs.gnu.org>; Wed, 13 Aug 2025 06:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755091232; x=1755696032; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=sl3Ii5oOi84ss0KVHC3vspLf3AFYX0uoKG83gbaUso4=; b=bKUnXWviqQ7DsJ4BeaVOMkYvH7hk466E4nBNCJyBDXMwgp9hERT6z1t8HCf6h1ugcM owUUvIrYHHG5wf1LnyFQvejKYcApZAmPyOOOycBL/UD/x2lBNRg3jkqkeMvwveYPjl+T 9Ih2xWjf6NkBailuxF76mRLvtpqE1G0Z5u2RRXV8ftFoxsDQE0EWzj4QtmC3l0nPlMdT quDFAQM+6htmDcDC9xRr5r4KWW72zjz3vikEoHmIosBN8jYNfTJYFBmSB+ZLb3KbX8BJ DnPSJ0QeD5rOO850IoD4DITWrj7mn6yni7zaVmUxXy+8eGQr4i65IQ16niBVSqfnDwrx r9GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755091232; x=1755696032; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sl3Ii5oOi84ss0KVHC3vspLf3AFYX0uoKG83gbaUso4=; b=GHdqmJYd4P/eb0q29Yxost48kK+BQrJbBmllnTGO6He6MpL7K51kh9z76mq/rAUUXD xC+S6BKkb27drKaLDusgUDrLjB/98fPVFkN6thsHOo7fvDjK4zp8VWyuRHcwptqjsdvx bKWIeJqWiF2QfwucRS6WAB1O4QUY7YsUmfnifizO4zPl+7QrCY5qlrXCaCU5ojIWV8VU TpRrBU/hgFuf+NrNmsktA4HuTQjPiaBu55weMu1uqsbcLIUZishEwuPDC9MR1RxkHYep NsA73DsNWxhpU4015jrdyEONem0fnZJKq4DKnQgM7RcsnrkicZYGR3+toRPMpxxwDgiD he3g== X-Forwarded-Encrypted: i=1; AJvYcCVXI15G51a/zb4APK5uWtqjDzB6cTgq1vwAiBZSNesuDlA7TKSTkjySHyXes03wqLxKKNSgsA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyLGiTTJhiNRTKNaGt4zI2NtqDOzP60xU1gh9kfjU7PSz71C2+c 3rgAoedf8yxIcBeacC9B6RjePh1KN6hZoCzWMIb2RNxslHpAGqisTa7WRKyenA== X-Gm-Gg: ASbGncuT0tmBwWc0/fNxn5f3fNMgYJLvvUjUr38mdQVObabOda15L+/JSdl+W5EHwDh XklXccAQwyWAwSAGXTUdFH120XDbm1YTpXLtuVb6thbY4fHziLCHd0qhKlszGTHdiSbcbGNiz1A RVeAR/tsYWkR4KKFY4pl6l1AwLnSSlXOOy3azRnspF9Utci380HKpWv8HfxrNsrTVTtkVbAtx06 28ROfym3WYyl9PP7wO42BrCwIJoUngyJ8BLShDo9Rd85UAYfISXZkX8tmxletDdZD72VRmsniDx aU/ktDg0mTONM+DJXckrIxH4i1hQ3UmQ6gM/6k0OAA2RvjzV+9Y3F4H1HwEOZCp2+KMmaHqiaKc Gl3jDtWs6ygT+AVZXpLhU0pf9HMNoXEbvzOacAHcxjF5bgAFuJpAYl1t9C5kH8xmx0LMJR2MAMB r6ZspPQPtzsv45v1bxixacMz4yxwGLzA== X-Google-Smtp-Source: AGHT+IH8K5Ot58qCQhbXUFRfCU2K8YffEV/rmFSM+BRvjAvtEGwEKbrY4dNjU9CJF1CLGKPB0YQRgA== X-Received: by 2002:adf:f252:0:b0:3b9:541f:ea99 with SMTP id ffacd0b85a97d-3b955aca769mr48525f8f.4.1755091231627; Wed, 13 Aug 2025 06:20:31 -0700 (PDT) Received: from pro2 (p200300e0b707020029a388f728cb1d07.dip0.t-ipconnect.de. [2003:e0:b707:200:29a3:88f7:28cb:1d07]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1a50b902sm2711685e9.3.2025.08.13.06.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Aug 2025 06:20:31 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Wed, 13 Aug 2025 15:20:30 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > For what it's worth, I put next--marker-id into my Emacs, just as a > counter, nothing else. > > In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated > g to refresh it. I get just 76 markers made at each iteration. Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in the GUI (mac) I get 270. > That makes your 472 look high indeed. Might it possibly be there's a > bug with DEFVAR_INT somewhere, and that 472 = 8 * 59 has wrongly got the > 3 type bits in it, and is really just 59? Just a suggestion. I think that's unlikely. There are a lot such defvar, and I think someone would have noticed such a bug. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 01:20:08 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 05:20:08 +0000 Received: from localhost ([127.0.0.1]:60586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umQNk-0007Fw-1X for submit@debbugs.gnu.org; Thu, 14 Aug 2025 01:20:08 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:58502) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umQNW-0007DY-Cu for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 01:20:02 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-45a1b00a65fso2460905e9.0 for <79200@debbugs.gnu.org>; Wed, 13 Aug 2025 22:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755148787; x=1755753587; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LYFCYDLtx/9g8QE73lsnLFVi0Q2U1AU2F63q7kClfvg=; b=ZbKTaU2ov5pILhHNKkBcMtfZU5TP89DySYYkb02VyZ6nSPIWfpI/7PP59cJPqwA1aP KDn5dM03QqvTOwqlhMocByoqOqYTOTR+T03t+N5VuWThJRAAJzkQiiWzdm/Ugq1NZG+q XAmnjakecgdWjxElKejlNAT3fE8+JPuNanKxDdrEpqqd0zCWhZ5iTo3fBq42PuGiryre T+qYG8yMT/ErC69F0ntCVpT1yz6MNz2uhPzYzoDn0RjeqvyH2J9+qz6FvKvLSIhpne4e ul7fvFghjYk0A+0oyu9wFUwyuMfPJW3GyapO47HOe++Stq5bpcgrXhrq5pvvfeNwwQn4 a6UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755148787; x=1755753587; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LYFCYDLtx/9g8QE73lsnLFVi0Q2U1AU2F63q7kClfvg=; b=RlTPzlkqpZDQQMTb9sijAiMVC3lMHVEpCYeNV4cQ/HksxaqT7ZwfelPA7jblalyoSs wcQzW8VA4mcgeALIT4vJl3KsSZ+2zVY0Ex3kRe8TwJtbmdt7wXnZTdiexDc0vOntJiiV oECrKm84k4c8/1+YN2XgKpeFUdXnW9jzhhBRqZLC/YZ4cT0nssyN9YDSr4Ou5F9UyGH4 PvWVAsF1gltdvHG845KOShYcPX73KtlWECnk00lM7+bXZc/6Lt6BZYQ+hUToQoGtqc/6 NYqaPqU6RsfFpFskux6num3Bwptg36eTG6osnX5p49p0BSC2s5bL3VF/dq7b8IQLbOnn FTaA== X-Forwarded-Encrypted: i=1; AJvYcCXz1h81Mu193WMr2Yet4jlN/rscDSefm4A74qwjaf64yGyhrd6aC/W6zf9Agg2xo8/5qxtuvQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzOvEV54GSlTkr3TkKMvVu6NkxPYkcjP+omdHugT10soUiFbShi 9uqzVZuraabPS990bd+dq7APJDl7+0iX324cPAEhiTiTvUqcDHgrYivjwUhcn2Oq X-Gm-Gg: ASbGncsqe+GJO3k1pF6IXJfsKhsEr3E9GxTZVbtbachjsMpxeAk7XgsQ74GflLR/7jd OqAQumkMC3uQ4Q1rWOBZwRWZw7RWcem3mR3BWr+b6SbWk8HMPjv4ChPODMeWXFRIib74dKELU+d 5wWde/ZJop6sFp3OZH1IKcFrTRim5a0QsTHSNufkBCzkIvTjmI6yzvJWJ9wvzA/VyU8sHJzMyhg Ihv8oK2iq7+6ZtZBaOQ8rW1ESHzlIVzBuozpmnQ36aouakCKefwQ5XkwnW8cwZTPi4AQy2gYWhq /7jvz/0OzZoAUaDABCuJDs+zHoMddT7qxn4RjSHcllhN4SuNO5Uebgwv8fhrjRsaSIKmJn1JAz9 rivt3fOeMZ1xctIIdFQGAKCTHqC6OlQNScavELEN6LuSFJVEuOeacfKTsOBGqKMO5GUQgpUTqei Ek0DnJmTWYpQjJcGxcZEEs6c8u8wCVWQ== X-Google-Smtp-Source: AGHT+IGKMJtYr2HqWxmJd+CxAr5KygiQbJUkWyZbinzNs/dAibmUtlMtKdsI2wWThilAFbMXccpvcw== X-Received: by 2002:a5d:5c84:0:b0:3b7:895c:1562 with SMTP id ffacd0b85a97d-3b9edfd22a6mr1248857f8f.11.1755148786851; Wed, 13 Aug 2025 22:19:46 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b91330bf7dsm7461916f8f.28.2025.08.13.22.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Aug 2025 22:19:46 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 07:19:44 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Alan Mackenzie writes: > >> For what it's worth, I put next--marker-id into my Emacs, just as a >> counter, nothing else. >> >> In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated >> g to refresh it. I get just 76 markers made at each iteration. > > Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in > the GUI (mac) I get 270. > >> That makes your 472 look high indeed. Might it possibly be there's a >> bug with DEFVAR_INT somewhere, and that 472 =3D 8 * 59 has wrongly got t= he >> 3 type bits in it, and is really just 59? Just a suggestion. > > I think that's unlikely. There are a lot such defvar, and I think > someone would have noticed such a bug. So, with the patches I sent, plus a variable I've added, I can see that compact_undo_list now removes entries from the undo-list. Question is is it enough to be practical? I'm afraid I can't answer that - it took me 4 months and a port of igc to mac to notice the problem to begin with.=20 @Oscar: can you perhaps give it a try in the real world? modified src/alloc.c @@ -5832,7 +5832,10 @@ compact_undo_list (Lisp_Object buffer) Lisp_Object marker =3D Fmarker_with_id (id, buffer); #ifdef HAVE_MPS if (NILP (marker)) - *prev =3D XCDR (tail); + { + ++n_compacted; + *prev =3D XCDR (tail); + } else prev =3D xcdr_addr (tail); #else @@ -7709,6 +7712,9 @@ init_alloc (void) void syms_of_alloc (void) { + DEFVAR_INT ("n-compacted", n_compacted, doc : /**/); + n_compacted =3D 0; + DEFVAR_INT ("gc-cons-threshold", gc_cons_threshold, doc: /* Number of bytes of consing between garbage collections. =20 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 01:21:52 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 05:21:52 +0000 Received: from localhost ([127.0.0.1]:60592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umQPP-0007Oh-TU for submit@debbugs.gnu.org; Thu, 14 Aug 2025 01:21:52 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:48389) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umQPM-0007ON-4c for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 01:21:49 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3b9dc5c6521so211699f8f.1 for <79200@debbugs.gnu.org>; Wed, 13 Aug 2025 22:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755148901; x=1755753701; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=h0MhEkiITC272cZM/J4eFRe/m6f02UllMPig0oT3rZI=; b=DpXsGdHLlnBw6a7o10Fyex0gPLzWRyO9UYZXg5lbxNYL08Hx6bWfywRWBSoQhiMjYD +svBKFRyNTrjCrGLgq6cnmIx1VJvIq21MJhqOMetsfmJK4pGrksyL+qPLzSjKqqtmpK0 4y+mI0ldX/m5qikNgoKHqMCa7QL9aV2naT+zJyFoeT7OJRxqn9RAXF7xwnNsOB0sj2+e iAjii3yWHSVHa5piGdN31i3A6Wj+P7nPcWQbp/0XKuXWpmnFJBdur2vB+6t50Hz7Utdk CZZKRcPgTH26aH+AOBoCDblqkMFPTLeO8GqNnOylgRBaQz5S8p9Tyvq8dhjR4Jx5P2Q4 Stuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755148901; x=1755753701; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h0MhEkiITC272cZM/J4eFRe/m6f02UllMPig0oT3rZI=; b=Egnz9dB8IYgDq6LuAM2jABqEIe/yRUzUTdcv/0dSF21wnhJexOYmgc4H/gzg5Yuav1 DkfXtu11he6gIBiL7wB3Flml7yCvq41JxqGfuNxCUKbXLebLFWBN72nk5kduLzUxsZ58 wubn/KBC7qC3NKgCE+PJGjaGcL1URxIpIC73EOW0+lylvxDLCDT1+ifZgFG9sWY3yFxv DmeHbVTTfCwQBcNcWOsegDvtbTYLbklS8a1HPZmNphZBcIikIOzmVfBKRzeQhZGtObgf iGU6S9uPquZpKw9zoSyotawhbRpyDEVnn8M7pwYyUlSq0XDbpK2d5HGXnosRkHzPnJ+z v4rA== X-Forwarded-Encrypted: i=1; AJvYcCWUyesx5DdWwPqzpKMQ+779e6yZ6IshBrMvETzd4+jisudtvhZ1rfytqfgxAhUBy+/953YWzw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywvia7RzmmrZ4BWt7SJBYWbARgd71SSzEoAI8pzp59jDoTRr9uo 4phcbGqNfnXnrFi7I4FozSZ0Ap7Z6OtH/B+g9tMhiJ6llhPbz5OiB/+uHjntHbKj X-Gm-Gg: ASbGncuwTmzyy5kdFEr9U7614RlIFaxg9U+LxqP0QvI7IK3u3j5eknKoI3kLrAHCCkH ijJ1wcnE/jooZYHwre8ODeUsy3b+OHphPqAYSceIkKaDBLEGMNFqxun4ByU30u7t8uu+LipYzzF w3jJUphgnbbovpqQ1f/asGJ/RQ13D54cuWrl4nM2OJRMyrWJtWU9ff2DzxSB7Aph/LbkVaUNGvn QROMgZ0PUJAkCLJDygW/qZVmp7rt3mnm19Hc5Slmtmtp0CykXnJfoV/HA2SHhjPT0fC2GZjDBdu dvQ2LAwggNeRipxgH5AaBfjPAbzlLrEq3beMOC+Oeo3tfifiDvATik83F65H2n2VrEftodH9poi 4LGNQt4WLdRNJtVlkLFgHvR5v5UvzB0p7ENUcCvlxnP3M94//nHL8CJgFatzupnaAI/qpHcQsQT DQ7spEf5j2xq4p1v4TdrSqEJwGPcyb0w== X-Google-Smtp-Source: AGHT+IEeHRNSBRaRNGmxzEY/k5daVwqI43nFEgZgRaAfEwA87HDOc+pjmlxfq2sbYh3SvG0H8OZ9iw== X-Received: by 2002:a5d:64c4:0:b0:3b7:886b:fb76 with SMTP id ffacd0b85a97d-3b9edf8ffcamr1131461f8f.12.1755148901233; Wed, 13 Aug 2025 22:21:41 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c485444sm50296270f8f.66.2025.08.13.22.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Aug 2025 22:21:40 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 07:21:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I'm afraid I can't answer that - it took me 4 months and a port of igc 4 months after the commit that made the marker in the mode-line display a problem so to speark. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 01:45:26 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 05:45:26 +0000 Received: from localhost ([127.0.0.1]:60647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umQmE-0000Fg-CH for submit@debbugs.gnu.org; Thu, 14 Aug 2025 01:45:26 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:58627) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umQm3-0000DD-Li for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 01:45:22 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-45a1b05fe23so2583405e9.1 for <79200@debbugs.gnu.org>; Wed, 13 Aug 2025 22:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755150309; x=1755755109; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EXyp9iP9Z6C+O6K4jTD6ZsSxubjvCdO0KrlNlC1BiAI=; b=DQpqD3e81/qB+UaMERVXZQvMiikTyXvlArV/q0dQ6qj396zHEyvQu2dZ7IcbWgBHuu yFTV6WIqMEtNJ7kzqTUh9lLzkpUTaYJsoHB9f+7aByS915OEGtSYyiU5DG5OsryZMdTO SwenTA9ROrwk/oI3K9NVPZXzLQ5Topi/I6Qr1uT81x3oXCgl+hixv5zoYFEgoB8DLOFa TL02Iyw2RJ9PgIZ+B7/JsngbNE4Fg93PdVNmjRCZlxKUl8TAQcDPCesfJDqlx8bmHLEX mqxkM6U6HhMceVu0GLN1+52qC9o2bFb2zY1Li+FR+DYVLAkCba+4ToFsiBJpwQqCoWrP 4Inw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755150309; x=1755755109; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EXyp9iP9Z6C+O6K4jTD6ZsSxubjvCdO0KrlNlC1BiAI=; b=p8aKkJ+T7TT87mnfWyRQkDrkUcQSKzuMooas7gRrboOdAuWJ4c2urppaSbfa4/RU5W ow7RWv2DNFm1R0sv1ZbtzsWtN4sMnQs7W7KL9QUpdxBBVog4Wcl+JHFz8YOoJsdN3urM sEsTCAUFtfx9jfnU79KvzmrvuKgGmqp9UNbNBPklIjWOVWKU0rMyeFdbYzVhjSiaS2YP onKVbKc6m9oOZpG7+aKD8BilbTaaLDYHclbLVTEg4gF9sp1lC2hWXI1tLhHYDyDAoTw5 NPiNZ84i2PFe8D9sQ2m+gwkorLkr6oc/MChsIypoyt4w7JBvMc2ozH5bbymjVCpx3wrm bRuQ== X-Forwarded-Encrypted: i=1; AJvYcCXRlE5BRRHrfl1OY6Vnq0K/2Ff5uCgP6JQBwiiXRPO71l+h8y5mCn6m9CHJCU8ws2d1ZtnaOA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy4ipmewTfE6L9RJ0ibu9R0oE9TT88eI9k5RIf1RybNIJI+ns99 BWxgPFjRMMdjBNRhYcLm+a1SCIeXMWwb2qtQ3NEurLIkXLBxQZCAT9VED9TTgMte X-Gm-Gg: ASbGncuCK+AnQTfLSkJfgzsRlf6frBwFdIytv9idbVo35tMPlUsYKQrEEn3FqR3Eal9 MnyhS+f6+QaToNZhWS0qrfwpneoS8B6FWUNoOF3GpwDYJszh+m2hfZjilq9twzo87TJi+lp1ZEx 5/uDKIk9Oyohfe2I3zdVtBehh75BeiuvK2lYVMl3CTRgQ/racpW0CtBS9IHxPRWN2X2UOSF+82w Av0097YYi+hn0k94XdteFXffj7+NGQ5Oue8jKETrtqBtuuJXyLB+r5qRtCC6bmgFp7dyBd9aM+c dU8FUOc2r2aQE1r0eWYTIARkpUgEHA449+3RhMFdt3czgHHDzZBWBRCVs0KM9AlGZAh4i+2e9tL qFtFn89zBHMGxf9aksZOhGmiFkUSQzpunu8+d8QxnZ8NwMAP2mVSStSRz+2uR38DgUe0WQhTcle NbQRAyACiJhcFzTL++APl2J3cHGAlzQw== X-Google-Smtp-Source: AGHT+IG8umbyYwisuYbghN6Vv5u5z1DDOXDD4AnKZ1c9b9g3sH/X6pepctLAY2Vot6gOmUpRzz+3PQ== X-Received: by 2002:a05:600c:1d16:b0:459:94a7:220f with SMTP id 5b1f17b1804b1-45a1b6577f9mr8718915e9.26.1755150308376; Wed, 13 Aug 2025 22:45:08 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1b793f37sm8120835e9.2.2025.08.13.22.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Aug 2025 22:45:07 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 07:45:06 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: >> I'm afraid I can't answer that - it took me 4 months and a port of igc > > 4 months after the commit that made the marker in the mode-line display > a problem so to speark. @Oscar: I've put feature/igc + the patches here: https://github.com/gerd-moellmann/emacs-with-cl-packages.git Guess that's more convenient :-). From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 05:53:55 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 09:53:55 +0000 Received: from localhost ([127.0.0.1]:32880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umUeg-0004vD-B0 for submit@debbugs.gnu.org; Thu, 14 Aug 2025 05:53:55 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:45075) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umUeb-0004uu-6o for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 05:53:51 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45a1b0becf5so3365335e9.2 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 02:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755165222; x=1755770022; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GDL4s2uW1i6T7OaActKV1Yk9r6o83aj6ISuY0Kq4ozw=; b=iHEZBFFYC8CCTpw2o9iwMaGqZK6OqNJLG7L9UqubC3PfPbOfBFm2XveQj+Y9KXP65g CwA7oXsftud3pa4ElNrdnqvIBCLAQIbyW0hxpnd2JenAJ0od4DaWNTFi9czOY/Xum+2D fQuAqm/wn2bSufOHhY9QYvkgG43k4tymwi/w0ImGOiS0f+03n4ah83akB12x9Cnk+kc9 QnCXcnoZDYTO0Ny1sxhCUZMaLj6D3ywmxPF0VGuk2BWu8GGHsyKHqjtRkP15DprfEYyv vEhTJOgIsc7jDXvku3Kzy3tP41Y+dsROlfRtHAo6Quqr7WsrX7M+xI5q2MQ/woBNk28Y OQfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755165222; x=1755770022; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GDL4s2uW1i6T7OaActKV1Yk9r6o83aj6ISuY0Kq4ozw=; b=YqDxI9hD9ppHNz484yb+FVmURfrJ04hMxY1DY0xPia8+FqCiMS3yTN3GHnDol+dFs+ F4IBhEcL1gmGoUWPuJE52vEAJa0S/MtSWwkRjDjucfsmBCfKSKRjveJF8GXmGaiTjhKH 4HTvu4IyZmjXTc2uC8p0f37uqy6G2PY1CCuuhML2TugRq5+Mhgl/wJ/ePVwElrwsRkDN PxrJWqg7RP+onwKlQ8TFFusFLfIqxvpMyJZgEVRkk7E6IVz5yirtBZ8tzsRUwhHbf3Iw r0fPqxLAPujN7iidNV+d7F/gQAM/brhVLy8OXoFH2R60OnsneH+YcZsh5gcqhCe22uGb 2XKQ== X-Forwarded-Encrypted: i=1; AJvYcCWzrfiMLoHTpXe3ysaR731n6AN+3VpqFw7dEjDZ8/LjCiDaLi+UGvJ7ud1DD1vaYDA54j1Oqg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx/GuU1gBSrwXVqFo145ohbs1rwa2OIy6XpY/kHgYBCXX0oI3oJ 9W+Ld6CHBZCz4p8uCrYmGL/HmIcCf1zLj808pNnlHhT128zNapCtVLOqWu20jsR1 X-Gm-Gg: ASbGncstPOcmGWz9q889J2wljNsW3gyhwbTcoG4haS68WVpyK/S1z7Abhf5IMhSGZ1C U+e9rskH0fszUql9fFGeI9JuF+ezh95Cj4fqYGTmO2XVM4DaJwSetUyooNrClkPHsGM5fmnpwN7 jkN5uB9hqm6qlYqTZFN+LxnFuBvbuBW2cHuX0g78Evpns675UEZUIVg5d9pXIBcz6HFm/0GPtAS NMwry4BeuvGP6wknXklhFrqVHH/4xSnY+HmbT4recT6N1cbTLST7paE9TDi1BBCNrt2ghZuHwGX gFqx/9bsqq/hrzswOJ1HZjTkSpKFev5IhHzPhhYUtymHkrVfW1mWkJhwzT+MzZiTRNCcOx47yL5 wzdol7biIJo+RR2vueiUkRxnNZQK0gto7ct0QEv6C7sjyfpVpzU+A9OYB4EtUzzgdhWRLnkXIrN C9NqQUAZFPEVEmZ2NmNQD9lv1dZl0OuvBkMyc= X-Google-Smtp-Source: AGHT+IGfwIpAEvIKnexPcWLHkdjVuZurbv5y0tlnX9tAwRzIkYy0umxuV64fRWmB3qJQInxO5rDbUA== X-Received: by 2002:a05:600c:3b92:b0:456:fc1:c286 with SMTP id 5b1f17b1804b1-45a1b61535fmr16732095e9.1.1755165221853; Thu, 14 Aug 2025 02:53:41 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c3b9386sm50496705f8f.18.2025.08.14.02.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 02:53:41 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 11:53:40 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Alan Mackenzie writes: > >> For what it's worth, I put next--marker-id into my Emacs, just as a >> counter, nothing else. >> >> In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated >> g to refresh it. I get just 76 markers made at each iteration. > > Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in > the GUI (mac) I get 270. > >> That makes your 472 look high indeed. Might it possibly be there's a >> bug with DEFVAR_INT somewhere, and that 472 =3D 8 * 59 has wrongly got t= he >> 3 type bits in it, and is really just 59? Just a suggestion. > > I think that's unlikely. There are a lot such defvar, and I think > someone would have noticed such a bug. Another interesting detail that I didn't remember are the values of undo-limit and undo-strong-limit. I don't understand why they are so high (160000/240000). With 1 undo/s, I could undo for 2 days. Whatever, Maybe I'm overlooking something here.=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 06:04:41 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 10:04:41 +0000 Received: from localhost ([127.0.0.1]:32892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umUp7-0005T8-1R for submit@debbugs.gnu.org; Thu, 14 Aug 2025 06:04:41 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:55420) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umUp2-0005Sm-Ex for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 06:04:38 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3b9e415a68eso376382f8f.2 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 03:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755165869; x=1755770669; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LavrmS5Sp+RQaYDLesldS67C9aOUUmidQ72mmqXTuDo=; b=QQLo/D9i8uVp2wrJouWmMwSuuhw+2yGVQgBe7CC1vhorCoYD/QG+wA7AAWXc5r8l4I z1nc4XyD/xRtK9P6B06LECpl6L3GJrDq12uPiTn6HHpEtTLL0JrgQAjfKpRBqzQV1S2S 4ue+CNgeSBzsZOFuBsNfzIW+DUkzRM0bMWQrBbr7qOKcR5DweH+Kp6gYt0rs10W1UwJK HIFV3x6t4aUcFGbbCksA229GLsisUNcgEBQigME8pzJ90J90XIU21pb3sjUINOmZFf0p xFeB/f/KsPLJW9EOPSnhny5RONe0hRNSWhrCtcPjatnq9jBqMueBistVkiYBKVJZPgRQ ed8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755165869; x=1755770669; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LavrmS5Sp+RQaYDLesldS67C9aOUUmidQ72mmqXTuDo=; b=gLCTifp+2JhLP9UoPV7bkN8XfYjS5jQMA2v3FN64uWJbKTgGxo52HCjmD7KhR4OmK1 iVeV1uKlyMQXNhem02QhvOoeC+EhfOYk+jfP/4QE0Q0f++fql5+un0CjXfwnV9j+/KYO d4lwCmH3vJlDDdA5mZBAaSSnEIVhD6FrSZNAKBt4cGM+evyHxSNXqLRecILCXUINJLUF X45a09IAYNkGNS6zN99pIys1G4TSj72h2/iF+CFH+FvL0zSKGhrPkHSyX1YfJ/DdTJk4 4IQgz6Qglx22ArPHc8JeNQKsI2Bjav5XuHSsjBHHN1SaBv0jpbAWZuBKUO3QWsoG/+1v bOhQ== X-Forwarded-Encrypted: i=1; AJvYcCU+tifDHkUFvawUGmPeAya1bzkFF5D8BT/4zTbY7JE4Be98an1C2LB4EXiwYUIR6kVL7JCF6w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzZ1yxnFYMR1LXXs6MY4xJZ4T2as2dxT/AwQi3kHonRUbk2pIwJ KDwIfbtTVGenKxTOUFS1ZEpUASt9qYPgutJxjT7+B02bkiRtzMG4ZsAHkgsu829p X-Gm-Gg: ASbGncsAY3BqnkB5H5GkDfFjqUCfb9yenLeAG4YCoQOEQ5NbERgjOCF1wY2MnNn1yeA 0UzKsQ3/9+F8Se/oa6Y5btx0vlwT7sP3RhERVEMMH91bE2rHSUJjIBN0IpplizEK2e9tecETSH5 HDMaunoaqJNnE9GllzO5hjeTAOPch+OsCkGVv1++pKHaOcyCdOpTj5+WJiViAFPgFTcW+5G9TRO KAylUyrLT7jVYafWn6nSv6w3MuayRM3C2Rfl2NDzlxY1FdwzEMDWRbAy/tAUZSZz4ZFfdss0vx3 m8JMb82hzanzEoX/dgIiNJUNZk4SeGpb/jULKqa5BB7nCt2kJIIuPydDtbo83o+C34jIBmaUmU2 nexNni8jRkGwXOw/Gl0vLdidIzJosVElUPvZ5Ed+V7sNiAgUtHY3g2bDR9pJRMzVeWwTn9wen16 RHO91W4UebMf3YqpWeZfzMiq/i X-Google-Smtp-Source: AGHT+IE16dE+apO32gct5CX7pqfd2aE2GLtFWjBofl6IsMZhtLyHXF+31hvbD8fMdxDAVJlaDEgzfw== X-Received: by 2002:a05:6000:1445:b0:3b8:d0bb:7554 with SMTP id ffacd0b85a97d-3b9e4158a5bmr2163606f8f.7.1755165868641; Thu, 14 Aug 2025 03:04:28 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1b7f6e36sm10813905e9.4.2025.08.14.03.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 03:04:28 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87v7mswp06.fsf@gmail.com> <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 12:04:27 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Alan Mackenzie writes: >> >>> For what it's worth, I put next--marker-id into my Emacs, just as a >>> counter, nothing else. >>> >>> In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated >>> g to refresh it. I get just 76 markers made at each iteration. >> >> Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in >> the GUI (mac) I get 270. >> >>> That makes your 472 look high indeed. Might it possibly be there's a >>> bug with DEFVAR_INT somewhere, and that 472 =3D 8 * 59 has wrongly got = the >>> 3 type bits in it, and is really just 59? Just a suggestion. >> >> I think that's unlikely. There are a lot such defvar, and I think >> someone would have noticed such a bug. > > Another interesting detail that I didn't remember are the values of > undo-limit and undo-strong-limit. I don't understand why they are so > high (160000/240000). With 1 undo/s, I could undo for 2 days. > > Whatever, Maybe I'm overlooking something here.=20 Maybe undo in a region that one has modified longer ago. Hm. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 06:27:10 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 10:27:10 +0000 Received: from localhost ([127.0.0.1]:32917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umVAs-0006dI-2B for submit@debbugs.gnu.org; Thu, 14 Aug 2025 06:27:10 -0400 Received: from mail.muc.de ([193.149.48.3]:50390) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umVAn-0006cf-VA for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 06:27:07 -0400 Received: (qmail 36793 invoked by uid 3782); 14 Aug 2025 12:26:59 +0200 Received: from muc.de (pd953a922.dip0.t-ipconnect.de [217.83.169.34]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 14 Aug 2025 12:26:58 +0200 Received: (qmail 8424 invoked by uid 1000); 14 Aug 2025 10:26:57 -0000 Date: Thu, 14 Aug 2025 10:26:57 +0000 To: Gerd =?iso-8859-1?Q?M=F6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?iso-8859-1?Q?=D3scar?= Fuentes , monnier@iro.umontreal.ca, acm@muc.de, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Gerd. On Thu, Aug 14, 2025 at 11:53:40 +0200, Gerd Möllmann wrote: > Gerd Möllmann writes: > > Alan Mackenzie writes: > >> For what it's worth, I put next--marker-id into my Emacs, just as a > >> counter, nothing else. > >> In my emacs -Q, I do C-h v next--marker-id like you did, and a repeated > >> g to refresh it. I get just 76 markers made at each iteration. > > Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in > > the GUI (mac) I get 270. > >> That makes your 472 look high indeed. Might it possibly be there's a > >> bug with DEFVAR_INT somewhere, and that 472 = 8 * 59 has wrongly got the > >> 3 type bits in it, and is really just 59? Just a suggestion. > > I think that's unlikely. There are a lot such defvar, and I think > > someone would have noticed such a bug. > Another interesting detail that I didn't remember are the values of > undo-limit and undo-strong-limit. I don't understand why they are so > high (160000/240000). With 1 undo/s, I could undo for 2 days. > Whatever, Maybe I'm overlooking something here. I think those limits are numbers of bytes, not numbers of undo operations. A single kill command in a big buffer could easily fill these numbers of bytes. I more wonder why those limits are so low. It's a long time since PCs' RAM capacity was measured in mere megabytes. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 06:34:26 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 10:34:26 +0000 Received: from localhost ([127.0.0.1]:32925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umVHu-0006wd-3X for submit@debbugs.gnu.org; Thu, 14 Aug 2025 06:34:26 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:55457) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umVHp-0006wI-Ca for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 06:34:23 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3b9e415a68eso392134f8f.2 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 03:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755167654; x=1755772454; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jTVKzsDVZL7I4+kbso/tFD+Qef4J1r7gC8+dCENr2Qo=; b=T0iZOIbIeDgHpcsOlhVRNMNmEoD4LjmHpUqcV9424jCz5mjzmf4g723hdo9hHiQj6e YtjBNMdHSsiV7xrBglupEvyEZoGtdIR1+VpjOex1D6/6MIlXzjmETcgcrShIkLe0/cwk 0VtF34zRrqkGVa7Bv7BekCseQSpJ2cguFlp0eJ03ahoBNMbhYXrm8ht9C5UFxdunHM/d FBlNErgLn9E7Nd883K5ePyHyB4Q0yyJalanhFTO1hw8+DP7to8bcJsqIRC9elpfe4Pn4 1oUKisJ43wAFUT38Gio1rJ5Mt75yKkMBL29X8SY02+dMXWQzAz38/d8Zf3OvYbVOd8L6 mMtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755167654; x=1755772454; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jTVKzsDVZL7I4+kbso/tFD+Qef4J1r7gC8+dCENr2Qo=; b=XEAHQCirXQYTEbOgQ68ldUnGr/02SL4tJV+ygGf9aTj/9HhG5MrtfGVosItrmJWxV5 uTEFtAMtOY00MTZh0gy7tCUPKEttUPPCNnQJ6xjc3JM0jAxeA8Ur95ZhFy6+hsAYgH0Z 0bYV3m9Ki2QZ7KqEqbinfS88VgcKaSEhah6bjKO0UIc9GbJZd+QBIgsoaPXXwFluHJZ1 fv61rhzuSazGKEqHJQA1wxMDLuaS5QG0dQAEwRvNp1iFPXXaCIszYw/JSpBjy90/7qfN HX4Iy1swaMl9dVquovRVBROiQaew9DbHf07NrVxgMkGvHqRqv5K2nHORp1+vGtzPnJMC KuRQ== X-Forwarded-Encrypted: i=1; AJvYcCXHh2vxdhfeCb6vQFCKDiI/5xfR4A0xzms95VhPYcOtw/tQwpo5W0IsUyomXwJ6QVV2uh6sFg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz1nSc6VQ3YCu2ttW5nwDbjy6CDxXeQxJKoLITyXT/NVly0mV/o COh1RIvdMvmNTHhJmuBM3jCjLTpeow4hV+3ur46GOb16ZzTso/z1oRz6JUxhDuu2 X-Gm-Gg: ASbGncv7a9APbZgZ1zXpezMxqIMvZPsMpifQ5rmM5ZGT/8r1Iv5jvBt9XYaIWrvMjb1 Kl2Baa7ZB6fWw86tr9xqFcPGJxNfF3PERfc345+bJphBmfsM5efiHv2xAtY0YalBhzzvCDqpNAA fIYPCjUN2y+7dSZNt5qjUHDrO01sOXO1UKu8llAFkb9MOKaMUTzXw0dEyvgEbRlqj9lyRjw2+3h UlJCjPf6nr9SC89mEw5BLMITBxa3KOJqkPVbLq36Sq6tIU07U9ED/9yoxvh1C5Sq39ArReUXP8v E2nhBkyLZqvqNe/Cz+R5nlAzFNyltSuseSuf7+rzQyHzLeOGMMJicl3T8uOjh7zrHb8PDAFKake /4rt83Wva3X5X4SG/R54V+DwTwXXoQUFpaajRX/Am+RYmTghNqKz/qhY90TbhlMyeBfQu0i2C4z Jee+0vwuvGRx1TGXX5JcKzGXfX X-Google-Smtp-Source: AGHT+IG20YCcviwfrp7FUeWlD5iM0oMviILPf9DAUKeH8O4BZrYwttqTC40t8lZ5kX6jRAWMn43HZg== X-Received: by 2002:a05:6000:248a:b0:3b7:88e5:ce57 with SMTP id ffacd0b85a97d-3b9edf34a66mr2271128f8f.27.1755167654202; Thu, 14 Aug 2025 03:34:14 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c71068csm16055195e9.29.2025.08.14.03.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 03:34:13 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 12:34:12 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Hello, Gerd. > > On Thu, Aug 14, 2025 at 11:53:40 +0200, Gerd M=C3=B6llmann wrote: >> Gerd M=C3=B6llmann writes: > >> > Alan Mackenzie writes: > >> >> For what it's worth, I put next--marker-id into my Emacs, just as a >> >> counter, nothing else. > >> >> In my emacs -Q, I do C-h v next--marker-id like you did, and a repeat= ed >> >> g to refresh it. I get just 76 markers made at each iteration. > >> > Also interesting. With emacs -Q -nw, I get a delta of ca. 140, and in >> > the GUI (mac) I get 270. > >> >> That makes your 472 look high indeed. Might it possibly be there's a >> >> bug with DEFVAR_INT somewhere, and that 472 =3D 8 * 59 has wrongly go= t the >> >> 3 type bits in it, and is really just 59? Just a suggestion. > >> > I think that's unlikely. There are a lot such defvar, and I think >> > someone would have noticed such a bug. > >> Another interesting detail that I didn't remember are the values of >> undo-limit and undo-strong-limit. I don't understand why they are so >> high (160000/240000). With 1 undo/s, I could undo for 2 days. > >> Whatever, Maybe I'm overlooking something here.=20 > > I think those limits are numbers of bytes, not numbers of undo > operations. A single kill command in a big buffer could easily fill > these numbers of bytes. Ah, you're right. I had only read upto Don=E2=80=99t keep more than this much size of undo information. and it later says The size is counted as the number of bytes occupied,=20 which includes both saved text and other data. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 07:05:16 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 11:05:16 +0000 Received: from localhost ([127.0.0.1]:32962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umVlj-0008TC-Vr for submit@debbugs.gnu.org; Thu, 14 Aug 2025 07:05:16 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:52724) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umVld-0008Se-Bo for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 07:05:13 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3b9e40e27dcso596611f8f.1 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 04:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755169502; x=1755774302; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ebQznrAmlG7rjK5gVECDNcO6LHrhyEazrSXliyzJFJI=; b=Rh6DuEchDFsIzj9ZKxAc50DEGI+eZxcXqRtXIWaXXdVE+P6bGBKp2e8xpImqjPFiNb HW0/uS6BjuuCPvWcPlqmGlQ1P7aLoJU/WlZsltqW9aVqKa6EHGfpybUat0F32DBNLJu6 IxxRxep4LxVqO/FICKmEJZgn9FKIXzjv6gVTyI1HvKogzKXkuEkRhFsx4rgBPDDmgi2G N3FB23eyjp+QmC1xXjnSMOYSO4Fb/NpZBgSN7dbmmd7U09qLnGNxIXvwwKWi1d2dntt4 b9gDj0eBYDZuQRI/mnVzV4yzcnxxO09lrdKJDkL4an+5eoVIOufJYlWZGVnT7ev1mba9 W8uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755169502; x=1755774302; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ebQznrAmlG7rjK5gVECDNcO6LHrhyEazrSXliyzJFJI=; b=jwEcjuZFZFEZFwbIipkDpNOsruIW0XBEKZpO4wG62szeGUQ8Y7O+vB8boU5ALApM5V YfSRYkNL9vyo9R5ncVT/TjKm9frNJG+oUq6HQ6Ji3bskAtgG+8b29WdGeVDPJg/5KY1c GV0xqP3kq51ETlcKhjjoznxQAQYRoQy4HjvclyI+XyBvX3IuX4q48o+oQdQar3e5syyQ scq6/rB31xQS+LOp/u3ymKIniPkYURfgbGUD3o9nTG+OPGAvD0kRNO3KNH0uZF9TeuN7 RwBB5UzFzNSN3a1ykyuq9878I/i1JgdJ1cXeBqcs7NnRuBjZGasD56vLJj8bokcLlWTC BHeg== X-Forwarded-Encrypted: i=1; AJvYcCXR73sg+0ar9XSkfsCHuLrSfjMbKrfx+HkXzxJqPKNy3+lchE7f9Eo6SIXESa9su2W8ZFhkhA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxd2QcxkMWkhuxFTYXJd8zIDj9usJ5WovVyxwYipiS1dK5wXzj+ tAeDN+YJ6je1PPEdZlzfoHKDsnThVlQjTjDLYwIn44QsKhXigXK/kn3lBnbB78R5 X-Gm-Gg: ASbGncv+v5bYhLIGDBsE9r9r9O3aZ/vhgCsq5Z7IzvV6bE5i27no7xfLfVmQ1NJs9ZU zzfX5tB9WvEkhoA0Vxn422AHrKBA7apxGenwq1392nN1wBJycncyIs8IH/GI67CefrVMAXzqtlo wKmsL0dsVFtuPayFL8J1AkacR2FJbk6lNXwu0yky7SR9m5d3Rvr1skyNpCP0X8NCM3gm6ro1N6j cXo8bdDjGXGmwthaAOgSnvWQ1MAe3SA0XrPLWZneXq+QR8EJk0Ea73UiGxtSfgJh5lGqwB8vR8i Aj7EfLgj/mRdkdr8MI4wxOcQqRs8mpC19Ck1SU6NCotg+CpA4xws9F2y9+10UV1wAuFnWeXhKkL 2j0KyS4OjCHZ3LkEG+7VHHmzvG6/SssgIQkZQhnNb6UWx1yYKjeAXEXWM/IfR2gwxZnedR4CBXg LElAWCSWqS36n5hShRtZcAD6Dl X-Google-Smtp-Source: AGHT+IHR17qo3Ktv6PRT50v3QqR876oh4FR2iDOWhCYeZ8xj/M4G5K+5eSwMwHeQYnNG/FAUWGCEGQ== X-Received: by 2002:a05:6000:40e0:b0:3a3:6e85:a529 with SMTP id ffacd0b85a97d-3b9fc2f7e46mr1965462f8f.51.1755169502255; Thu, 14 Aug 2025 04:05:02 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c6c324fsm16897275e9.1.2025.08.14.04.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 04:05:01 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Alan Mackenzie Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 13:05:00 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , =?utf-8?Q?=C3=93scar?= Fuentes , monnier@iro.umontreal.ca, 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 07:25:56 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 11:25:56 +0000 Received: from localhost ([127.0.0.1]:32994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umW5j-000174-Lr for submit@debbugs.gnu.org; Thu, 14 Aug 2025 07:25:56 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:50534) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umW5c-00016h-Bg for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 07:25:52 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-45a1b04f8b5so4052245e9.1 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 04:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755170741; x=1755775541; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0Nu1pHiGXO9xWNOAQhSo8o1PQdZ+9VGMIB+rYIHVFqk=; b=hK1M3PgYGoZiYJtW+TSApPgJ5kWRyYnU6KijijR5fNt6rQOlSzZSaw3sKQyFbzm/IB l8nfAgG0MN5jJ+qfVReqB62TGN8AxG7kAJK6zTO2hMxfShAbgNHfArwoO5oRFc4ZquFE aoKit9cFUbHhpdETmVKfMy5/s9vMXPqykI4QSiaejZVNqRAvsmZyZbCYtjT8/C+WN3q+ fFpJvoq4NNoAEU6OIqBLL2FmoAmYQTwAazEDfExBkcJquL3Ek4UHkbQ4MEOL+W5o3p30 ZBtDaFzP520ecuXTOGfYmZFKnd9f6uKbhlZK4c2VWdomtfmT7O4NbFLewhLpmhQqJK2y FQ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755170741; x=1755775541; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0Nu1pHiGXO9xWNOAQhSo8o1PQdZ+9VGMIB+rYIHVFqk=; b=ZdQEJLO6PVB7IINd/0/35XxHF+XaZyJtP7+GW4ES7Fy0sXViXd41zHnYJK04djIrbv Rh131Hiz3P/k1uYEjgigngMHAwmIPCkGR5L63eHxVbg5EWDlqMlHJdjYlqVW+BDzbiPv Akcp9slICWjsCUzzrw9uSqvls/Ykt9S/Omz6+uVJANZ4w2Cu3OA3I5gn/0HSLBchzB2H 3dW2NTcWGxim+kZN+bpHWyHkKhdgjPmbxM/d+jB4Fy5h6sBlWnTu0QCPc2nsjVPHbmbn zYo4a+jM92zdi7aYMAiXPJlH3F98V4aVsFwgz+ezv2+1xSQnm2Qgi7PnFbJrzJGQvNZe ZNeA== X-Forwarded-Encrypted: i=1; AJvYcCX+th9QSxSp2Fi3Vj0d9pmsLL77ZV2EAxq9c66Va3+3DL7NJrrg4XxbmapvA2+1HVbxmo57DQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwBRAnUlC+n1Kv81IufG0fgwY0BYl6EEywWes0+z86yj47OCHrd cwZ14tdE6+R42s8bzKn9gEM9rj1sqcP3dUN1ODaNamhFe1pDTcC4fG/YfGOod3W+ X-Gm-Gg: ASbGncsWvO1TAcIaL8u95OvkkVYQ0xMTBOHMleS3fg7UJZShlSwyeHVRmlbgsOBnN/7 2kSX9dUUyUmg9SbiVJ7Kz69bWpD7/eEVEoZi2C18kzfdwXmKroR8qM8kS86IDtzA4nSazyFImVh j5/GRXlsi9f6hg5fy1esJ1ZH6BAxkqdoqFSx+A4AeR0A0v/pLh57Nkfm8w6mWbcthwcUi9W6KlU OfL8AubOFx13RmAbkK6BQpkBZmgbxCI5zo1cRIq9ztaPb9zwFbQrpD/KsaHiimuQiTnE4zbkwNO e8ofvEUuluRgGakOH61RoeEfsHGIbM0kCBAPY1oWDn4guxVFF00Lb79Vs0SVSIkbEedGlu6/EtP perPFyJTWx9HTFi4ROdStrp30VNe9ol7GDACqB95WYeWLUr+CtA6Bwb3vzflf2DqstUbrZ8DeqI 8ntmwfO84vIptifrQty9086/2G X-Google-Smtp-Source: AGHT+IE/EVYox7iiI4fkQn5F5dfHWb9E81t56WilpjNikhBpUQBilEQ4pMIKHUgu/X+Cwv3/MgDlxA== X-Received: by 2002:a05:600c:6287:b0:459:d3d0:6507 with SMTP id 5b1f17b1804b1-45a1b668f87mr20208445e9.32.1755170740876; Thu, 14 Aug 2025 04:25:40 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c6ce764sm17989225e9.10.2025.08.14.04.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 04:25:40 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 13:25:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > Alan Mackenzie 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-compa= cted) > '(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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-variable-undo-group-limit.patch >From 2f2a1ea607938dea4584aba6b0823aab36493fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Thu, 14 Aug 2025 13:17:06 +0200 Subject: [PATCH] New variable undo-group-limit * src/undo.c (truncate_undo_list): Use undo_group_limit. (syms_of_undo): Add DEFVAR_INT. --- src/undo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/undo.c b/src/undo.c index 8702d937ed5..6046b769d4d 100644 --- a/src/undo.c +++ b/src/undo.c @@ -376,6 +376,7 @@ truncate_undo_list (struct buffer *b) last_boundary = prev; /* Keep additional undo data, if it fits in the limits. */ + ptrdiff_t ngroups = 0; while (CONSP (next)) { Lisp_Object elt; @@ -387,6 +388,8 @@ truncate_undo_list (struct buffer *b) the higher threshold undo_strong_limit, we truncate before it. */ if (NILP (elt)) { + if (++ngroups > undo_group_limit) + break; if (size_so_far > undo_strong_limit) break; last_boundary = prev; @@ -461,6 +464,9 @@ syms_of_undo (void) which includes both saved text and other data. */); undo_strong_limit = 240000; + DEFVAR_INT ("undo-group-limit", undo_group_limit, doc: /* */); + undo_group_limit = 200; + DEFVAR_LISP ("undo-outer-limit", Vundo_outer_limit, doc: /* Outer limit on size of undo information for one command. At garbage collection time, if the current command has produced -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 09:49:55 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 13:49:55 +0000 Received: from localhost ([127.0.0.1]:33204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umYL5-0002bK-C8 for submit@debbugs.gnu.org; Thu, 14 Aug 2025 09:49:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62568) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umYL1-0002b2-NU for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 09:49:52 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A3792100374; Thu, 14 Aug 2025 09:49:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1755179383; bh=pFDBJfo94d9KX1w3rX78DcUuVD79kgP/0u0ZEUfTt3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kKWYiUvQ5khwUcdcP+s0KI4nYt5Nau9vcRtqTFRnyXt9vhOphMDg1+VUmDfsI9OTi MeD51lFrbihdqosvo7Yn7K5AYe8EKdzqjLxU2D6cPNdR2kwFH2q5VM2X+JytYle/L2 HwHcvnFgxm8LeVtuPYfkQP0EdDeVEhAWQH+eHy20MmeGeYVCG/5cZEuVDFjTT+ckXc d7bhogKUyC+M19ym4FNN/zcuzrNwhmgxt44E2B46BterGllEZICQYLh3IzJcyeFmL8 FmG+X9Y2frfEdp2a6ayPMuZwMDIlbMY/TsCxzoYMYijH6/wzXVykDcDt7JaUm+1M1G 0L6gKLzKA4svw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A3B6710013E; Thu, 14 Aug 2025 09:49:43 -0400 (EDT) Received: from asado (eduroam-262-2-186.epfl.ch [192.33.206.186]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0ABDA1201B2; Thu, 14 Aug 2025 09:49:42 -0400 (EDT) From: Stefan Monnier To: 79200@debbugs.gnu.org Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# Message-ID: References: <87h5yhu5ko.fsf@telefonica.net> Date: Thu, 14 Aug 2025 09:49:40 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.200 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79200 Cc: =?windows-1252?Q?=D3scar?= Fuentes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Taking a step back: We may want to rethink whether storing that undo information is worth the trouble at all. It's hard to know for sure, but we do have one data point: in Emacs-28, overlays' end-points used those marker-offset undo elements to better preserve overlays' end-points across undo, whereas this was lost with emacs-29's new overlays. AFAIK nobody noticed/complained. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 10:14:38 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 14:14:38 +0000 Received: from localhost ([127.0.0.1]:34029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umYiz-00043w-OJ for submit@debbugs.gnu.org; Thu, 14 Aug 2025 10:14:38 -0400 Received: from mail.eclipso.de ([217.69.254.104]:56122) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umYis-00043S-Va for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 10:14:33 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1755180863; bh=g0alPtDByGs91l9Q1pWGwBk5mZhEC+6ZiSmlDqvlUZU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ROLG5+mxtXYF6Uium7wAU8rc/J5iL8NdRoyjoBciZFnpeKVaOOLCZJipMm/kIGOMz fj5Co6qfEl5iVFWwWK3f9DKaANwXfdH30fgEW1RWcvtxHzzTihgnTsf+PKHUggL8KI acK+xHFVCf01beJTOs8xTHB6wbo0bS3retq9McXqd+mEzQWXjccmOFtrw15B8lF1mH mjm5RBRhuOvqUpW/wgZXRxDkCSXbvBkSdQgk6xKM5eQ/qKxQ0MUmf/eglV/YjDbATg lZ2CmqrHLTywndYDoy//41kPd2/QFKbM9vG0PgMe3r5a40Vs7kDsjJRJEUawrU87xP 2zBQsVknv20pQ== To: Stefan Monnier Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87h5yhu5ko.fsf@telefonica.net> Date: Thu, 14 Aug 2025 16:14:22 +0200 Message-ID: <87bjoiq9c1.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: 79200@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Monnier writes: > Taking a step back: > > We may want to rethink whether storing that undo information is worth > the trouble at all. It's hard to know for sure, but we do have one data > point: in Emacs-28, overlays' end-points used those marker-offset undo > elements to better preserve overlays' end-points across undo, whereas > this was lost with emacs-29's new overlays. > > AFAIK nobody noticed/complained. Here I'm working with an idle timer that simply removes those marker elements every few seconds. Five days of intensive use and Emacs behaves normally from my POV. Maybe my usage is too restrictive, dunno (I never use undo-in-region, for instance.) OTOH, Emacs is using much less memory than usual (rigth now at 1.1 GB when 2.5 was normal.) From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 10:22:39 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 14:22:39 +0000 Received: from localhost ([127.0.0.1]:34040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umYqk-0004UZ-KB for submit@debbugs.gnu.org; Thu, 14 Aug 2025 10:22:38 -0400 Received: from mail.eclipso.de ([217.69.254.104]:51232) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umYqf-0004UD-O0 for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 10:22:35 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1755181346; bh=wFi42Hpu8pJSyIcAHN5Ok/YPPnQIYvLn+9dNYy98ZtU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Hisqw8UGcIClPCAPh/coWhLiGnjjTPF9xPViffu3QicziSeBQaMPzBxfD6i3w1Gnk oboVPG89qqnY+/siHseHCL4JMLeK6QlSaBOtnFotDnt2XOCh84lRSQZq3WRzM3diI1 U+CCnHUN98eyhHSJwhB2MSDCr5RaDTyGlnizPLrN0vcHo8/m/LyTlBAWRTF0k7baZ7 JGV45QtFD9BXuId7SNrU4c0q+AURPwXSzaNpD4iA5QtctRX9cUuayAwVsoMpFnvJob Z37L6SqHAARQHeg8qn3qAqqHm3hPzoSxjiRDx8VwOdBNKQR7MKM6rof1oZoh4cXYFK OM+JWiWOWq6Sw== To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> Date: Thu, 14 Aug 2025 16:22:24 +0200 Message-ID: <877bz6q8yn.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: Hi Gerd. >> 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. Is this really addresset at me? Do you want me to try your patch? This patch alone or on top of the previous ones? Your discussion with Alan is way beyond my knowledge, but if the patch just keeps the list under a certain length, as it seems, I don't see how it can be a fix, as AFAIK the problem consists on the size of the new undo info increasing as a function of the size of the previous one, so at some point recording a new undo just overflows the capacity. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 11:04:03 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 15:04:03 +0000 Received: from localhost ([127.0.0.1]:34096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umZUo-0006WV-On for submit@debbugs.gnu.org; Thu, 14 Aug 2025 11:04:03 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:48519) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umZUl-0006Vw-1u for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 11:04:00 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3b9dc5c6521so566955f8f.1 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 08:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755183832; x=1755788632; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PWv4qvaLbGGzLlfxpZ9JDnghT/ggse9h4RdCMQPMeP4=; b=OdEOXnFEN7ODnFk1+7wWFq3H4Zm1apZSVgHlrPmQqKflQpFzEFRh+N5Mq9+b6qfN6f ZkubMjFaywjxRU8BBoSj8ML2ACoE5QGudUS5izGI8Ri9vBn0m5V4o9M8boxAILlrt0P9 J4o52peUCwfanlgnRBnTORn2Jqyrgejri0g8HujbkjhhlSprZXa1qStBkKtriZ725dcg Apg0eXOiq4OnMhDov0Rg2rxIfSTLbG1bUr1WFEKHPnfS8RRf0uJCD6Om9VdTDPpCs2EK QEUe+kC/KgvtzPnSK63FChPk56XZhDRAnvn1kHGNGrOZqdnyLIFNqYPclOm4PDIdieji GMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755183832; x=1755788632; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PWv4qvaLbGGzLlfxpZ9JDnghT/ggse9h4RdCMQPMeP4=; b=ijKSKRYOuRgw2DndxD+Pj/oK4snQkEAXoZNFB4C2NMQWXYmhuMuLM6/5NcDa/U4MY0 7FP3yRSlhg7e0tUKGXwZ9TaLTO9bmNY0MExwxecfZPSqno2tP7Wlp3Ve9uOqyiUzb/gp NebjlaSDfmfxy5EnVRFpZFzJospa6KojtAj6ml7570a/S1+TXHgfYQT1jVhpyBzCGC+i b8oh6YGTecoEXEom8icHxVgllVh6MK6K0KjDK7uDFH4BNzGw37FfL45h+tOSjiPEsP0f JwDmtXvE9yH4NkM22gHXnaYSPRnLjGywTISlcl6LygBP/OCB7+YO6bPxsWE/MEjwGo33 YK0A== X-Forwarded-Encrypted: i=1; AJvYcCVpzyCxKuajH3oNe0ZFoyF4GD6TkqWsp4hrY4wVJ0/ouIUJAO2WGviCqP0W+pcwLsHAXov5Kw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxJHSKJjatAE1CUp2rTD+mFm0ecFDhWY62yoNGMLtDWrZ+Hz8kz dnrNEkFvvcgYz/vw5qO5eRVCewH/PmEcspPH5aAW/KU7RFlDloVJPqU/EVOcwG77 X-Gm-Gg: ASbGnct7nWvxar6nQ8Np61MSmYTevchH/XKb06xe0RygUu84Y6OomWR9opgEjdmb2Lp /CAI4zpFfAhd7/09IidrkdRgRX1yW4pd5OD/Rv2QQ7q2ZeP3NcdCvOM/PHSHYNuCNar7h5DLTJQ hhcV1nASEQ/MPVhAg7NoiO5b1Od+p3HhyeaN3wx4QuTmgsP6luChCQsmA3f7WCOCYzuxGoKoJhJ m3bTyzkVl2MdQYFEc1Dzy9cRJcT3nLZJ3yXRVmVOO/WejfnPm3pIhDeuUPEpWN0xtXJoH98Eoex 4f2S/C+1fVCHbFc1gd3zeCTX01wjNZYtVIwepg6GknLISr1v6ps1obenl46IRvvEKAmMUXO23/W I4CHUxgOcxO4sDuUU28NXbl7YZgvuSngHJTSAgOm/hDOaoT2g5glTEJZdZmHVIq8kAdEacAgEri K4vDC/EVciJQnzirV1fyDJ1WA1VcMIqOr1s4I= X-Google-Smtp-Source: AGHT+IFIkHenMkKls66gw7bAnIHPAdirJ+3nEWRpPmAmrW5XdP8Nt0Gp5gNp8AWN0KOOHiGYdcqAjg== X-Received: by 2002:adf:e808:0:b0:3b9:10c5:bd7d with SMTP id ffacd0b85a97d-3b9edf9089bmr2875489f8f.10.1755183831341; Thu, 14 Aug 2025 08:03:51 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a1c6c1148sm23745525e9.4.2025.08.14.08.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 08:03:50 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> <877bz6q8yn.fsf@telefonica.net> Date: Thu, 14 Aug 2025 17:03:49 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > > Hi Gerd. > >>> 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. > > Is this really addresset at me?=20 Yes please, that would be very nice, because you seem to do something in the real world that produces the problem with markers+igc, while I apparently don't encounter that normally. > Do you want me to try your patch? This patch alone or on top of the > previous ones? On top of the original feature/igc with no other changes. The maximum depth of undo is then 200, which is an arbitrary number. > Your discussion with Alan is way beyond my knowledge, but if the patch > just keeps the list under a certain length, as it seems, I don't see how > it can be a fix, as AFAIK the problem consists on the size of the new > undo info increasing as a function of the size of the previous one, so > at some point recording a new undo just overflows the capacity. Let me try to explain what I'm seeing, conjecturing, have learned etc.: The whole problem occurs because we have lots and lots of marker-adjustment records in undo lists. The old GC gets rid of them by cleaning them up during GC, That's compact_undo_list. IGC can't do that in the same way because it's completely different, so the marker entries basically pile up and up and up. Secondly, we have undo-limit and undo-strong-limit which is fine, but we don't have something that limits the number of possible undos themselves. As long as the size limits aren't reaches, undo lists happily grow into the thousands of undo-boundaries, i.e. individually undoable operations. So much that I think it makes no sense any more. No one would do 1000 undos. That's why I think limiting that to some number makes sense. I'm using 100 in my Emacs ATM. That is the change in truncate_undo_list. Thirdly, by discarding undo entries after the nth undo-boundary, we of course reduce the marker-adjustment entries which are part of text entries of the discarded list elements. This should reduce the whole problem to something that's fine, at least my gut feeling is that it does. And fourth, igc already calls compact_buffer, which calls truncate_undo_list in igc_on_Idle. That's why this should work in the end. And fifth, if that is "good enough" in the real world it is of course much less complex and whatnot than everything else. Something like that. Hope it's more or less understandable. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 12:57:53 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 16:57:53 +0000 Received: from localhost ([127.0.0.1]:34388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umbGy-0004Bl-KV for submit@debbugs.gnu.org; Thu, 14 Aug 2025 12:57:53 -0400 Received: from mail.eclipso.de ([217.69.254.104]:41362) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umbGt-0004BG-Ju for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 12:57:49 -0400 X-ESMTP-Authenticated-User: 000D6BEA From: =?utf-8?Q?=C3=93scar_Fuentes?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclipso.de; s=mail; t=1755190660; bh=GOwd4mANNq87m3feIVNi0JdcH9o0TMctXWCbOFhI3OI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Nxlyr+VEfV94kHre7tTRJJeMVOgPqgXNWzoP9iejUhsU1rAEDV7KfQxF+LLnKLhCy w8gX/mMkGwWBmR+aUgkBlcm4MZkkfCN5216nqIr521AdeaZl2PMibAQ8vV/+WgNavl LkvBhuq7c3agfdUr39y9X8+2c5WG7qwTJAjuCJtQ37X4XEs4acdlkqDB9kg6f4ZtgJ /3yf/zs0mxJnvZyeyoBN+IdjXFgyeHyo4AgAeOKgvmNS8dzCWvLriTwA0z7iT0Vaok 2Ls+DZnyjqWqHqIb0FU5wPjrL3fftMTlG0CkMDpzGFvkBsFnvDumlyB8Q0V5cQmKtC ls2NqD6tGbXGg== To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> <877bz6q8yn.fsf@telefonica.net> Date: Thu, 14 Aug 2025 18:57:39 +0200 Message-ID: <87frdt6dto.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Gerd M=C3=B6llmann writes: * src/undo.c (truncate_undo_list): Use undo_group_limit. (syms_of_undo): Add DEFVAR_INT. [snip] Thank you for the detailed explanation. I'm running it now on one of the two machines that I use daily. Apart from reporting obvious problems, do you want other info that requires inspecting buffer-undo-list or anything else from time to time? BTW, saying "No one would do 1000 undos" sounds very sensible. But on some circunstances I've seen how almost every character produced an undo boundary (time ago with Evil, now it seems better.) Also, some packages allow you to navigate the undo history on a way that is easy to restore the state of the buffer when its content's met certain criteria, like some text was added or removed, which could happened long time ago on the session. Having a limit of 200 (or 2000) undo steps may be constraining for the users of those packages. Also, it would be interesting to see how much memory the average undo step consumes (without the pathological marker adjustment elements.) That way we could know if your change is significantly reducing the amount of undo info that Emacs traditionally stored. While writing this e-mail the associated buffer-undo-list grew to 6000+ elements, almost all of them marker adjustments. Executing igc-collect made no difference, but IIUC this is expected, the effects of your patch should begin after exceeding undo-group-limit. While writing English prose I make *lots* of corrections, maybe that's one of the main reasons why the problem affects me on a larger way. Just before finishing this e-mail, buffer-undo-list went down to 3000+ elements, almost all of them markers. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 13:53:03 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 17:53:03 +0000 Received: from localhost ([127.0.0.1]:34493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umc8M-00072x-SY for submit@debbugs.gnu.org; Thu, 14 Aug 2025 13:53:03 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44410) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umc8H-00072I-Dr for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 13:52:59 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3b9e411c820so680198f8f.1 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 10:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755193970; x=1755798770; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eCeCa8hrUgR2Ey+OZtjUv2KHpFQiJG4kpyh8xfN/ujw=; b=dgxXMXxLTcbwT8oaxJRfTyTSUNCeXjne0vzOfZlamEqgjgeBc0PYEoyIxBPxioGLEP kuKisT4fRV7yfmvca/QQN6G70H0pwySOX+mo0PqyylB0Wl6XDmKpZsNxE1cuQlpW/Cid a9lw1MGfnsnIbasJb5lPEz+6KD7XlVQwsHtInGom28/PzVJONk7HWzgUfAUkVbY4r60V xWZnQtpSWIGAKyQe5ICv/upUX+ok/npJ07Tu1SJrIpXo7r1xxfJm83xUZcV09TPsu94K JMHMgdGkjaHfJXKwS/ZLun8j7xDdrHE5p3XEi4SjjHLRfva5LZCs3VIHxFj0UPf5fKLs XMQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755193970; x=1755798770; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eCeCa8hrUgR2Ey+OZtjUv2KHpFQiJG4kpyh8xfN/ujw=; b=qP6mTUo2DDo2Ybsj/82xjXSFQ/W2WiE9Jfgm24qoyl3urfsqLSBtKCvBuThVQro0HL uq7RPwWGfRAx13iaoYVj2l37eFrNwiNhCGzE0ubZYafPRdYPB1w1+zMOSpBR7/69MAIi gc99D7vqQhA7NFicl2M5C/rMXwv+XxyabUDAYPErky8e/IWd0+ox5g7rhlCbdFTOP48K Tcm+hK94uNsany66McQk+VXzvRWXmkHHTo4Qh7gLwX0vqm2A9wlBtnO/1J+76XR7AZBi Qxe9FXZnvDDpgBzCP7dyl7IUNlZ8ku7WuXid67ufyZfNoaro5WxJ94OyAw5a2En8OVJH mSOQ== X-Forwarded-Encrypted: i=1; AJvYcCWoAc978RK9m+qcZQZqXwIzgiDeV0JZSv9uXowlkn6xhpTcKwYlYQRUlBvyUmky2xSRSQme1A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy4KnhTylbjtC4i5mMwtehkbjkCpXFlrIw82oOsV/iq7mqA+nqB YXDJq0wkQwYctQhDH1MrbhMMug8/QHY995qJpTs/dsZL30sSnvbT7TBQBEZmBQqn X-Gm-Gg: ASbGncu+tqTgxOUpNKdHJSa9lWS6W9S1a+iUFEuPq4GMYlWaIlqQRdoa1+uCKeJCE5G YQ0IlUp9ttXOi7XDfvV3QAn+BrINz7IES6g00pXA8VyeotTWl2MI3ZMLmQ4QcYRBXZx1E80Q4OH 2k8OCjQFeC0fBxuSqg+z5Pwjf3Kl+2TLCyipGL+SU/E5STH3HBIIl+TdRSJZMwzigDwx+2n21jL 5w6V9vk6twm9+B817orUjHA5FnliZ/eW8jufxgd0MZ0p6QbZMMJjG9lAkYi9MWQ5jbrPAx37ZUW 6xlqSDEGsN2B5NWQCl8/w/k6kimIDgfkMZT2+sXKuTmefYOsKugOjjX34pthD/KlNtiBf8//ak2 QUPUywXCQlt5OPIAdbebBwy93NbOMHfAMyqa8dvfy+wmv6NFjIgQM3IN4uV2g6+0UZT79eVqWv5 w3Uv11HbXXy6ZqAVLk7/DqgHB6 X-Google-Smtp-Source: AGHT+IEzprrfu5kw438BajLQgL0pdWRYpfCJ6EOfg7/Iqly3o8grvCsCEwLfYON5tJ3/SZDHnt/vIw== X-Received: by 2002:a5d:64c8:0:b0:3b8:d08c:cde5 with SMTP id ffacd0b85a97d-3ba50d6bd33mr2919615f8f.43.1755193970225; Thu, 14 Aug 2025 10:52:50 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b8e1cb7deesm41832787f8f.2.2025.08.14.10.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 10:52:49 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> <877bz6q8yn.fsf@telefonica.net> <87frdt6dto.fsf@telefonica.net> Date: Thu, 14 Aug 2025 19:52:48 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > Gerd M=C3=B6llmann writes: > > * src/undo.c (truncate_undo_list): Use undo_group_limit. > (syms_of_undo): Add DEFVAR_INT. > > [snip] > > Thank you for the detailed explanation. I'm running it now on one of the > two machines that I use daily.=20 Thanks! > Apart from reporting obvious problems, do you want other info that > requires inspecting buffer-undo-list or anything else from time to > time? Can't think of something specific at the moment. For me, a general impression of how it is doing with the undo-group-limit would suffice. > BTW, saying "No one would do 1000 undos" sounds very sensible. But on > some circunstances I've seen how almost every character produced an undo > boundary (time ago with Evil, now it seems better.) Also, some packages > allow you to navigate the undo history on a way that is easy to restore > the state of the buffer when its content's met certain criteria, like > some text was added or removed, which could happened long time ago on > the session. Having a limit of 200 (or 2000) undo steps may be > constraining for the users of those packages.=20 I guess you are thinking of vundo for example. I tried it once and it was nice, but since I never used it after installation, I removed it again. YMMV. And they could set the value to something higher. Don't know if they require a lot of undos. For vundo, it seems it needed only few because it displayed the states as graphical nodes and so on. And there is only limited space for that. But I can't really say much about that. > Also, it would be interesting to see how much memory the average undo > step consumes (without the pathological marker adjustment elements.) > That way we could know if your change is significantly reducing the > amount of undo info that Emacs traditionally stored. Hm. > While writing this e-mail the associated buffer-undo-list grew to 6000+ > elements, almost all of them marker adjustments. Executing igc-collect > made no difference, but IIUC this is expected, the effects of your patch > should begin after exceeding undo-group-limit.=20 Right. The groups would be the nil list elements if I'm not mistaken. > While writing English prose I make *lots* of corrections, maybe that's > one of the main reasons why the problem affects me on a larger way. > Could be something like that. Or ispell maybe? > Just before finishing this e-mail, buffer-undo-list went down to 3000+ > elements, almost all of them markers. That sounds promising =F0=9F=91=8D From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 14 13:57:52 2025 Received: (at 79200) by debbugs.gnu.org; 14 Aug 2025 17:57:52 +0000 Received: from localhost ([127.0.0.1]:34504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umcD1-0007HY-RJ for submit@debbugs.gnu.org; Thu, 14 Aug 2025 13:57:52 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:51417) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1umcCx-0007H9-UR for 79200@debbugs.gnu.org; Thu, 14 Aug 2025 13:57:48 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-45a1b097037so6976855e9.2 for <79200@debbugs.gnu.org>; Thu, 14 Aug 2025 10:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755194260; x=1755799060; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wTMzc6AtwjcUzJHA1IRlSTsttU0WWnbwfZMSqke/3ZI=; b=RtjtU+AfsN8+xKxQZFwbyK44sIWO9OGaPAPzeymlEBMNXbRUZp1ANjgeCRII63G7LI bVh4nbmpvImnm1kMkUI885J5HZZl98Z8w8ZspAQj4BhJT8axROjdY9mX+NNLX5cH/QdA xrLB2biZ1X4Rr04rT9irRHk1VKxE0HyfxpbRKbmqak99zQYMu0d40hSzU1xZHenao8yn 0tkcRcoo/ELXWnHEqBaOoAZ4xLpCpq+J9PQvicvT/CBSoaLh5FDHb99GkZ1TESBSed3d sRlo4r7aEQd0SlmJRgAOurSoCzNUrNH8EiWw79PFd8yx5lTk95/jWibGVEobtUGBjcSD giyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755194260; x=1755799060; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wTMzc6AtwjcUzJHA1IRlSTsttU0WWnbwfZMSqke/3ZI=; b=LxxZO/5Jt3j6VOKETRUMbvZTRZ4rb0Dl6sOlEdf72n7KO9ElUALdp1PnZHM4H/anrJ erOc0Y2Zcoydnb7YjMdT8nukKrwS3WJAKu+dQTCnxqqmZEHRQvvYpNpL3AqWLgRYR1TL 8IUNrLyxTqRj/keeHu9ho7hztZiQbGRTn9c4FSo5k7+WqW3/Z9JOyceMzUs5J9DKm6Qc RNmRaflKlbBGemVaLL2/6MJTK0BbGlRZ7ZPOGj2L9KEzTas/6h+E3IqVmCvEAoozUKAg Dzg2QjdZWBCZ+/dA/bmjq8OGak1XY29UXfNuIKmdKhs9ZEGdkaVlSM1qkXQRdJD8L85Y 9iSw== X-Forwarded-Encrypted: i=1; AJvYcCVyzq+lJu4Y/GvinKq0FW9CyYz/r1yXVNC8N2I35QPTJgMQx4Fti1U5CVEHEbRu9LikKeNCGg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz0Q/dW+TWMjve+rJQx/tCbgKp3/dDGAOMx95d61ZneVD/ybEFk 3f/LlsTE7lL0WRU4w7EIw+S1CXiUSO/DpHPGy8M/c37+py5xetiiuSTTM2dzvjmA X-Gm-Gg: ASbGnct9UcPPkOuMGxrFJTgPa6kW6eENCqWE3peVfqnQM34E6LIixvHRHh/wZp6TF+m SoFdqUHNC9vha1sbGgxI1aiZwFwSuIYcffLtTGqphNF/cakY6pg4yJiYmhjSITzu17NACtnwuxR yT2n7tDfoTdedDXUoqJkFId5H5lQ0ejcZEpBhRhM5jQeauODDLHUhAb4CzZyzK9tNGS2KsKTrFW kxZe6Lrbi+zRb0mddDKZN5rxvCh4VJgW1o83v4uCx0cea7lU34leODC7OXGhlbO50UZqY/M9FXP mJ9px3zUz2K852tQxbixOy3qaXEhs/AbuRM4SAcAOXDhgN9+/EqmnqVn0geo8YXz0sC059HQGuO Gvp/m4a71UNDZOrrATCtHU6wZu/VbkvGlM70VrmMYYH7MDV5XDxp8dIDNxKMvuVhuUUjE4pwEbj NJ67W6ws/Ovodf0f73KoaCxFHeCo97rolxUTg= X-Google-Smtp-Source: AGHT+IHZ2+pq6g0CAJLxjt3j5891MdjYxjb7PYpWhnA/O+mVAIhcUmvoE3OIEn4GyvMQji7UJxz4MA== X-Received: by 2002:a05:6000:2503:b0:3a6:d349:1b52 with SMTP id ffacd0b85a97d-3b9edf1cf68mr3406403f8f.21.1755194260402; Thu, 14 Aug 2025 10:57:40 -0700 (PDT) Received: from pro2 (p200300e0b7120f00dc019de171ee68a4.dip0.t-ipconnect.de. [2003:e0:b712:f00:dc01:9de1:71ee:68a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53633021f8f.40.2025.08.14.10.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 10:57:39 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: =?utf-8?Q?=C3=93scar?= Fuentes Subject: Re: bug#79200: 31.0.50; Duplicated elements for '# References: <87pld0wn05.fsf@gmail.com> <877bz6q8yn.fsf@telefonica.net> <87frdt6dto.fsf@telefonica.net> Date: Thu, 14 Aug 2025 19:57:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79200 Cc: pipcet@protonmail.com, Helmut Eller , monnier@iro.umontreal.ca, Alan Mackenzie , 79200@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C3=93scar Fuentes writes: > While writing this e-mail the associated buffer-undo-list grew to 6000+ > elements, almost all of them marker adjustments. Executing igc-collect > made no difference, but IIUC this is expected,=20 And again forgotten something, as usual :-/. Yes that's expected without the other patches. I'd go with without these patches though if the simple solution sufifcces, at least in my Emacs, feature/igc is another story.