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: Mon, 02 Jan 2023 00:46:17 +0000 Message-ID: <9bc9c69ac20a37ded741@heytings.org> References: <87o7ri74qv.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11575"; 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 Mon Jan 02 01:48:11 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 1pC8zo-0002lU-OK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Jan 2023 01:48:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC8yq-0001sT-EC; Sun, 01 Jan 2023 19:47:08 -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 1pC8yn-0001rB-N1 for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 19:47:05 -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 1pC8yn-0004YC-Ea for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 19:47:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pC8yn-0007Hc-Az for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 19:47:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jan 2023 00:47:05 +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.167262038227796 (code B ref 60467); Mon, 02 Jan 2023 00:47:05 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 2 Jan 2023 00:46:22 +0000 Original-Received: from localhost ([127.0.0.1]:42054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8y5-0007EG-UA for submit@debbugs.gnu.org; Sun, 01 Jan 2023 19:46:22 -0500 Original-Received: from heytings.org ([95.142.160.155]:55188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8y3-0007E5-Ab for 60467@debbugs.gnu.org; Sun, 01 Jan 2023 19:46:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672620378; bh=rBHdujxbUIxMm/6cHXu+XoHRS6DUx0XrVD4PVxM77ng=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Q9tK5WgDeFiRmtKX8OwtV+Lk9PJ8S5BGRm189YM4LIri3MY3cA92YduC+8QNGGEgO cw1j6rss8jnAT9l3s4SXaLbNXvk43NVoqN8d5tD0WdRXYp3KYPutvrv1iI4Pg34+UM GVaCqHA+XcnyqNfP+zD16JWnJyGEduJ7RsqP9vZuUiMyiuiJPjdqdAB8fI/0rrCPsg vXZz8jIhZm0vARIYRz4gsLQRps+dbgMODGrzucrCzUj3DliG9SHUrPRG2D6fmavezu HsEIWdBlfrMjkjox53K9WQbR+rbQvzhYqN9QfRoeQhGyhrV764z/lYm2irJuJnfTjm ScaEPJq16DRlQ== In-Reply-To: <87o7ri74qv.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:252300 Archived-At: > > I am not sure if it is Emacs bug, but I have difficulty understanding > the origin of the following error: > > 1. Create /tmp/bug.org with the following contents > > * h1 > ** h2 > > 2. emacs -Q /tmp/bug.org > 3. Move point to h2 > 4. M-x org-promote-subtree > 5. M-x undo > 6. Observe "Changes to be undone by function different from announced" error > The culprit is 85e0a69567 (in the Org repository), and the bug is fixed by: diff --git a/lisp/org.el b/lisp/org.el index a98a7f5a0..becb302e1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6554,8 +6554,7 @@ See also `org-promote'." (interactive) (save-excursion (org-back-to-heading t) - (combine-change-calls (point) (save-excursion (org-end-of-subtree t)) - (org-with-limited-levels (org-map-tree 'org-promote)))) + (org-with-limited-levels (org-map-tree 'org-promote))) (org-fix-position-after-promote)) (defun org-demote-subtree () @@ -6564,8 +6563,7 @@ See `org-demote' and `org-promote'." (interactive) (save-excursion (org-back-to-heading t) - (combine-change-calls (point) (save-excursion (org-end-of-subtree t)) - (org-with-limited-levels (org-map-tree 'org-demote)))) + (org-with-limited-levels (org-map-tree 'org-demote))) (org-fix-position-after-promote)) (defun org-do-promote () Perhaps another better fix exists. If it's an Emacs bug, which is possible, it's in combine-change-calls.