GNU bug report logs - #21523
25.0.50; Undo with active region adds extra text

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 20 Sep 2015 07:42:01 UTC

Severity: minor

Tags: confirmed

Found in version 25.0.50

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 21523 <at> debbugs.gnu.org
Subject: bug#21523: 25.0.50; Undo with active region adds extra text
Date: Sun, 20 Sep 2015 11:14:29 -0400
> `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




This bug report was last modified 2 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.