From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings 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 09:41:52 +0000 Message-ID: References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> <9bc9c69ac282c0148962@heytings.org> <87h6x9mgdv.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NG9c1wiATu" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60467@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 03 10:42:16 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 1pCdoG-00008i-1k for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Jan 2023 10:42:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCdo4-0000qw-Vr; Tue, 03 Jan 2023 04:42:05 -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 1pCdo2-0000nk-Rm for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 04:42: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 1pCdo2-0007pq-Jv for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 04:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCdo2-0003AR-FV for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 04:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jan 2023 09:42: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.167273891912167 (code B ref 60467); Tue, 03 Jan 2023 09:42:02 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 3 Jan 2023 09:41:59 +0000 Original-Received: from localhost ([127.0.0.1]:44737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCdnz-0003AA-4F for submit@debbugs.gnu.org; Tue, 03 Jan 2023 04:41:59 -0500 Original-Received: from heytings.org ([95.142.160.155]:56918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCdnu-00039w-Bs for 60467@debbugs.gnu.org; Tue, 03 Jan 2023 04:41:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672738913; bh=ZJYExqxZmtwqBu4psOcesHj70rLocvwdw++VB7lF0kA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=cCKpHDx3sQPKfUAux9L/luQ7yC3l9lpSkZ1GYJ6fL9DOfaNBkjpxv07xk8my61Iyw QyU0Jt96hGBdXOdXpz0wzMZGkhp3tw/gNAhcudqhS08RmxQPj7xBuEw81c+DCHeEeG 1xxICQjRpcK+ycoeCsOA3WdnkPNNQJFEr1lI0BTOONvh3JIQ2apT5IzJA20J2bMZ7v MCg67s+lhhMDHfIWsheHpF9W2PRdBZOaf2EC2TmU5Ylm1couxCXvTGbUw952nLYtkH 0Oo30NUuQntQauhb5DUHWcg8k0gMSgXitKQEvGI6nDSkCY4D7zpmAgfVxQtsMBKwTn saf4025gRsv/g== In-Reply-To: <87h6x9mgdv.fsf@localhost> 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:252386 Archived-At: --NG9c1wiATu Content-Type: text/plain; format=flowed; charset=us-ascii It turns out that the bug is indeed not in Org, but in Emacs. The part of combine-change-call which creates the undo-list element was totally broken. For example, with a buffer-undo-list like 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, because and should be considered as a single undo step. IOW, after combine-change-call buffer-undo-list should be: (apply ... #'undo--wrap-and-run-primitive-undo ... ( )) nil Patch attached. --NG9c1wiATu Content-Type: text/x-diff; name=Fix-combine-change-call.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Fix-combine-change-call.patch RnJvbSAyMjYxZGU0ZDIwZDAwNmM1MzQ0NjE1ZDQ5YWRlNTM5NTQxNTc3Zjdl IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBUdWUsIDMgSmFu IDIwMjMgMDk6MjM6MTQgKzAwMDANClN1YmplY3Q6IFtQQVRDSF0gRml4IGNv bWJpbmUtY2hhbmdlLWNhbGwNCg0KKiBsaXNwL3N1Yn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GlzdCkgYm9keS11bmRvLWxpc3QpDQorICAg ICAgICAgICAgKHdoaWxlIChub3QgKGVxIHB0ciBvbGQtYnVsKSkNCisgICAg ICAgICAgICAgICh1bmxlc3MgKGFuZCAoY29uc3AgKGNhciBwdHIpKQ0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIChlcSAoY2FhciBwdHIpIHQpKQ0K KyAgICAgICAgICAgICAgICAocHVzaCAoY2FyIHB0cikgYm9keS11bmRvLWxp c3QpKQ0KKyAgICAgICAgICAgICAgKHNldHEgcHRyIChjZHIgcHRyKSkpDQor ICAgICAgICAgICAgKHNldHEgYm9keS11bmRvLWxpc3QgKG5yZXZlcnNlIGJv ZHktdW5kby1saXN0KSkNCisgICAgICAgICAgICAocHVzaCAobGlzdCAnYXBw bHkNCisJICAgICAgICAgICAgICAgICgtIGVuZCBlbmQtbWFya2VyKQ0KKwkg ICAgICAgICAgICAgICAgYmVnDQorCSAgICAgICAgICAgICAgICAobWFya2Vy LXBvc2l0aW9uIGVuZC1tYXJrZXIpDQorCSAgICAgICAgICAgICAgICAjJ3Vu ZG8tLXdyYXAtYW5kLXJ1bi1wcmltaXRpdmUtdW5kbw0KKwkgICAgICAgICAg ICAgICAgYmVnIChtYXJrZXItcG9zaXRpb24gZW5kLW1hcmtlcikNCisgICAg ICAgICAgICAgICAgICAgICAgICBib2R5LXVuZG8tbGlzdCkNCisgICAgICAg ICAgICAgICAgICBidWZmZXItdW5kby1saXN0KQ0KKyAgICAgICAgICAgIChz ZXRjZHIgYnVmZmVyLXVuZG8tbGlzdCBvbGQtYnVsKSkpDQogCShpZiAobm90 IGluaGliaXQtbW9kaWZpY2F0aW9uLWhvb2tzKQ0KIAkgICAgKHJ1bi1ob29r LXdpdGgtYXJncyAnYWZ0ZXItY2hhbmdlLWZ1bmN0aW9ucw0KIAkJCQliZWcg KG1hcmtlci1wb3NpdGlvbiBlbmQtbWFya2VyKQ0KLS0gDQoyLjM5LjANCg0K --NG9c1wiATu--