bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#21523: 25.0.50; Undo with active region adds extra text


From: Stefan Monnier
Subject: bug#21523: 25.0.50; Undo with active region adds extra text
Date: Sun, 20 Sep 2015 11:14:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> `C-_' to undo the last change within the region.
> The word "that" is inserted, giving this:
>   ;; then enter the text in Thatthat file's own buffer.
> This seems disconcerting, at least.  (Same behavior for `M-u' etc.)

Indeed, that's wrong.  I haven't looked in detail of why this happens,
but I can guess that it's because the previous change is represented as
"insert That" and "remove that", and when we undo them, the exact
location of "remove that" ends up right at the region boundary, making
it unclear whether it should be considered as "inside" or "outside".

Not sure how best to fix it.  Maybe such replacements should have
a special status in the undo-list, so they aren't considered as
two independent changes (remove+insert) but as a single one.

Or maybe the "undo-in-region" should only ever undo complete steps
(i.e. everything between two undo boundaries), so if any part of an undo
step affects text outside of the region, then the whole step is skipped.


        Stefan





reply via email to

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