From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: 16411 <16411@debbugs.gnu.org>
Subject: bug#16411: undo-only bugs
Date: Thu, 15 May 2014 09:00:24 -0400 [thread overview]
Message-ID: <jwvwqdnnrbd.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAFM41H0JhLL=RNcFCohG=UHArDCy__0mnKnmfTvrH=zE27aLkg@mail.gmail.com> (Barry OReilly's message of "Wed, 14 May 2014 23:51:05 -0400")
>> If anything should be done with it, I think it'd be to *cut* the
>> extra undo/redo pairs.
> No complaint from me. That would change the behavior of ordinary undo
> command,
Yes. And I think that's what we want: as a user, having to wade through
N repetitions of redo/undo is a pain. Those that suffer often from it
probably switched to undo-tree.
The idea of cutting the extra undo-redo pairs follows the following
principle: an undo-redo pair gives you access to 1 past buffer state,
but if the earlier undo elements already made you go through an
identical state, then this undo-redo pair is superfluous.
I'm sure this can be generalized for undo-in-region (where an undo-redo
pair may not bring you exactly to the same state, but still gives you
access to a change you've already seen earlier in the undo list), but
I'm sure you can define it more easily than I.
> which you just said you don't want to change.
So far there was no discussion of changing behavior: only fixing bugs
and changing implementation.
>> I'm not completely convinced that this generator is worthwhile
> Ok, I'll lose it then.
We may want to (re)introduce it later, tho.
>>> I originally set out to do this, but making the weak references
>>> work seemed overly tricky to me. The value stored in
>>> undo-redo-table would need to be non weak with weak references to
>>> undo elements. I supposed this would mean many one element weak
>>> hash tables. That seems dodgy.
>> Hmm... that's a very good point. Worth mentioning in a comment.
> You actually want me to do that? That is: wrap every referenced
> element in a size 1 weak hash table.
God no! I'm saying that I agree with your justification for the design of
undo-redo-table keeping mappings for every undo-element rather than one
per undo group; but that you need to put a comment in the code
explaining why it's done this way.
Stefan
next prev parent reply other threads:[~2014-05-15 13:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 22:33 bug#16411: undo-only bugs Barry OReilly
2014-01-10 23:54 ` Stefan Monnier
2014-01-11 3:48 ` Barry OReilly
2014-01-11 4:29 ` Stefan Monnier
2014-01-11 5:09 ` Barry OReilly
2014-01-14 0:49 ` Stefan Monnier
2014-01-14 1:52 ` Stefan Monnier
2014-01-14 14:00 ` Barry OReilly
2014-01-19 0:58 ` Barry OReilly
2014-01-19 3:18 ` Stefan Monnier
2014-01-19 16:57 ` Barry OReilly
2014-02-14 18:51 ` Barry OReilly
2014-02-14 22:29 ` Barry OReilly
2014-02-18 17:40 ` Barry OReilly
2014-02-26 15:20 ` bug#16411: undo in region corrupts existing text Barry OReilly
2014-02-27 5:02 ` Stefan Monnier
2014-05-13 15:01 ` bug#16411: undo-only bugs Barry OReilly
2014-05-14 18:06 ` Stefan Monnier
2014-05-14 18:45 ` Stefan Monnier
2014-05-14 19:55 ` Stefan Monnier
2014-05-14 21:56 ` Barry OReilly
2014-05-15 2:23 ` Stefan Monnier
2014-05-15 3:51 ` Barry OReilly
2014-05-15 13:00 ` Stefan Monnier [this message]
2014-05-28 18:42 ` Barry OReilly
2014-06-19 21:35 ` Stefan Monnier
2014-05-14 13:32 ` Barry OReilly
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=jwvwqdnnrbd.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=16411@debbugs.gnu.org \
--cc=gundaetiapo@gmail.com \
/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.