From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Date: Sun, 8 Jan 2023 15:43:36 +0000 Message-ID: References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> <9bc9c69ac282c0148962@heytings.org> <87h6x9mgdv.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37153"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60467@debbugs.gnu.org, Gregory Heytings , Ihor Radchenko To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 08 16:44:38 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 1pEXqg-0009Yi-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 16:44:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEXqM-00051f-ER; Sun, 08 Jan 2023 10:44:18 -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 1pEXq7-0004zA-OJ for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 10:44:03 -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 1pEXq7-0006DG-DD for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 10:44:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEXq7-0005Ds-9T for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 10:44:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 15:44:03 +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.167319262720020 (code B ref 60467); Sun, 08 Jan 2023 15:44:03 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 8 Jan 2023 15:43:47 +0000 Original-Received: from localhost ([127.0.0.1]:34424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEXpq-0005Cq-KE for submit@debbugs.gnu.org; Sun, 08 Jan 2023 10:43:46 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]:11381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEXpp-0005CP-2E for 60467@debbugs.gnu.org; Sun, 08 Jan 2023 10:43:45 -0500 Original-Received: (qmail 96649 invoked by uid 3782); 8 Jan 2023 16:43:38 +0100 Original-Received: from acm.muc.de (p4fe154fd.dip0.t-ipconnect.de [79.225.84.253]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 08 Jan 2023 16:43:37 +0100 Original-Received: (qmail 7941 invoked by uid 1000); 8 Jan 2023 15:43:36 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:252930 Archived-At: Hello, Stefan. On Tue, Jan 03, 2023 at 10:16:54 -0500, Stefan Monnier wrote: > > nil > > ofter body has been evaluated, the buffer-undo-list after > > combine-change-call is > > (apply ... #'undo--wrap-and-run-primitive-undo ... ()) > > nil > > which is clearly wrong > Indeed. Which begs the question: why does the current code stop when it > sees a timestamp? > Alan? Do you remember why you did that? I'm afraid not. On 2018-04-01, I noted down that timestamps get "caught up inside the undo--wrap-and-run-primitive-undo entry.". But I neglected to be more specific, and can no longer remember exactly why. > What would go wrong if we applied a patch like the one below? I don't know. Possibly nothing. Maybe the problem that that code was meant to solve was also solved by some other code. > Stefan > diff --git a/lisp/subr.el b/lisp/subr.el > index 5fb150994ec..6f51ac90ce5 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -4972,10 +4972,11 @@ combine-change-calls-1 > ;; In case garbage collection has removed OLD-BUL. > (cdr ptr) > ;; Don't include a timestamp entry. > - (not (and (consp (cdr ptr)) > - (consp (cadr ptr)) > - (eq (caadr ptr) t) > - (setq old-bul (cdr ptr))))) > + ;; (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")) -- Alan Mackenzie (Nuremberg, Germany).