GNU bug report logs -
#16818
Undo in region after markers in undo history relocated
Previous Next
Reported by: Barry OReilly <gundaetiapo <at> gmail.com>
Date: Wed, 19 Feb 2014 22:17:01 UTC
Severity: normal
Tags: moreinfo
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 16818 <at> debbugs.gnu.org (full text, mbox):
> At the end is a patch to implement this. I wrote the marker-tests to
> make sure I didn't break anything too badly, they pass with or without
> the rest of the patch. The new undo-test-mark-adjustment implements
> the recipe of this bug report. It fails with current trunk and passes
> with the patch.
Thinking more about this, I think this is fixing the symptom, but not
the cause. The cause is that primitive-undo shouldn't blindly
obey a (MARKER . OFFSET) entry. Instead it should only obey it if the
marker still points at the corresponding place.
Your patch works around the problem by trying to avoid moving the mark
(creating new markers each time instead) but that doesn't fix the
problem for the other markers.
Problem is: the undo log format as it stands does not record in
a reliable way what was the marker's position at that time, so it's not
easy to figure out whether the marker is still at the "same place"
or not.
This said, in practice, those (MARKER . OFFSET) entries are only
introduced for text deletion. So we should normally find them
immediately after a (STRING . POS) and those (MARKER . OFFSET) should
only be applied if that MARKER was at POS before undoing the deletion
of STRING.
IOW, I think the right fix is to change primitive-undo's handling of
(STRING . POS) by first looking at subsequent (MARKER . OFFSET) entries
and dropping those whose MARKER is not currently at POS.
WDYT?
Stefan
This bug report was last modified 4 years and 171 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.