all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sab Pyrope <sab.pyrope@gmail.com>, Juri Linkov <juri@linkov.net>
Cc: 71819@debbugs.gnu.org
Subject: bug#71819: Incorrect substitution when undo replacing regexps
Date: Sat, 29 Jun 2024 14:52:34 +0300	[thread overview]
Message-ID: <867ce8j799.fsf@gnu.org> (raw)
In-Reply-To: <CAAPpjjObXeH1+pdYt4xKt0kaROufrP0_6ggR7EZNtvCEJ_znUg@mail.gmail.com> (message from Sab Pyrope on Fri, 28 Jun 2024 08:57:03 +0800)

> From: Sab Pyrope <sab.pyrope@gmail.com>
> Date: Fri, 28 Jun 2024 08:57:03 +0800
> 
> I encountered a bug when replacing regular expressions.
> If you [u]ndo a previous change during the replacement process, subsequent changes to the \2 substitution
> will use the old undone result.
> 
> Text:
> ---
> Aaaaa. Bbbb.
> Ccccc. Dddd.
> Eeeee. Ffff.
> Ggggg. Hhhh.
> ---
> Input regexp: \([.]\) \([A-Z]\)
> Output regexp: \1  \2
> Bug:
> 1. Copy the text above to the buffer.
> 2. Enter the regular expressions to the interactive regexp replacement [C-M-%].
> 3. Click [y] twice until the Ffff is highlighted.
> 4. Cancel the previous replacement via [u].
> 5. Continue replacing [y] until the end.
> 6. Notice that all sentences except the first and second now begin with an incorrect letter D, which is not
> implied by the entered regexp, it should be F and H, as if it had been replaced, but without being undoed in
> the middle of the process.
> Output:
> ---
> Aaaaa.  Bbbb.
> Ccccc.  Dddd.
> Eeeee.  Dfff.
> Ggggg.  Dhhh.
> ---

Thanks.

This is a regression between Emacs 26 and Emacs 27, perhaps as a side
effect of fixing bug#36328.  Juri, could you please take a look?





  reply	other threads:[~2024-06-29 11:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28  0:57 bug#71819: Incorrect substitution when undo replacing regexps Sab Pyrope
2024-06-29 11:52 ` Eli Zaretskii [this message]
2024-06-30 16:25   ` Juri Linkov
2024-07-13  9:59     ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867ce8j799.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71819@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=sab.pyrope@gmail.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.