From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21523@debbugs.gnu.org
Subject: bug#21523: 25.0.50; Undo with active region adds extra text
Date: Wed, 18 Aug 2021 15:31:36 +0200 [thread overview]
Message-ID: <878s0ydglj.fsf@gnus.org> (raw)
In-Reply-To: <831r6t8i8i.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Aug 2021 19:30:37 +0300")
Eli Zaretskii <eliz@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
next prev parent reply other threads:[~2021-08-18 13:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-20 7:34 bug#21523: 25.0.50; Undo with active region adds extra text Drew Adams
2015-09-20 15:14 ` Stefan Monnier
2015-09-20 18:26 ` Richard Stallman
2015-09-20 19:43 ` Stefan Monnier
2021-08-16 12:39 ` Lars Ingebrigtsen
2021-08-16 13:13 ` Eli Zaretskii
2021-08-16 13:53 ` Lars Ingebrigtsen
2021-08-16 16:30 ` Eli Zaretskii
2021-08-18 13:31 ` Lars Ingebrigtsen [this message]
2022-05-05 14:37 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878s0ydglj.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=21523@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).