[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Integration of undo-tree in Emacs
From: |
Toby Cubitt |
Subject: |
Re: Integration of undo-tree in Emacs |
Date: |
Thu, 29 May 2014 18:42:10 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, May 28, 2014 at 10:08:08PM -0400, Stefan Monnier wrote:
> > Toby, are there other reasons undo-tree needs to transfer undo
> > elements from the buffer-undo-list to its own data model?
>
> Toby's position is that the undo data should be kept as a tree, not as
> a list. That makes a lot of sense: For every branch in a tree, the
> undo-list keeps 2 bundles (one going forward and the other going back),
> but one of the two is always redundant, so the representation
> is inefficient. Of course, this inefficiency only applies to the
> *branches*, i.e. only for those elements generated by `undo', so this is
> irrelevant as long as most of the changes are not undos.
Just to be clear, I'm not strongly advocating changing Emacs' undo data
structures. I'm just pointing out that *if* you're going to make
substantial changes to the undo system for other reasons, you might as
well consider whether changing the data structures would be useful too.
I can see a number of arguments against changing Emacs' undo model, not
least that `buffer-undo-list' is documented in the Elisp manual so is
part of the Elisp API that packages may rely on. (I very occasionally get
reports that undo-tree is incompatible with some package, for this
reason.)
Toby
--
Dr T. S. Cubitt
Royal Society University Research Fellow
Fellow of Churchill College, Cambridge
Centre for Quantum Information
DAMTP, University of Cambridge
email: address@hidden
web: www.dr-qubit.org