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 01:50:23 +0000 Message-ID: <9bc9c69ac282c0148962@heytings.org> References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39283"; 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 02:51:27 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 1pC9z5-0009wF-Fi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Jan 2023 02:51:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC9yi-0002gp-RE; Sun, 01 Jan 2023 20:51:04 -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 1pC9yg-0002gc-Rk for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 20:51: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 1pC9yg-0000SZ-JI for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 20:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pC9yg-0000W1-AP for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 20:51: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: Mon, 02 Jan 2023 01:51: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.16726242271940 (code B ref 60467); Mon, 02 Jan 2023 01:51:02 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 2 Jan 2023 01:50:27 +0000 Original-Received: from localhost ([127.0.0.1]:42134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC9y6-0000VE-Nv for submit@debbugs.gnu.org; Sun, 01 Jan 2023 20:50:27 -0500 Original-Received: from heytings.org ([95.142.160.155]:55254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC9y5-0000V4-8M for 60467@debbugs.gnu.org; Sun, 01 Jan 2023 20:50:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672624223; bh=kW9xWpF5Oh0LHwkt96OA6KJS2lX3zXXEF7Gn+I6bsYc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Yxnw2fyxoXqWDOALOMVoZT1V1Lsr8OUjvSX7DrfvdElr4kIwu8ZyWsng4gQdp0j8h AVpbbkdgy8FBes/6LtVmDedkiIN34SXCrMp3yaroaZQNSDJwDqq4cSiNFRncqKi8NJ MhmCtfNyK3mtDm2Q55+0yhvqEgqfNSgjzDvWeNCKlRazZbn6L7ACY7JjCD7EXZEy4+ ZGAqYlGijtdJhXQdV3isTchnmYvZLpKr5k9f/nf1dNPCg6h54bPesZLjIcVhlNtJiz QnsSMqFZtNDGiG0+Rx2sMyAiObA8mTXxlXGnFcuJwNyQmNGcJEq2yGKZu5IHUhwFLH 4xmjwcdP9tMkg== In-Reply-To: <9bc9c69ac20a37ded741@heytings.org> 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:252304 Archived-At: > > If it's an Emacs bug, which is possible, it's in combine-change-calls. > A few more details on the bug. It's still unclear to me whether the bug is in Org or in Emacs. When the file is opened we start with buffer-undo-list = nil. The (org-with-limited-levels (org-map-tree 'org-promote)) body in org-promote-subtree, called inside a combine-change-calls, adds four entries to buffer-undo-list: ("** " . 6) (9 . 11) which means that three characters have been removed and two have been added in the buffer, which seems correct, although the (9 . 11) entry looks a bit suspicious. Perhaps (6 . 8) would have been expected there? However, this change does not happen outside the region on which combine-change-calls is called, which is 6-11. Upon returning from combine-change-calls, buffer-undo-list contains four elements, when a single element would have been expected, if I understand its docstring correctly: (apply 1 6 10 #'undo--wrap-and-run-primitive-undo 6 10 (("** " . 6))) (9 . 11)