unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Wed, 14 May 2014 15:55:47 -0400	[thread overview]
Message-ID: <jwvbnv0tagh.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAFM41H1pg4uBV3YDfMX=gP=KH2jmdZ4ha7-BWZAcdL8gYrvH=Q@mail.gmail.com> (Barry OReilly's message of "Tue, 13 May 2014 11:01:32 -0400")

> Having undo elements reference what they undid would help solve
> several issues:

>    1: undo-only in region doesn't work.
>    2: Normal undo-only after an undo in region doesn't work. I've
>       previously outlined how the solution would use the
>       undo-redo-table.
>    3: Undo in region has counter intuitive behavior as described in
>       the FIXME of simple.el describing undo in region.
>    4: Deleting X bytes, then doing Y iterations of undo and redo
>       causes undo history to grow about X*Y. To grow proportional to Y
>       should be achievable: set undo-in-progress to the in progress
>       element, and the C level undo recording to use it and
>       undo-redo-table to find the eq Lisp_String.
>    5: Undo Tree should more tightly integrate with the builtin undo
>       system. To do so, it needs sufficient information to visualize
>       the buffer-undo-list as a tree. Undo Tree has a means to
>       visualize undo in regions, so undo-equiv-table is inadequate.

IIUC this undo-redo-table business is only necessary because of
undo-in-region.  So I think we should strive to minimize the changes to
the way undo works in the absence of undo-in-region.  I understand that
the change can't be all localized in undo-in-region (because of the need
to skip "redo-in-region" during normal undo-only, basically), but we
still should try to aim in that direction.

> There are variations on how elements could reference what they undid,
> but fundamentally I think it is essential. I wish to know how you like
> the direction the patch is going as I proceed to solve some problems
> building upon it.

I think we should try to keep the "one entry per undo boundary" rather
than go for "one entry per undo element".

> The reason undo-redo-table maps at the element level, as opposed to
> the change group level, is because in the case of undo in region with
> a prefix arg, the newly created change group needs to reference
> subsets of potentially many prior change groups.

IIUC the crux of the matter is how to record the redo data for an
undo-in-region.  The way I see it, for such a "redo-in-region" group, we
indeed need to remember which elements it undid (and which ones it
skipped instead), but we could store that info as a single entry in
an undo-redo/equiv-table.


        Stefan





  parent reply	other threads:[~2014-05-14 19:55 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 [this message]
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
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

  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=jwvbnv0tagh.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 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).