help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing change groups


From: Stefan Monnier
Subject: Re: Editing change groups
Date: Sat, 10 Nov 2018 13:07:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> My original example (now with the line you criticized removed):
>
> #+begin_src emacs-lisp
> (defun my-test-change-groups ()
>   (interactive)
>   (insert "0\n")
>   (let ((g (prepare-change-group)))
>     (activate-change-group g)
>     (insert "b\n")
>     (insert "c\n")
>     (cancel-change-group g)))
> #+end_src 
>
> and why it doesn't behave as I expect (I guess you can guess what I
> expect).

Oh, yes, it's a bug in the change-groups code: the undo entries for
(insert "0\n"), (insert "b\n"), and (insert "c\n") are merged into
a single entry in the undo log (as a form of optimization).
The change-group code should prevent such a merge, e.g. by adding some
dummy undo element which will work like a "fence".

Can you file this as a proper bug report (and put me in X-Debbugs-Cc)?


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]