all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: toby-undo-tree <toby-undo-tree@dr-qubit.org>, emacs-devel@gnu.org
Subject: Re: Integration of undo-tree in Emacs
Date: Wed, 28 May 2014 22:08:08 -0400	[thread overview]
Message-ID: <jwvlhtll5l4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAFM41H0MZ6s9GZEfvkmEa55viPumBHeMyBQCHS0hLacEu4H1vg@mail.gmail.com> (Barry OReilly's message of "Wed, 28 May 2014 15:38:56 -0400")

> The appeal of undo-tree is that it allows the user to more
> intuitively and directly navigate the underlying tree. If the
> user wants to reach other branches of the tree using the builtin
> undo system, they must retrace their edge traversals, of which
> there can be many. This is poorer usability.

As mentioned earlier, I'd be happy to accept a patch which removes
"undo+redo+undo" elements rather than accumulating redundant traversals.

IOW, buffer-undo-list can hold multiple copies of the same tree
branch, and I's be happy to change this so as to remove the
redundant copies.

> But if you're willing to address this concern by eliminating any
> requirement for the undo command to retrace edge traversals, that
> would be great.

Yes, that would be fine.

> This kind of tree change at seemingly random times might be very
> surprising to the user, albeit granted the parent-child reversals
> will tend to occur away from the user's local part of the tree.

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

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


        Stefan



  parent reply	other threads:[~2014-05-29  2:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 19:38 Integration of undo-tree in Emacs Barry OReilly
2014-05-28 22:14 ` Toby Cubitt
2014-05-29  2:57   ` Barry OReilly
     [not found]     ` <20140529180441.GA12623@c3po.maths.private.cam.ac.uk>
2014-05-30 14:40       ` Barry OReilly
2014-06-02 10:57         ` Toby Cubitt
2014-06-02 16:24           ` Barry OReilly
2014-06-02 21:23             ` Toby Cubitt
2014-05-29  2:08 ` Stefan Monnier [this message]
2014-05-29 17:42   ` Toby Cubitt
2014-05-30 12:00   ` Barry OReilly
2014-05-30 16:01     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvlhtll5l4.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=gundaetiapo@gmail.com \
    --cc=toby-undo-tree@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.