unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Drew Adams <drew.adams@oracle.com>
Cc: 21523@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	[thread overview]
Message-ID: <jwvwpvlqkh0.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <48592862-1630-4c61-aeed-1e3b720824de@default> (Drew Adams's message of "Sun, 20 Sep 2015 00:34:06 -0700 (PDT)")

> `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	other threads:[~2015-09-20 15:14 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 [this message]
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
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=jwvwpvlqkh0.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=21523@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).