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#61091: 30.0.50; y-or-n-p clobbers match data Date: Fri, 27 Jan 2023 09:52:43 +0200 Message-ID: <83bkmkct2s.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61091@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 27 08:54:23 2023 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 1pLJZ1-0005xx-00 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Jan 2023 08:54:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLJYj-00073L-21; Fri, 27 Jan 2023 02:54:05 -0500 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 1pLJYh-00073B-75 for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 02:54:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLJYg-0001LZ-Rn for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 02:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLJYg-0005qO-EY for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 02:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jan 2023 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61091 X-GNU-PR-Package: emacs Original-Received: via spool by 61091-submit@debbugs.gnu.org id=B61091.167480599222378 (code B ref 61091); Fri, 27 Jan 2023 07:54:02 +0000 Original-Received: (at 61091) by debbugs.gnu.org; 27 Jan 2023 07:53:12 +0000 Original-Received: from localhost ([127.0.0.1]:36637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLJXs-0005os-J1 for submit@debbugs.gnu.org; Fri, 27 Jan 2023 02:53:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLJXq-0005oc-Lj for 61091@debbugs.gnu.org; Fri, 27 Jan 2023 02:53:10 -0500 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 1pLJXl-0001Gk-A6 for 61091@debbugs.gnu.org; Fri, 27 Jan 2023 02:53:05 -0500 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=vxgYJS3l/ZpCGQrczOn3il/cCaSOvs82n6r2+5HCt18=; b=OpWEbhHIXDOX Y37xp7l6fD7TYL476U9pt8/zEWOOwoLq9zuresZOlqujmG2C2SUh/j7xeyCA0tsk2cVv1szeNG/S+ ZZnQZ9vxkSz51x4VDN+Ep641Ukji8lFoC5ufVTINlhzxx0yhc/P7DxhW8qGGQ5wbbq3RUXDzTESuS tkmpNc8bpkGKPB8u4wEct0GfAPvxrd5fbjqRsksfP6xMmusIRnmxh0HzFhNXFOvX/j8AMZWcx/d9X bYxCAhoy2S8UNPJpNakZhhBIwTFxIakrtjGkkqBrDwQLYk1x2uIXMr/IyH2F+qFfH52f36YLmMBx5 SIBPZb+NiI4SLRDEK/4hYw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLJXe-0005BM-8j; Fri, 27 Jan 2023 02:52:58 -0500 In-Reply-To: (message from Richard Stallman on Thu, 26 Jan 2023 23:05:10 -0500) 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:254246 Archived-At: > From: Richard Stallman > Date: Thu, 26 Jan 2023 23:05:10 -0500 > > I find in some of my personal code that calls to y-or-n-p > clobber the match data. That code worked ok when I first wrote it, > and for several years after that. Putting (save-match-data...) > around the call to y-or-n-p seems to fix it. > > Did some recent change cause y-or-n-p to do searches > and not save the match data? y-or-n-p originally was implemented in C and was relatively simple. Since then it was moved to Lisp and became a monster, see subr.el. It is anyone's guess where in that code we clobber the match data. Given a test case, we could debug and find what does this, but is it really worth our while? In general, Lisp programs should not rely on any function not to clobber match data, unless that function is documented to preserve match data.