[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17235: Undo in region adjusts past positions incorrectly
From: |
Stefan Monnier |
Subject: |
bug#17235: Undo in region adjusts past positions incorrectly |
Date: |
Tue, 22 Apr 2014 22:31:38 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
> 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