emacs-devel
[Top][All Lists]
Advanced

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

Re: Integration of undo-tree in Emacs


From: Barry OReilly
Subject: Re: Integration of undo-tree in Emacs
Date: Fri, 30 May 2014 08:00:40 -0400

> 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.

Yes, makes sense. So the code wouldn't trim every undo/redo pair but
just those that don't lose information about the other branches that
exist. So if the user goes up and down a branch twice, we only trim
out one round trip.

> Note that the set of reachable nodes is reduced in the same order as
> in the case of undo-tree.  The difference is in how these are mapped
> to a tree.  To a large extent the difference is in "which node is
> taken to be the root".  If you always take "the most recent state"
> as the root of the tree (instead of the oldest), then both
> techniques are "stable" and behave "identically".

You lost me at "the most recent state as the root". If you mean most
recently created, that is a leaf node. If you mean most recently
visited, that is the user's current node and is not necessarily the
root either.

> So A is first in line for truncation followed by E, B, C, D.

My mistake: that should have been A, D, C, B, E. (I think undo-tree's
right-to-left ordering of branches threw me off.)


reply via email to

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