[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16411: undo-only bugs

From: Stefan Monnier
Subject: bug#16411: undo-only bugs
Date: Sat, 18 Jan 2014 22:18:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Where:
>   • delta, beg, end are as documented.
>   • undo-redo is a new function that copies undone-element, applies
>     undo-delta, then calls primitive-undo on it.
>   • undone-element is the undone element of buffer-undo-list.
>   • undo-delta is (position . offset) indicating how undo-redo should
>     modify a copy of undone-element in order to carry out the redo.

> When executing undo-only:
>   • Assume pending-undo-list can be lazily computed
>   • Let undo-skip-set be an empty set of undo elements to skip
>   • Iterate over pending-undo-list until prefix-arg undos complete:
>     • If the element is in undo-skip-set:
>       • Remove it from undo-skip-set
>       • Continue loop
>     • If the element is of the form for a redo element:
>       • Insert its undone-element in the undo-skip-set
>     • Else undo the element

In which way would this help fixing bug 2 (I thought we had already
understood how to fix bug 2, BTW)?

More problematic: the step "Insert its undone-element in the
undo-skip-set" means that we skip this "redo" element, which means that
all the subsequent elements (until the matching undone-element) may have
incorrect buffer positions.

Luckily, you probably won't bump into any problem because all these
intermediate elements will themselves be redo elements or be in
undo-skip-set.  But it's still dangerous and wasteful (why not skip all
these elements in one swoop as we currently do with undo-equiv-table).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]