Subject: bug#16818: Acknowledgement (Undo in region after markers in undo history relocated)

From: Stefan <[email-masked]>
Date: Wed, 19 Mar 2014 14:52:40 -0400

>> I'd have the same comment here, but if we emit a warning for sole
>> marker-adjustments in the "non-region" code, we don't really have to
>> worry about them here.
> If you're saying changes under undo-make-selective-list are not
> necessary, remember that currently it can create a list like:

No, I mean that it's OK to *assume* that any marker-adjustment we find
in the undo-region code is "right after a deletion".  Of course, that's
only relevant if that can help us simplify the code.

>> I think we should only change the entry corresponding to a deletion
>> such that it directly handles all the immediately following
>> marker-adjustments
> They don't always immediately follow. An integer record can be between
> them. For example, at the end of the undo-test-marker-adjustment-moved
> test I posted previously, buffer-undo-list is:
>   (nil (1 . 4) nil (abc . 1) 12 (#<marker at 7 in  *temp*-216909> . -1) nil
> (1 . 12) (t . 0))

Right, the integer record is indeed also added by the deletion, so
we should still consider the marker adjustments to "immediately follow".

>   * Implement your proposal but skip over the (t ...) and integer
>     records
>   * Restructure the C code so as marker adjustments are always
>     immediately before deletion records
>   * Revisit the approach of fixing markers that move to unrelated
>     locations.

I think the first option is best (hopefully, the set of "things that can
come between the deletion and the marker adjustments" won't keep growing).

        Stefan