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#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Date: Tue, 03 Jan 2023 11:32:13 -0500 Message-ID: References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> <9bc9c69ac282c0148962@heytings.org> <87h6x9mgdv.fsf@localhost> 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="20137"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60467@debbugs.gnu.org, Alan Mackenzie , Ihor Radchenko To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 03 17:33:19 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 1pCkE3-0004xb-8e for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Jan 2023 17:33:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCkDq-0002az-6Y; Tue, 03 Jan 2023 11:33:06 -0500 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 1pCkDn-0002Zv-Ff for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 11:33:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCkDm-0003o6-NO for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 11:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCkDm-0002NR-7Q for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 11:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jan 2023 16:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60467 X-GNU-PR-Package: emacs Original-Received: via spool by 60467-submit@debbugs.gnu.org id=B60467.16727635489091 (code B ref 60467); Tue, 03 Jan 2023 16:33:02 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 3 Jan 2023 16:32:28 +0000 Original-Received: from localhost ([127.0.0.1]:46553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCkDD-0002MY-2a for submit@debbugs.gnu.org; Tue, 03 Jan 2023 11:32:28 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCkD8-0002MH-16 for 60467@debbugs.gnu.org; Tue, 03 Jan 2023 11:32:26 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 42F19100D02; Tue, 3 Jan 2023 11:32:16 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 668D010033C; Tue, 3 Jan 2023 11:32:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1672763534; bh=u2ImZeJ2nHkYPRe4HuG0GrJtSeuirH8ZhICGN1Z2zYU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BpGVY9bjNslPuQ6GHOfPta1lTBvvlPfwvgNxXmuyz3DIsi5wrjiTYV3MAaNSIuur1 3OMsgByXxgn5M6WcRl9rQXhi3rwDCjEmeVaKNNSkFRFBz/Z7+lKIg4MhGUFYHTN5Sv NctZrpuyEq/dW4/ycGiZhH/VyQJAVNoQeEusuCZjSbU168rh8IEPGaURid4bUgCk2C WpX76PoannL9tWrj+B+iCtQsigeRFzbTTRhXtadLzGzCzI8oCnqD1fVFvjYujxBAlF HiJosueXKWKtParN2diNZtnhw7Tmax69KiKOZFpYBQuSbti+/be4AV84L7QiuATQFd ny+bTpwIdOWkg== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 063CE1201C2; Tue, 3 Jan 2023 11:32:14 -0500 (EST) In-Reply-To: (Gregory Heytings's message of "Tue, 03 Jan 2023 15:29:26 +0000") 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:252420 Archived-At: > 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)))))