GNU bug report logs - #60467
30.0.50; primitive-undo: Changes to be undone by function different from announced

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 1 Jan 2023 13:40:01 UTC

Severity: normal

Found in version 30.0.50

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ihor Radchenko <yantar92 <at> posteo.net>
Subject: bug#60467: closed (Re: bug#60467: 30.0.50; primitive-undo:
 Changes to be undone by function different from announced)
Date: Wed, 16 Aug 2023 16:10:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 60467 <at> debbugs.gnu.org.

-- 
60467: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60467
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Gregory Heytings <gregory <at> heytings.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60467-done <at> debbugs.gnu.org, frederic.giquel <at> laposte.net,
 yantar92 <at> posteo.net, monnier <at> iro.umontreal.ca, acm <at> muc.de
Subject: Re: bug#60467: 30.0.50; primitive-undo: Changes to be undone by
 function different from announced
Date: Wed, 16 Aug 2023 16:09:25 +0000
>
> I see that you haven't yet installed your fix on master; please do.
>

I was waiting for your and Stefan's comments.  Now done (d622602452), and 
closing this bug (again?).


[Message part 3 (message/rfc822, inline)]
From: Ihor Radchenko <yantar92 <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; primitive-undo: Changes to be undone by function different
 from announced
Date: Sun, 01 Jan 2023 13:40:08 +0000
Hi,

Original report:
https://orgmode.org/list/25520.20685.583180.776610 <at> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



This bug report was last modified 1 year and 335 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.