From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71819: Incorrect substitution when undo replacing regexps Date: Sat, 29 Jun 2024 14:52:34 +0300 Message-ID: <867ce8j799.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19400"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71819@debbugs.gnu.org To: Sab Pyrope , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 29 13:53:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sNWdu-0004kr-If for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jun 2024 13:53:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNWdc-00059d-MW; Sat, 29 Jun 2024 07:53:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNWda-00059P-Q3 for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:53:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNWda-0003Iz-GA for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNWda-0005Xx-0h for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2024 07:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2024 11:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71819 X-GNU-PR-Package: emacs Original-Received: via spool by 71819-submit@debbugs.gnu.org id=B71819.171966196521298 (code B ref 71819); Sat, 29 Jun 2024 11:53:01 +0000 Original-Received: (at 71819) by debbugs.gnu.org; 29 Jun 2024 11:52:45 +0000 Original-Received: from localhost ([127.0.0.1]:37248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWdJ-0005XR-1T for submit@debbugs.gnu.org; Sat, 29 Jun 2024 07:52:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWdH-0005XE-3V for 71819@debbugs.gnu.org; Sat, 29 Jun 2024 07:52:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNWdB-0003H0-Kk; Sat, 29 Jun 2024 07:52:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZDE68/ODKL5/Kc6+Kzdb0xH8th5W2Xine7AUx7gm0tM=; b=FcSbzuFTIbAB ZHPI9UPgGVs+ySXHZu38/9+2cST8CYoQBkDGR2Pp2L39xRIrhhIzSquJn7OElY1zMkjkO7VSh/IMZ 6OnBlakhmdZeK0OK4akmUqcfuryPIhdfQOovjslVgsXSmVMKBxlygytRqFZcj3CkKLbKd9ofVe3dl /Lpq7bJbnVsntoeMnCcecNAtnWHBQ8Gi380wcxH3+sYs0TqEahP/wdi9VJG0K2Nrlvv9217DB51tP EyDG4JATflMXbrO8ZNKY0Zy8d/h1eR1RNjg1GpgD+CbiYNbg6+DG1PVg4luzU2FsrTShIvG0UUQZT H5rGswU+lUVXvDRlRZ9SoA==; In-Reply-To: (message from Sab Pyrope on Fri, 28 Jun 2024 08:57:03 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288108 Archived-At: > From: Sab Pyrope > 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?