From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Date: Sun, 01 Jan 2023 13:40:08 +0000 Message-ID: <87o7ri74qv.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14597"; mail-complaints-to="usenet@ciao.gmane.io" To: 60467@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 01 14:40:23 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 1pByZa-0003cE-8v for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Jan 2023 14:40:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pByZJ-0007xH-Ff; Sun, 01 Jan 2023 08:40: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 1pByZG-0007x2-OF for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 08:40:02 -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 1pByZG-0000Gv-3s for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 08:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pByZF-0005TS-Jd for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 08:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jan 2023 13:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60467 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167258038721017 (code B ref -1); Sun, 01 Jan 2023 13:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jan 2023 13:39:47 +0000 Original-Received: from localhost ([127.0.0.1]:40458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pByZ1-0005Su-4R for submit@debbugs.gnu.org; Sun, 01 Jan 2023 08:39:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:57914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pByYz-0005Sn-J4 for submit@debbugs.gnu.org; Sun, 01 Jan 2023 08:39:46 -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 1pByYz-0007w0-AN for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 08:39:45 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pByYx-0008U5-9c for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 08:39:45 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4B5952401BC for ; Sun, 1 Jan 2023 14:39:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1672580380; bh=6fM7hHjmPeM6M51afufpR9rlM6udxg1/Pk0NyoPzUWU=; h=From:To:Subject:Date:From; b=jj7UpQpOUvxGdO/5x/BmIP/MiGNUey9lIh8t0gD/XtnLUfCGUbTffq/8olVBxA8bi MuMeofciUOiYsjl+m7m4CJj5kwL9MQszgo0X8GRZufseisdD3z4RPJDQc2Ek3NTQls 9VfMiEYhBCx2nzowylNT89RKXsmO7BhOxtWgb0Q/4YC/y2mKkJpyk3cxARf5X8+Xjn KyvCwJ0jvZ+W+Y2vXnsOmOmpRfg/eckd1AF4xSX8+eQKZMa7iPf4mWfExzdpg9Wtsu B9Ljr2wDvZgMjJK7+lWZIBhTYSBbHmXqQjUauY4RUps/L7ofkUOGB3DD9zSnU24kCI MxkRDcbuaScXQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NlKqG4JvNz9rxF for ; Sun, 1 Jan 2023 14:39:38 +0100 (CET) Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:252244 Archived-At: Hi, Original report: https://orgmode.org/list/25520.20685.583180.776610@gargle.gargle.HOWL 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 functions in question are below and I fail to see anything that may be wrong there. (defun org-promote-subtree () "Promote the entire subtree. 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-fix-position-after-promote)) (defun org-promote () "Promote the current heading higher up the tree." (org-with-wide-buffer (org-back-to-heading t) (let* ((after-change-functions (remq 'flyspell-after-change-function after-change-functions)) (level (save-match-data (funcall outline-level))) (up-head (concat (make-string (org-get-valid-level level -1) ?*) " ")) (diff (abs (- level (length up-head) -1)))) (cond ((and (= level 1) org-allow-promoting-top-level-subtree) (replace-match "# " nil t)) ((= level 1) (user-error "Cannot promote to level 0. UNDO to recover if necessary")) (t (replace-match (apply #'propertize up-head (text-properties-at (match-beginning 0))) t))) (unless (= level 1) (when org-auto-align-tags (org-align-tags)) (when org-adapt-indentation (org-fixup-indentation (- diff)))) (run-hooks 'org-after-promote-entry-hook)))) In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-26 built on localhost Repository revision: cc29fab3a66c59e77d0ff67c0f3e2e34ec80a03c Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Gentoo Linux -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at