From unknown Thu Sep 18 18:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#56522: 28.1.50; Mismatch data after replace undo Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: tino.calancha@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jul 2022 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56522 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 56522@debbugs.gnu.org Cc: tino calancha X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: tino calancha Received: via spool by submit@debbugs.gnu.org id=B.16576485097324 (code B ref -1); Tue, 12 Jul 2022 17:56:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2022 17:55:09 +0000 Received: from localhost ([127.0.0.1]:43632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBK6H-0001u3-Cw for submit@debbugs.gnu.org; Tue, 12 Jul 2022 13:55:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:47322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBK6E-0001tv-QM for submit@debbugs.gnu.org; Tue, 12 Jul 2022 13:55:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBK6E-0006qo-IM for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2022 13:55:06 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:42641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBK6C-0004H3-Qt for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2022 13:55:06 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B6A7A1BF205 for ; Tue, 12 Jul 2022 17:55:01 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET Date: Tue, 12 Jul 2022 20:46:37 +0300 Message-ID: <86v8s21awy.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) X-Debbugs-CC: Tino Calancha Something is wrong with next-replacement that is not updated after Undo in perform-replace. The minimal test case: 1. add to a buffer such text: a! b? . 2. then invoke query-replace-regexp with such regexp: Query replace regexp: \([!?]\) → <\1> 3. then type: y u n y (i.e. yes, undo, no, yes - that should undo, leave the first match unchanged, and replace the second) 4. observe the result: a! b . i.e. the match data in next-replacement for the second match comes from the first match.