unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Barry OReilly <gundaetiapo@gmail.com>
To: Toby Cubitt <tsc25@cantab.net>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: Integration of undo-tree in Emacs
Date: Wed, 28 May 2014 22:57:15 -0400	[thread overview]
Message-ID: <CAFM41H1dz6_+YgdbRY17cd5OsMVmErVZ_bhn97WPdET7F6eJ+g@mail.gmail.com> (raw)
In-Reply-To: <20140528221435.GA24032@c3po>

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

Thanks for your reply, Toby. I appreciate your wisdom on this topic.

> Perhaps I felt that duplicating the entire subtree would make for a
> needlessly complex tree.

I find one limitation in undo-tree is that a buffer state that was two
edges away becomes an arbitrary number of edges away, because
undo in region reaches arbitrarily far back.

Alternatively, after an undo in region, you could display it like:

  |
  |
  A'
  |\…
  |

Literally with the ellipsis. Traversing that edge would take you back
to the parallel tree you came from:

  | …
  |/
  A
  |
  |

The parallel trees look the same after all. I don't think the user
usually cares where is the root at which they join together, although
there are probably ways to display that.

> The implementation and maintenance overhead of designing a system
> that simultaneously supports two largely incompatible undo models
> doesn't seem worth it to me.

I'm not sure why you say they're largely incompatible.

> From memory (and git logs), I think that without this mechanism
> undo-tree used to sometimes resurrect dead markers when undoing. A
> lisp package might delete a marker from a buffer and drop all
> references to it, expecting it to be garbage collected. But because
> it was referenced from buffer-undo-tree (a strong reference, rather
> than the specialized buffer-undo-list weak reference), the marker
> never got GCd. Undoing a changeset containing the deleted marker
> would then restore the marker. I remember this created all kinds of
> havoc with overlays.

Sounds like bug 16818, which affected the builtin undo system too. It
is fixed in the upcoming Emacs 24.4. undo-tree may require an
analagous change, since it doesn't use undo-make-selective-list.

I don't think this bug has anything particular to do with
compact_undo_list splicing out marker adjustments in GC. Maybe the
undo-tree-object-pool makes the bug less probable because it allows
some problematic marker adjustments to be removed earlier during GC
instead of later during undo history truncation.

The undo-tree-object-pool code looks like a correct, albeit
convoluted, mimicry of compact_undo_list, but I don't see an actual
problem either solves.

[-- Attachment #2: Type: text/html, Size: 2623 bytes --]

  reply	other threads:[~2014-05-29  2:57 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 [this message]
     [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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAFM41H1dz6_+YgdbRY17cd5OsMVmErVZ_bhn97WPdET7F6eJ+g@mail.gmail.com \
    --to=gundaetiapo@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=tsc25@cantab.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).