GNU bug report logs -
#33341
27.0.50; Undo log merging and change groups
Previous Next
Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Sun, 11 Nov 2018 07:52:01 UTC
Severity: normal
Found in version 27.0.50
Done: Michael Heerdegen <michael_heerdegen <at> web.de>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 33341 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> Could you check why it breaks in the absence of an undo-boundary?
I have edebugged `org-entry-get'. Short version: it is as it seems.
Here is the example again:
#+begin_src emacs-lisp
(defun my-test-change-groups ()
(interactive)
(insert "0\n")
;; (undo-boundary)
(let ((g (prepare-change-group)))
(activate-change-group g)
(insert "b\n")
(insert "c\n")
(cancel-change-group g)))
#+end_src
Without the boundary, all changes are combined into one (1 . 10) undo
entry. And then these code lines
#+begin_src emacs-lisp
;; Temporarily truncate the undo log at ELT.
(when (consp elt)
(setcar elt nil) (setcdr elt nil))
#+end_src
cause that were the undo should happen:
#+begin_src emacs-lisp
;; Undo it all.
(save-excursion
(while (listp pending-undo-list) (undo-more 1)))
#+end_src
nothing is undone.
With the boundary, we have two undo entries, and the truncated log still
contains the entry for the first `insert' call.
Regards,
Michael.
This bug report was last modified 4 years and 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.