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: 16411@debbugs.gnu.org
Subject: bug#16411: undo-only bugs
Date: Fri, 10 Jan 2014 23:29:14 -0500	[thread overview]
Message-ID: <jwveh4f2lya.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAFM41H3qDJ54Xj6o7Mt=yem9LwviPqhQbdk3QyFJ0vD_REF21g@mail.gmail.com> (Barry OReilly's message of "Fri, 10 Jan 2014 22:48:34 -0500")

>> undo-in-region does not implement undo-only, indeed.  I think the way
>> to implement undo-only is to change undo-make-selective-list so it
>> also skips redo entries (depending on undo-no-redo, obviously) using
>> the above while loop.
> I don't see how that's a correct solution in the face of arbitrary
> regional undos and prefix args. Would you have the redo records
> resulting from regional undos still map to t in the undo-equiv-table?

I was talking about simply making undo-in-region
properly skip the previous undos (presuming they don't themselves come
from an undo-in-region).

IIUC, you're talking of skipping (e.g. in a non-region undo) the undos
that took place during undo-in-region, right?  If so, I don't have an
answer for how we could do that, in general.

In your pseudo-code:

  While pending-undo-list non nil:
    Pop undo-i from pending-undo-list:
    If undo-i is a redo record (exists in the table):
      Remove undo-i's undone records from pending-undo-list (or
      otherwise arrange to skip it)
    Else:
      Undo undo-i
      If "undo undo-i" was done prefix-arg times:
        Break (finished)
  Reached end of undo history

I have no idea how to implement the part:

      Remove undo-i's undone records from pending-undo-list (or
      otherwise arrange to skip it)

I guess I do have some idea how to do it, but it looks like a lot of
work, since we have to adjust the positions in the rest of
pending-undo-list.

Other than that I don't understand what your redo-record-table does.
AFAICT the test "undo-i is a redo record" can be performed with
undo-equiv-table.

> How does your solution account for redo records that undid several
> because of prefix-arg?

As you have discovered the current code does not even try to account for
prefix args.

> undo-equiv-table only maps to the change group
> after the last undone record without information about the (1-
> prefix-arg) others.

Right: the loop that undoes N steps (either in undo-more or in undo if
we change undo to only call undo-more with a 1) needs not only to use
undo-equiv-table at each iteration to skip redo entries, but it also
needs to add an entry in undo-equiv-table at each iteration.


        Stefan





  reply	other threads:[~2014-01-11  4:29 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 [this message]
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
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=jwveh4f2lya.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.