all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: tino.calancha@gmail.com, Juri Linkov <juri@linkov.net>
Cc: 71819@debbugs.gnu.org, sab.pyrope@gmail.com
Subject: bug#71819: Incorrect substitution when undo replacing regexps
Date: Sat, 13 Jul 2024 12:59:46 +0300	[thread overview]
Message-ID: <86y165k3xp.fsf@gnu.org> (raw)
In-Reply-To: <86o77ipwyw.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 30 Jun 2024 19:25:11 +0300)

Ping!  Tino, can you please look into this issue?

> From: Juri Linkov <juri@linkov.net>
> Cc: Tino Calancha <tino.calancha@gmail.com>,  Sab Pyrope
>  <sab.pyrope@gmail.com>,  71819@debbugs.gnu.org
> Date: Sun, 30 Jun 2024 19:25:11 +0300
> 
> >> 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.
> >> ---
> >
> > 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?
> 
> This is caused by the commit 30c4f35a6fc8 that introduced these lines:
> 
>   (when regexp-flag
>     (setq next-replacement (nth 4 elt)))
> 
> Maybe Tino knows how to fix this (Cc'ed).
> 





      reply	other threads:[~2024-07-13  9:59 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
2024-06-30 16:25   ` Juri Linkov
2024-07-13  9:59     ` Eli Zaretskii [this message]

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=86y165k3xp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71819@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=sab.pyrope@gmail.com \
    --cc=tino.calancha@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.