Subject: Re: bug#33341: 27.0.50; Undo log merging and change groups

From: Michael Heerdegen <[email-masked]>
Date: Thu, 26 Nov 2020 15:49:29 +0100

Michael Heerdegen <[email-masked]> writes:

> Lars Ingebrigtsen <[email-masked]> writes:
>
> > Hm...  Well, after running this command, hitting "undo" removes all the
> > three lines, which is what I'd expect?  Since you cancelled the change
> > group?
>
> AFAIU `cancel-change-group' itself should undo the change set, without
> the user invoking `undo'.  See the implementation of
> `atomic-change-group' for a use of this feature.

BTW, coming back to my example:

#+begin_src emacs-lisp
(defun my-test-change-groups ()
  (interactive)
  (insert "0\n") ;; try to comment this line
  (let ((g (prepare-change-group)))
    (activate-change-group g)
    (insert "b\n")
    (insert "c\n")
    (cancel-change-group g)))
#+end_src

if you comment the line including the `insert' call before the change
group is prepared the thing works as expected.  So there is a problem
with this insertion (in the same command?) before preparing the group,
or this is actually not allowed but not documented accordingly.

Michael.