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: 17235@debbugs.gnu.org
Subject: bug#17235: Undo in region adjusts past positions incorrectly
Date: Tue, 22 Apr 2014 22:31:38 -0400	[thread overview]
Message-ID: <jwv4n1kvky0.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAFM41H2nvTK8ed3yaoBo2sqk++zBKFkBmtenmEQJL-VO2JXuQA@mail.gmail.com> (Barry OReilly's message of "Thu, 10 Apr 2014 10:00:06 -0400")

> I think the algorithm would be simpler to make correct if adjustments
> are applied forward chronologically rather than backwards. That is,
> the algorithm keeps a list of undo-deltas that grows as the algorithm
> iterates backwards through undo history. As it does so, the positions
> are adjusted chronologically forward through the undo-deltas. This
> approach is O(N**2), as the current algorithm also is, but the bright
> side is the proposed algorithm lends itself to short circuiting better
> than the current.

I believe you.  I'm not familiar with the way it currently works.

> Let me know if you have other ideas and I'll prepare a patch.

While looking at that code, can you make that "make-selective-list" skip
redo entries (depending on undo-no-redo, obviously), using the
undo-equiv-table?


        Stefan





  reply	other threads:[~2014-04-23  2:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 14:00 bug#17235: Undo in region adjusts past positions incorrectly Barry OReilly
2014-04-23  2:31 ` Stefan Monnier [this message]
2014-04-23 16:20   ` Barry OReilly
2014-04-23 17:56     ` Stefan Monnier
2014-04-26 21:00       ` Barry OReilly
2014-05-02  0:49 ` bug#17235: 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=jwv4n1kvky0.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=17235@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).