GNU bug report logs -
#11774
org-mode causes undo boundaries to be lost
Previous Next
Full log
View this message in rfc822 format
On Sun, Jun 24, 2012 at 11:39:08PM +0200, Bastien wrote:
> Hi Toby,
>
> Toby Cubitt <tsc25 <at> cantab.net> writes:
>
> > For some unknown reason, org-mode is causing the undo boundary between
> > the (2 . 4) and (1 . 2) entries to be removed from `buffer-undo-list'.
>
> Can you try again with
>
> (setq org-self-insert-cluster-for-undo nil)
>
> and report?
Yup, that fixes the problem.
I don't fully understand the purpose of
`org-self-insert-cluster-for-undo', given that the Emacs command loop
already groups consecutive undo entries together, but presumably it
enables a more aggressive form of clustering.
If the behaviour I reported is the intended behaviour with this option
set, perhaps the clustering heuristic can be improved to avoid triggering
history discarding in undo-tree-mode?
undo-tree-mode puts a "canary" at the end of buffer-undo-list, to detect
when Emacs discards undo history behind undo-tree-mode's
back. I.e. before any undo entries have been added, buffer-undo-list
contains:
(nil undo-tree-canary)
org-mode's undo clustering deletes the undo boundary before the
undo-tree-canary entry, causing undo-tree-mode to think that Emacs has
discarded undo history behind its back.
I could try to work around this in undo-tree-mode, but it seems to me
that org-mode shouldn't be throwing away an undo boundary that comes
before an entry which definitely shouldn't be clustered with anything
(namely the undo-tree-canary symbol, which is meaningless to org-mode).
Toby
--
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain
email: tsc25 <at> cantab.net
web: www.dr-qubit.org
This bug report was last modified 10 years and 200 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.