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: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21523 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: bug#21523: 25.0.50; Undo with active region adds extra text
Date: Wed, 18 Aug 2021 15:31:36 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Is signaling an error okay?

Yup.

> Because then it looks like an off-by-one
> error somewhere -- the following slightly modified recipe works as
> expected:
>
>   emacs -Q
>   C-u 23 M-g c ; go to "text"
>   M-c
>   C-f          ; the crucial difference!
>   C-SPC
>   C-e
>   C-/
>     => user-error: No further undo information for region
>
> So the problem seems to be that in the original recipe the region
> starts immediately after the end of the modified portion of text.

Yup; I'm seeing the same thing, so this does indeed look like a
off-by-one error.  And...  it's in `undo-elt-in-region', I think, called
by (basically) (undo-make-selective-list (mark) (point)).

There's basically no test cases for this function, I think?

Actually, the problem seems to be in undo-adjust-elt, which was
rewritten in 2014 to fix bug#17235.

I've now added a test case (commented out), but I don't quite understand
the logic in undo-adjust-elt...  anybody see something obviously wrong?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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