GNU bug report logs - #64989
29.1; Comment or uncomment lines in elisp-mode will show message in minibuffer

Previous Next

Package: emacs;

Reported by: Eason Huang <aqua0210 <at> foxmail.com>

Date: Tue, 1 Aug 2023 11:15:01 UTC

Severity: normal

Merged with 65246

Found in version 29.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Eason Huang <aqua0210 <at> foxmail.com>, 64989 <at> debbugs.gnu.org
Subject: bug#64989: 29.1; Comment or uncomment lines in elisp-mode will show message in minibuffer
Date: Sat, 26 Aug 2023 11:09:21 -0400
>> When update to the new released Emacs 29.1, I found that when comment or
>> uncomment lines in emacs-lisp-mode will show message in minibuffer as
>> below:
>> ```
>> combine-change-calls: buffer-undo-list broken
>> ```
>> Steps to reproduce:
>> 1. create a test.el file with any Elisp code. such as:
>> ```
>> (message "Test")
>> ```
>> 2. start emacs and open the test.el file with `emacs -Q ~/test.el`
>> 3. Use C-x C-; (comment-line) to comment the code in test.el
>> 4. Now you will see the message mentioned above.
>
> Thanks.
>
> Stefan, I think this is due to the commit below:

Yup.  The message is just wrong in this case: (cdr ptr) is nil simply
because `buffer-undo-list` was nil initially, not because the
`buffer-undo-list` has been shortened by the GC.

> If indeed this is the culprit, can we perhaps backport the "better
> fix" from master to the emacs-29 branch?

That would work as well.  The patch below should do the trick, tho, if
you prefer to keep changes to a minimum.


        Stefan


diff --git a/lisp/subr.el b/lisp/subr.el
index 28473f1d38c..ec30637b526 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -5002,7 +5002,7 @@ combine-change-calls-1
 			;; Don't include a timestamp entry.
 			(setcdr ptr (cddr ptr))
 		      (setq ptr (cdr ptr))))
-		  (unless (cdr ptr)
+		  (unless (or (cdr ptr) (null old-bul))
 		    (message "combine-change-calls: buffer-undo-list broken"))
 		  (setcdr ptr nil)
 		  (push ap-elt buffer-undo-list)





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

Previous Next


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