From unknown Sun Jun 22 00:01:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#61091 <61091@debbugs.gnu.org> To: bug#61091 <61091@debbugs.gnu.org> Subject: Status: 30.0.50; y-or-n-p clobbers match data Reply-To: bug#61091 <61091@debbugs.gnu.org> Date: Sun, 22 Jun 2025 07:01:50 +0000 retitle 61091 30.0.50; y-or-n-p clobbers match data reassign 61091 emacs submitter 61091 rms@gnu.org severity 61091 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 26 23:05:17 2023 Received: (at submit) by debbugs.gnu.org; 27 Jan 2023 04:05:17 +0000 Received: from localhost ([127.0.0.1]:36542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLFzI-00086p-Fk for submit@debbugs.gnu.org; Thu, 26 Jan 2023 23:05:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:33332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLFzF-00086d-5o for submit@debbugs.gnu.org; Thu, 26 Jan 2023 23:05:15 -0500 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 1pLFzE-0003xI-Ve for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 23:05:13 -0500 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 1pLFzD-0005Hh-Ud for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 23:05:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:Subject:To:From:mime-version:in-reply-to: references; bh=v7vDNEmqL830uyHifhWgZpWPlZYk7fdPF7NEBUQxnKU=; b=V8LA7YDznrVcGW d2j1GTwYhg6kbndHDOK6kGvOcO12OaVivETbi0+ZlUNVWgmKeI6FXUvN8lZkEOb8T2jitA+2zoRki rvO8luSoyxDFYJh0tt6SPs7+nXge3o0Qqbvb1B9fYC4luLSzzUpk9JjqkiSEeFHRYASKF5a8BqTYb /pVJmLsCc962Wak/ON4hIujMXOqFkN6/vHJb2O9n6bntrlsdLIlraM+TYautHjXlpOVc5CjkrhBev DwgEH3F+bpOUd918oHMwCOsSb4PRgcY2AL5AUNditqB7s1XZ8ybXhKT/ucqRYac6YavWbVWYZ8gxb FkO0oYTq2NAmuxqkXc3A==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1pLFzC-0005XT-NR; Thu, 26 Jan 2023 23:05:10 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: bug-gnu-emacs@gnu.org Subject: 30.0.50; y-or-n-p clobbers match data Message-Id: Date: Thu, 26 Jan 2023 23:05:10 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit 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: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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? I will work up a test case for you if necessary, but that will be a pain. I hope with this info that work can be avoided. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.16.0) of 2022-12-28 built on freetop Repository revision: efc44727daaee4d3f9aeb19864074472e99b296a Repository branch: master System Description: Trisquel GNU/Linux Nabia (10.0) Configured using: 'configure x86_64-linux-gnu 'CFLAGS--O0 -g' --with-gnutls=ifavailable' Configured features: CAIRO DBUS FREETYPE GIF GLIB GPM GSETTINGS HARFBUZZ JPEG LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK2 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: RMAIL Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t auto-composition-mode: linux auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow emacsbug cus-start cus-load compare-w warnings icons shortdoc log-edit add-log vc smerge-mode whitespace diff vc-git diff-mode vc-dispatcher bug-reference sh-script rx executable jka-compr rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-enc xmltok parse-time iso8601 vc-cvs vc-rcs log-view easy-mmode pcvs-util mhtml-mode css-mode smie eww xdg url-queue mm-url gnus nnheader range wid-edit color js treesit imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode facemenu mule-util display-line-numbers novice cl-extra edmacro kmacro format-spec help-fns radix-tree cl-print debug backtrace find-func rect quail help-mode ispell rmailkwd dabbrev misearch multi-isearch epa-mail shell pcomplete thingatpt files-x grep compile comint ansi-osc ansi-color ring rmailout textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check shr pixel-fill kinsoku url-file svg xml dom mailalias qp rmailmm message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231 dired-aux dired dired-loaddefs term/linux view derived disp-table advice rmailsum rmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils finder-inf package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 870629 121082) (symbols 48 20781 23) (strings 32 109387 13559) (string-bytes 1 2505004) (vectors 16 70750) (vector-slots 8 1692165 149404) (floats 8 248 410) (intervals 56 99582 2823) (buffers 976 110)) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 02:53:12 2023 Received: (at 61091) by debbugs.gnu.org; 27 Jan 2023 07:53:12 +0000 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 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 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==; 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 Date: Fri, 27 Jan 2023 09:52:43 +0200 Message-Id: <83bkmkct2s.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Thu, 26 Jan 2023 23:05:10 -0500) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org 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: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 09:38:27 2023 Received: (at 61091) by debbugs.gnu.org; 27 Jan 2023 14:38:27 +0000 Received: from localhost ([127.0.0.1]:36974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLPs3-00051x-3e for submit@debbugs.gnu.org; Fri, 27 Jan 2023 09:38:27 -0500 Received: from mout.web.de ([212.227.15.4]:47781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLPry-00051f-B6 for 61091@debbugs.gnu.org; Fri, 27 Jan 2023 09:38:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1674830295; bh=MW4PpYKdLMiiOToEdXL/NcIhpv23VxYigZFCaEaIT7w=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=VOahhzinIZZVarBDrZ4makEjAhRmmVdpoTqCM8o4KFEoQkhGu7IEnzs4T2dYcVRC6 MlPZpbh5tdcHr3H7ksRLBraqgIaWHp9nhPputr2ldIf+r8d7lEhqnS2WM9z2HKxH29 9BaTRk1I/Epv7qC2+LU5j9cwTbUZzm2I8GNJ+YS4xQStySCr34Edv0R6YpvlRHWIiJ 4j2mVEZwQuSf6FqWpZoyHJO71h2XOHcVvWOBCD+5utnJmbQZY7rracb0ljSFfCzMpU 4HjAW1nmXdIFBt5qSZS+KHH3dlObVs3YNl4JWjKVoHjEluvWL9tHfUyYqxcZSR84Em lojm2cA5DFWAw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.59.210.57]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnFy4-1ovwx92asG-00jGag; Fri, 27 Jan 2023 15:38:15 +0100 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data In-Reply-To: <83bkmkct2s.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Jan 2023 09:52:43 +0200") References: <83bkmkct2s.fsf@gnu.org> Date: Fri, 27 Jan 2023 15:38:14 +0100 Message-ID: <87cz70jb55.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:VKNfmFjApneYVpvUJAGfeCxMGyyWUPmhk4y0hG3Aam1h4ExT5OZ PJ+KrcE8Zv1o10owUdJ2VSch7R61GbvGxALJ6j04eMCS13LYQ7LBgy09lNJJlP3MyU2dkTg XecnHzDJr313oBVIarWRr643O2OlBa81M2KHttKtvpTpRoC0lHJ270K2zlqpQYj5N0mktjM vIj9c33PISHm9OKxf8YLg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:DeEzF8LbNWE=;nR2KJX6dn7mIFjAUvMiK3HrGqoq wMPDdD1fqyFExDYmm4VcG3QvXxdP9HiO8veLWwX/1Aq/AqSMj+ofy29jQT7Bog4ITRAy2oc+r kKS8z6ia/m0rKQb+KU2EmOfFzAqrEeMneL/rfnmgDqCzy02QL6EbHXxhiJVsLHDN7ME4n3eyb Y6YKafs2oRrH+kimXASCSapD0aLJbK77Tl64933HmsKUXjqjPWraWBPBB65w2MNvdX4Tkb2T0 UV7DpSuHxX+gPwY5RpmuZrL+nsOXEb6jE3E9bGwXCXbEpbiankgqcQ/5yLEfrDDbHWMvvTbfz O0i1KDJ0V9Jf0T+iDh7pdJ24NFCdfeKW6adukDHMlzmfKdd9+0Qv6YRA900fY3G3aIshtS59A f7I8QFH1lVyF2vD8+Pvtr14lRa4EKknqGd7qwK99Dhl9Fp4beMqQBjoUiz27NCr38/S2Skjb+ jAo1b2PYJdm4uXENT4cYhElCLV/FCUl7NyAA9OoQtVGq0WSmCoDla5RO86NJPMmchp+vxbR+q rwNxW01oECahmWuPxiHmV2/c1Y3qwTcvnGeKA/m14rIXRs+IQ5aqyL3jz8M8BSm3HZZEU38ev LrwoQ1IMQgORLbuIScTCvGx02kko/AECtsIw1jsRmecjBEgJ4qVfs2SDUBIySDPX1m6/0tx+i zr+1F3/MfNGlfflQXbakJUHGtHvoR8JDLO4IQKztVCAoZzlFz+neUGSE/MdO5lQ1cvnsacSi2 h+hhEAdNzJqv8u94iTlnFv6CJGTTYMB5DONYANACX20CBYRmB3Vsr+HZezR5CBmH2FX8WtxjL oTXNxtdzdbAFCb9ZYmBKpmzwpY0sx6bnzrit8pUDkmtH/pPX4dhvdVAiEdZ08dDI8xh2PpJtF tlbywgw74CKnaBbZYFFL/gPeGqRJsBbbTBMw3LqGqCUlv132H9VbTYoVKjfGfysLtkMhEnDgO WGbAycsZ9gxehQKVj8yWA1+5eH0= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org, rms@gnu.org 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: -1.7 (-) Eli Zaretskii writes: > 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. I see that the code calls `substitute-command-keys' which potentially changes match data. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 10:00:53 2023 Received: (at 61091) by debbugs.gnu.org; 27 Jan 2023 15:00:53 +0000 Received: from localhost ([127.0.0.1]:38238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLQDl-0005vP-5r for submit@debbugs.gnu.org; Fri, 27 Jan 2023 10:00:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLQDi-0005vA-Eg for 61091@debbugs.gnu.org; Fri, 27 Jan 2023 10:00:51 -0500 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 1pLQDc-00044j-SQ; Fri, 27 Jan 2023 10:00:44 -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=kbVozwK2zt6ymPfVhpg5MOMMb/jmjZA2EF5bZUZOuUs=; b=n7wBVdJ0WFIP cBQw/I+eT0k93URifKBqxzu9e6431vMbudLmlPR7YOdWuM+r7tg8SJ/CB6dEFRCcEoRC5lJ+8P0IX 7kmMn0IXx7D3qGQ1x9j7T5+vYEMvPhKeFwzQVYvB+053j6Rsi3FlwnlJy27whrVg2LZBJtP3IM+69 0K5b8Pa+3jD8k+PoPK1SqNtVdUxQyA1sV9p4RB4nae9kadA8TwwbtD2fnbCeeh6WqRb9UwIUzcWYx CsvaVYKSLVE5AKKNG/2rN8zrDxeXIt3wAiABg2UUU8yGqIQHM6wZmDYHpf4HN0390P6rX7XHfBwZk pyG7oIahnA60htaGf32yNA==; 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 1pLQDW-0002to-Sn; Fri, 27 Jan 2023 10:00:39 -0500 Date: Fri, 27 Jan 2023 17:00:24 +0200 Message-Id: <83357wc99z.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87cz70jb55.fsf@web.de> (message from Michael Heerdegen on Fri, 27 Jan 2023 15:38:14 +0100) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: <83bkmkct2s.fsf@gnu.org> <87cz70jb55.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org, rms@gnu.org 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: -3.3 (---) > From: Michael Heerdegen > Cc: rms@gnu.org, 61091@debbugs.gnu.org > Date: Fri, 27 Jan 2023 15:38:14 +0100 > > Eli Zaretskii writes: > > > 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. > > I see that the code calls `substitute-command-keys' which potentially > changes match data. Yes, that's also my prime suspect. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 00:18:36 2023 Received: (at 61091) by debbugs.gnu.org; 29 Jan 2023 05:18:36 +0000 Received: from localhost ([127.0.0.1]:41949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM05M-0002Eu-Gz for submit@debbugs.gnu.org; Sun, 29 Jan 2023 00:18:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM05H-0002Ec-N1 for 61091@debbugs.gnu.org; Sun, 29 Jan 2023 00:18:35 -0500 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 1pM05C-0004pg-Gx for 61091@debbugs.gnu.org; Sun, 29 Jan 2023 00:18:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=WXf+gO5Bpuzjj9JjKdfj7wBZTH1CI1e82GWE1MHheE8=; b=H9Q8OAE4yKWX v7frjD7t6bVQg4tyVI7wv9A9V6Uj1his4dPH6iCYjgwtpaIyLLtrUfCFY/CyKB76erD1fu8KTSxp4 Y41q2uaSbxJCMgNvU2cHQHsaGscZ5QRgZAqh+0kKllirayBDE3fA7IW6CblvCNf0XNEwLBVb+/IdJ vBhAZ2kU+fRSZfXRKNNSLJSBuZ+h/+9yC6ElXZSS6GhNZs57CSIPKH0oyj7Ogujichg9GrMghPaBA 2BS3c3o/TxxvwDSCYL9UhazWMO2OOPL2J12RUPRLzylzHacc1xPW2ON+Fn5u5TUoM81/IG381KbJK exNYi+9bnRoa7rVpxTr2uQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1pM05A-0003O6-P4; Sun, 29 Jan 2023 00:18:26 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83bkmkct2s.fsf@gnu.org> (message from Eli Zaretskii on Fri, 27 Jan 2023 09:52:43 +0200) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: <83bkmkct2s.fsf@gnu.org> Message-Id: Date: Sun, 29 Jan 2023 00:18:24 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org 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: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > In general, Lisp programs should not rely on any > function not to clobber match data, unless that function is documented > to preserve match data. Allowance should be made for the fact that `y-or-n-p' was safe for the match data for over 35 years. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 01:41:09 2023 Received: (at 61091) by debbugs.gnu.org; 29 Jan 2023 06:41:09 +0000 Received: from localhost ([127.0.0.1]:42088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM1NF-0004fb-0V for submit@debbugs.gnu.org; Sun, 29 Jan 2023 01:41:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM1NC-0004fB-U7 for 61091@debbugs.gnu.org; Sun, 29 Jan 2023 01:41:07 -0500 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 1pM1N7-00007n-A2 for 61091@debbugs.gnu.org; Sun, 29 Jan 2023 01:41:01 -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=JQakayZobfT8MFoPSIz60lJBsE8h4V7IRm8/1xy9TJ8=; b=RpiRK1jf16Ui 7QdYgYdOLZlt82MsKYs+6HxKQgl/RFH5H7RAQcApd/4K3NnL4L36iwWlyihL71cZ499EMBmA7k+lp hAXgIBVWwStqZn2uLYNnsG+TOx4AgXfmm9Kv+i4yeOli4eVK1afSnVCVVOi/y+cjf0cibpBdCBgPt 7LbX/Li96WGJJAw3BEUIec+0m+PJ4QvLMFRopFv27l5ZRyIRe5qOOR7yx9jC4d/EnTIIUNbjV+Oke BMTw9hzrwFrbbpVk+52IFjnG8yrAmGU4r2V6FlqORT5Jj7CJS3tS/l2uoQOzWHGVzcl9HaKok60JF ecfdk+6tUQnds7N0xobOZw==; 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 1pM1Mu-0004bR-Vu; Sun, 29 Jan 2023 01:40:49 -0500 Date: Sun, 29 Jan 2023 08:40:39 +0200 Message-Id: <83ilgp972w.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Sun, 29 Jan 2023 00:18:24 -0500) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: <83bkmkct2s.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org 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: -3.3 (---) > From: Richard Stallman > Cc: 61091@debbugs.gnu.org > Date: Sun, 29 Jan 2023 00:18:24 -0500 > > > In general, Lisp programs should not rely on any > > function not to clobber match data, unless that function is documented > > to preserve match data. > > Allowance should be made for the fact that `y-or-n-p' > was safe for the match data for over 35 years. I don't object if it's easy to do so. But we decided long ago that significant efforts for that purpose are not worth our while, and even documented this in the ELisp reference manual. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 00:15:34 2023 Received: (at 61091) by debbugs.gnu.org; 4 Feb 2023 05:15:34 +0000 Received: from localhost ([127.0.0.1]:40409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOAti-0004r5-2q for submit@debbugs.gnu.org; Sat, 04 Feb 2023 00:15:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOAtf-0004d8-Rw for 61091@debbugs.gnu.org; Sat, 04 Feb 2023 00:15:32 -0500 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 1pOAtZ-0007zX-BN for 61091@debbugs.gnu.org; Sat, 04 Feb 2023 00:15:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=yMWQq0Wr18d3PDwVJWFnA0S2tcbFZLwr1OAN2q6nAJk=; b=lHz6V0bWL7Xk DrpoXCB0TCS+NtTNU3EyIAX1aodjhWhPA/EY0Nt3c7o4T9pAyUig6ucyxJpq58mAYkCC248iabnvM hjtKD0nauv/7W+STk87e/7DFnbbpfI4hLHoAg0HBZBfAzHjy+FNepL7JCV1OHyWEqx5I1y1OegEOa lxF4YBEo8HeJ8B9/MD5amlJtEpvuW2MgjGKAZ322MurbnCN87BguAzecrsC1R7HYyTSOlUjoE/UJl jB7IX9Pu9sMqtyyADRju/3GH9sCxtiFmWu5UcD4WA2Arwj1y5W6xT7/1tXjPBo8dj3oHD5y9XCPDr aOzodL5ByazAE7iPLHTZuQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1pOAtY-0008CG-Ku; Sat, 04 Feb 2023 00:15:24 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Eli Zaretskii In-Reply-To: <83ilgp972w.fsf@gnu.org> (message from Eli Zaretskii on Sun, 29 Jan 2023 08:40:39 +0200) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: <83bkmkct2s.fsf@gnu.org> <83ilgp972w.fsf@gnu.org> Message-Id: Date: Sat, 04 Feb 2023 00:15:24 -0500 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091 Cc: 61091@debbugs.gnu.org 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: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > Allowance should be made for the fact that `y-or-n-p' > > was safe for the match data for over 35 years. > I don't object if it's easy to do so. I think it should be easy. How about trying it? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 03:17:02 2023 Received: (at 61091-done) by debbugs.gnu.org; 4 Feb 2023 08:17:02 +0000 Received: from localhost ([127.0.0.1]:40603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODjK-0007PS-4J for submit@debbugs.gnu.org; Sat, 04 Feb 2023 03:17:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODjG-0007P2-Cv for 61091-done@debbugs.gnu.org; Sat, 04 Feb 2023 03:17:00 -0500 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 1pODjB-0005hk-5X for 61091-done@debbugs.gnu.org; Sat, 04 Feb 2023 03:16:53 -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=aOvm8SdAMF/9DI/GdT7uMwebAEhEAP/yf8IAY2bi37U=; b=M0/g5MrDsbnR yjEUdO5kSSL4fCyDUFkBzIakcnfuOLAH0IfTUqq2e1gx6TV5veTnRA7O1z7INRjigLuN6lVq3XJTS L5UKNLQY9ctT3gkY3qJDyqAwCHvKwy8Xzds+9H+I7QZiPhF2NODo/v+/hBU22K4UUmbtzjwqqbLBC sou/PJWL9rhwEzTAnSVXPBphd0bVTFY5Y8M77/rmw2+czzMdOH6y/GiissvML+r0BJQ5fJ/y1MvKR 48CCgHgPhct0pKmF1yYZ0i8lfdielplx1u3cSTZoyY+h5W4bUjiaKvFH9JRAP5Jg5sOOWMrYrLDVi 84IKKlKMn7ds/Dp2MS6VjA==; 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 1pODj5-0007he-35; Sat, 04 Feb 2023 03:16:47 -0500 Date: Sat, 04 Feb 2023 10:16:54 +0200 Message-Id: <83357lvo95.fsf@gnu.org> From: Eli Zaretskii To: rms@gnu.org In-Reply-To: (message from Richard Stallman on Sat, 04 Feb 2023 00:15:24 -0500) Subject: Re: bug#61091: 30.0.50; y-or-n-p clobbers match data References: <83bkmkct2s.fsf@gnu.org> <83ilgp972w.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61091-done Cc: 61091-done@debbugs.gnu.org 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: -3.3 (---) > From: Richard Stallman > Cc: 61091@debbugs.gnu.org > Date: Sat, 04 Feb 2023 00:15:24 -0500 > > > > Allowance should be made for the fact that `y-or-n-p' > > > was safe for the match data for over 35 years. > > > I don't object if it's easy to do so. > > I think it should be easy. How about trying it? Done with the patch below. diff --git a/lisp/subr.el b/lisp/subr.el index 0f754fc..32c9974 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3573,12 +3573,14 @@ y-or-n-p (if (or (zerop l) (eq ?\s (aref prompt (1- l)))) "" " ") (if dialog "" - (substitute-command-keys - (if help-form - (format "(\\`y', \\`n' or \\`%s') " - (key-description - (vector help-char))) - "(\\`y' or \\`n') "))))))) + ;; Don't clobber caller's match data. + (save-match-data + (substitute-command-keys + (if help-form + (format "(\\`y', \\`n' or \\`%s') " + (key-description + (vector help-char))) + "(\\`y' or \\`n') ")))))))) ;; Preserve the actual command that eventually called ;; `y-or-n-p' (otherwise `repeat' will be repeating ;; `exit-minibuffer'). From unknown Sun Jun 22 00:01:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Mar 2023 12:24:17 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator