GNU bug report logs - #60467
30.0.50; primitive-undo: Changes to be undone by function different from announced

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 1 Jan 2023 13:40:01 UTC

Severity: normal

Found in version 30.0.50

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


Message #50 received at 60467 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 60467 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>,
 Ihor Radchenko <yantar92 <at> posteo.net>
Subject: Re: bug#60467: 30.0.50; primitive-undo: Changes to be undone by
 function different from announced
Date: Tue, 03 Jan 2023 11:32:13 -0500
> With that patch, the "combine-change-calls: buffer-undo-list broken" message
> would be displayed with the recipe of this bug report.

IIUC this is a separate issue which is fairly easy to fix (and doesn't
need to be fixed on `emacs-29`) with something like the patch below.

> And timestamp entries would be added to what is "body-undo-list" in my
> patch. It's not clear to me that this could cause problems, but
> I guess it's safer to not include them, given that they were never
> included,

AFAICT when they were not included, they resulted in a broken undo
entry (as evidenced by the current bug report), so anything we do in
their presence is "safer" than what we did before :-)

Let's wait to see what Alan has to say,


        Stefan


diff --git a/lisp/subr.el b/lisp/subr.el
index 5fb150994ec..ff3a7c403d0 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4970,15 +4970,16 @@ combine-change-calls-1
 		(progn
 		  (while (and (not (eq (cdr ptr) old-bul))
 			      ;; In case garbage collection has removed OLD-BUL.
-			      (cdr ptr)
+			      (or (cdr ptr)
+			          (progn
+			            (message "combine-change-calls: buffer-undo-list broken")
+			            nil))
 			      ;; Don't include a timestamp entry.
 			      (not (and (consp (cdr ptr))
 					(consp (cadr ptr))
 					(eq (caadr ptr) t)
 					(setq old-bul (cdr ptr)))))
 		    (setq ptr (cdr ptr)))
-		  (unless (cdr ptr)
-		    (message "combine-change-calls: buffer-undo-list broken"))
 		  (setcdr ptr nil)
 		  (push ap-elt buffer-undo-list)
 		  (setcdr buffer-undo-list old-bul)))))





This bug report was last modified 1 year and 336 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.