From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83leeu292j.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eason Huang , 64989@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 26 17:10:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZuvk-0000yV-SW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Aug 2023 17:10:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZuvG-0001vj-C6; Sat, 26 Aug 2023 11:09:58 -0400 Original-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 1qZuvF-0001vb-HD for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 11:09:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZuvF-0005X8-9B for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 11:09:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZuvK-0001g0-Fj for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 11:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Aug 2023 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64989 X-GNU-PR-Package: emacs Original-Received: via spool by 64989-submit@debbugs.gnu.org id=B64989.16930625796402 (code B ref 64989); Sat, 26 Aug 2023 15:10:02 +0000 Original-Received: (at 64989) by debbugs.gnu.org; 26 Aug 2023 15:09:39 +0000 Original-Received: from localhost ([127.0.0.1]:43307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZuux-0001fB-3F for submit@debbugs.gnu.org; Sat, 26 Aug 2023 11:09:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZuur-0001er-SF for 64989@debbugs.gnu.org; Sat, 26 Aug 2023 11:09:37 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 41B1080250; Sat, 26 Aug 2023 11:09:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693062562; bh=Lv7ZtGyylwRm0MhHKUSiZofIUUE/UAZgPIZSSw+i31M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OOAV9yCinav5C6de7iSKkcxk2HXavMeEO1UbedTGP2lLsuEFk+vLqN/gud0jVsbgf bECQ91rDMAZkNwsH0wgF71Lgvz79M0BHlgavA9JN7uLoo90jVkZtm6VnvvIzBfXIfV jgUuR3Tf7M/byKbqNQwEWMJWNqHl0v7myRDzqMq4j2sIO+KtauoynHRzULwGTxXzl5 FeA4KMiuQ4APA818v9OxEqcNxgN7RyWoPP9Mqnn8LbTyxci2RMt/+4ewpsPuAlf105 MxLMBKblQ6la6ujt6Nr0NuIqWBMaf/7vNNU5F+xryReHq5wbF0tvMMxfiQB9aovyfB IzT7q2nZz/4ag== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 037F3803D3; Sat, 26 Aug 2023 11:09:22 -0400 (EDT) Original-Received: from pastel (unknown [108.175.234.188]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C9FB01201FC; Sat, 26 Aug 2023 11:09:21 -0400 (EDT) In-Reply-To: <83leeu292j.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Aug 2023 16:20:20 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268512 Archived-At: >> 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)