From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Gabriele Nicolardi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 07:20:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 71429@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17178311657962 (code B ref -1); Sat, 08 Jun 2024 07:20:04 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2024 07:19:25 +0000 Received: from localhost ([127.0.0.1]:51785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFqMG-00024L-NT for submit@debbugs.gnu.org; Sat, 08 Jun 2024 03:19:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:38144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFqMC-00023Z-At for submit@debbugs.gnu.org; Sat, 08 Jun 2024 03:19:21 -0400 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 1sFq7A-0006b3-Ti for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:03:48 -0400 Received: from smtp06.cbsolt.net ([185.97.217.45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFq78-0001iu-8K for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:03:48 -0400 Received: from [10.0.2.15] (host-79-24-247-102.retail.telecomitalia.it [79.24.247.102]) by smtp06.cbsolt.net (Postfix) with ESMTPSA id 4Vx8DV1YJlz3wf4 for ; Sat, 8 Jun 2024 09:03:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1717830219; bh=/RG3P38j1g061va+T7bWpZA+MPmuSq6QnGuCoucT/SY=; h=Date:To:From:Subject:From; b=WNf8rZQzahmUZQ0eUvEoxtw14f3PbAuAE0/UTN5cXlD1M6+vn5qiGn9JfeJvNQhlJ ZwN3J0leT9d5bhISbWriPqEjb8fsMa8lzYqSUcIVGB+/GaKHNrey0BKHrUn8UWSall t2e8h//Iy4IYl969uddHJ01YLhxj3oW+s0BO0ZPQ= Content-Type: multipart/alternative; boundary="------------rU6IkDa6BSNsYet3G0WaLAwZ" Message-ID: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> Date: Sat, 8 Jun 2024 09:03:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Gabriele Nicolardi Content-Language: en-US Received-SPF: pass client-ip=185.97.217.45; envelope-from=gabriele@medialab.sissa.it; helo=smtp06.cbsolt.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.3 (-) 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.3 (--) This is a multi-part message in MIME format. --------------rU6IkDa6BSNsYet3G0WaLAwZ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I have the following Emacs Lisp code: |(progn (y-or-n-p "Test: ") (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) (y-or-n-p "Test: "))) | The first prompt from the |y-or-n-p| function appears as expected: |Test: (y or n) | However, the second prompt appears differently: |Test: (‘y’ or ‘n’) | I’m trying to understand why the second prompt format changes. What causes this inconsistency in the |y-or-n-p| prompt? I suspect it might be related to the |search-spaces-regexp| variable or how Emacs handles interactive prompts, but I’m not sure. Any insights or explanations would be greatly appreciated! Best regards, Gabriele Nicolardi ​ --------------rU6IkDa6BSNsYet3G0WaLAwZ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi,
I have the following Emacs Lisp code:

(progn
  (y-or-n-p "Test: ")
  (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?"))
    (y-or-n-p "Test: ")))

The first prompt from the y-or-n-p function appears as expected:

Test: (y or n)

However, the second prompt appears differently:

Test: (‘y’ or ‘n’)

I’m trying to understand why the second prompt format changes. What causes this inconsistency in the y-or-n-p prompt?

I suspect it might be related to the search-spaces-regexp variable or how Emacs handles interactive prompts, but I’m not sure. Any insights or explanations would be greatly appreciated!

Best regards,

Gabriele Nicolardi

--------------rU6IkDa6BSNsYet3G0WaLAwZ-- From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 08:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gabriele Nicolardi , Stefan Kangas Cc: 71429@debbugs.gnu.org Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171783511921019 (code B ref 71429); Sat, 08 Jun 2024 08:26:02 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 08:25:19 +0000 Received: from localhost ([127.0.0.1]:57194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFrO3-0005Sx-Cv for submit@debbugs.gnu.org; Sat, 08 Jun 2024 04:25:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFrO1-0005SR-84 for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 04:25:18 -0400 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 1sFrNe-0006ga-Ma; Sat, 08 Jun 2024 04:24:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=KxbIBZUM/6byageVCZDHcXgY2w3dDiwPUyYYO/A+OA8=; b=scFwlfXVZpb5aWps0NFL 8w+HIshfBpmIFFpxA9iSWjxjIGRVi2qHnKc2PziZjhIRbV0Cyne6uxApBZhFDh7sTWDbWtJX4J5cj Ppjbp6mbyJqoe5rupwIcPYhTdliWcbq9YJuh6olXk7ogyb2YZxFTNBmXEqG9IceP0jIc1bWbqxPgv c4GgC21krLa1v3bAdzHB4BXC+76lQCbgmJ6JG+gkYN0NHlNMjjkKZSEyOKzObixMBwRxOnuMYJUX7 MJZsOAZzisNV0IHCNlxrcXxGilLwhaVbIW9oB7kksE4fyAR/unyvXUar42IW6E/Y0HJAQLGTTQyXj 7FnNBhDjlLV6rQ==; Date: Sat, 08 Jun 2024 11:24:50 +0300 Message-Id: <86bk4bet9p.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> (message from Gabriele Nicolardi on Sat, 8 Jun 2024 09:03:37 +0200) References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > Date: Sat, 8 Jun 2024 09:03:37 +0200 > From: Gabriele Nicolardi > > I have the following Emacs Lisp code: > > (progn > (y-or-n-p "Test: ") > (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) > (y-or-n-p "Test: "))) > > The first prompt from the y-or-n-p function appears as expected: > > Test: (y or n) > > However, the second prompt appears differently: > > Test: (‘y’ or ‘n’) > > I’m trying to understand why the second prompt format changes. What causes this inconsistency in the > y-or-n-p prompt? > > I suspect it might be related to the search-spaces-regexp variable or how Emacs handles interactive > prompts, but I’m not sure. Any insights or explanations would be greatly appreciated! Stefan, can you please look into this? It sounds like some issue with substitute-command-keys: (substitute-command-keys "(\\`y' or \\`n') ") => #("(y or n) " 1 2 (font-lock-face help-key-binding face help-key-binding) 6 7 (font-lock-face help-key-binding face help-key-binding)) But (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) (substitute-command-keys "(\\`y' or \\`n') ")) => "(\\‘y’ or \\‘n’) " I actually don't understand why we use \\`y' and \\`n' in y-or-n-p. Why those backslashes, and not just `y' and `n'? That's your change in commit a36ecc408a. If I remove the backslashes, the results are identical whether or not search-spaces-regexp is let-bound. From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 09:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Gabriele Nicolardi , 71429@debbugs.gnu.org, Stefan Kangas Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171783844531628 (code B ref 71429); Sat, 08 Jun 2024 09:21:02 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 09:20:45 +0000 Received: from localhost ([127.0.0.1]:33331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFsFg-0008E3-HV for submit@debbugs.gnu.org; Sat, 08 Jun 2024 05:20:44 -0400 Received: from mout.gmx.net ([212.227.15.19]:44301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFsFc-0008DY-KH for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 05:20:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717838415; x=1718443215; i=stephen.berman@gmx.net; bh=fCTh9cgvh9RAd+b9WBHWo8+jmsouKaTnCMrx452zEF4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=K2ENijDxrM71J7ghGyifVkkUlWPS2LbQAP3XugQE+Q3GZe/KGrcx9nAqupedUM8s LQobeJT0FW/GjjCpEtJOX5eKWS7EXETcNqvRvgxTM2bJMJooHeKq4c9PDbzyPH3TE gRgXM3U0/mwX2ZZCOqptyq+COLafNkrjSQB4qD9zWU04bzRJGsFY2biL4j4tJJ2EM KbKM/Az/Ww8HSGIZtO5LDRO3VvOJWKzWTCr2TxnGohSBrPJXgy4Ttm7cpIW/NNaMF 6uiIRwI7Ls7+EsJSfF167uTqE25ZuvdoynMWlpwKXZFQMQ6DWpREVLaujzc9+bZy9 iCLYHFSelLA7lgsv9A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([94.134.94.137]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2mFi-1sPxTv1sTM-00x4G5; Sat, 08 Jun 2024 11:20:15 +0200 From: Stephen Berman In-Reply-To: <86bk4bet9p.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jun 2024 11:24:50 +0300") References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 08 Jun 2024 11:20:14 +0200 Message-ID: <87cyoreqpd.fsf@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:PQgxs6EK9bsYWf1bjO4+DxPKqclQMlnYTCG0ASSfyfls8DALTdk 8Q4Svm999iurafLQg12tAsRqu5bWRPik+ueOPv0frFRwDuBtLnKsoj/FnIyUDKCa3ivVRme qJXn4frQ1UIEDiZd7vPBPAGJiJKxg3q4ndulZmordKO3var5MTaYvBTRNCuTw7pd9A1HHdT AVXS346DRb58lVoYMbeOg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:HLn9dMJH8Uc=;+nrZnAARcw8eyPDCswY86OdiZfQ bG4GwmgsNheF0ATzTRtHr8xHyXPhL5ViLZabvUG+nUe0zZOtTagSzP5Ima5zS3NPlNWmmCa70 BhT6xgwlm91k0xKroE2H11+tTuYi1dkt8EpnNT7aP2n8067fJV9yqKVt+9ilF8mASY4P5grGE gSdBjUViBvNeNfNJlapxcLTnPDSvaFbvs+cxuT9k8Fi7Z46WMgOgpR6bkl+Rp4sEr+qpQD0Tk UKuxEpHjE2rBhLQ3NdGSuBZV4Qq030tT/3//pE/bc6S45NK7/xOzyr2dVpyPrrgeDUDW4qb+b 7tLaSC1YfqzR8VZTGFykdNGrcvuK8W6QHVqecY8t7S9DfZ6MbylQ8fjQEW8SZkDsdqQmwSZHj 5c0yEoVHxKTHgXGTmp7zn5218P8r5GBSrdIsd/Ka7DBEyRejERUalteP9gIfkUiPNP+mmsMTO v1+bFerisK5+Ituv89hL5NZHdxvSBsIdQkzLd/Lwu3N5tX4wrqJ8G93EUL0VcFjDepZ71H8Jz bIk1PtfGjQEh7xcpkcooLDb9hryDqlgfq87flyEYk8yytMluoLHLJo+rlowO/XFGQCPHUdLX9 JvhP1qFp2KQXx5/tibfJ6tMZoRHQIM3FufO0jyqv9pBrnVVY5eZ5rnoI793vJGB8txOEpKCsc qviLggIV8j4tRgczgDDoLHSa54TxcmYJLcuTo9wEczRJlhz9OS6DPxYiDz4Cx1RX6hB6fXSoO l9pjfu8HDODQ+P1HKwomYpkIAcPe4RosdVHa1IgVp82IPldKy4RMJ215PD5bcIpan6uvTXdA8 YGQfEOU+Ne6Pk9Tp9oZjGZzGz4QBjo21asOyhBhWK8xRs= X-Spam-Score: -0.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: -1.7 (-) On Sat, 08 Jun 2024 11:24:50 +0300 Eli Zaretskii wrote: >> Date: Sat, 8 Jun 2024 09:03:37 +0200 >> From: Gabriele Nicolardi >>=20 >> I have the following Emacs Lisp code: >>=20 >> (progn >> (y-or-n-p "Test: ") >> (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) >> (y-or-n-p "Test: "))) >>=20 >> The first prompt from the y-or-n-p function appears as expected: >>=20 >> Test: (y or n) >>=20 >> However, the second prompt appears differently: >>=20 >> Test: (=E2=80=98y=E2=80=99 or =E2=80=98n=E2=80=99) >>=20 >> I=E2=80=99m trying to understand why the second prompt format changes. W= hat causes this inconsistency in the >> y-or-n-p prompt? >>=20 >> I suspect it might be related to the search-spaces-regexp variable or ho= w Emacs handles interactive >> prompts, but I=E2=80=99m not sure. Any insights or explanations would be= greatly appreciated! > > Stefan, can you please look into this? It sounds like some issue with > substitute-command-keys: > > (substitute-command-keys "(\\`y' or \\`n') ") > =3D> #("(y or n) " 1 2 (font-lock-face help-key-binding face help-key-= binding) 6 7 (font-lock-face help-key-binding face help-key-binding)) > > But > > (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) > (substitute-command-keys "(\\`y' or \\`n') ")) > =3D> "(\\=E2=80=98y=E2=80=99 or \\=E2=80=98n=E2=80=99) " > > I actually don't understand why we use \\`y' and \\`n' in y-or-n-p. > Why those backslashes, and not just `y' and `n'? That's your change > in commit a36ecc408a. If I remove the backslashes, the results are > identical whether or not search-spaces-regexp is let-bound. Removing the final '?' in the regexp, i.e. (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)")) (y-or-n-p "Test: ")) results in the second prompt appearing like the first one. Likewise with '*', but not with '+': (let ((search-spaces-regexp " ?")) (y-or-n-p "Test: ")) =3D> Test: (\=E2=80=98y=E2=80=99 or \=E2=80=98n=E2=80=99) (let ((search-spaces-regexp " *")) (y-or-n-p "Test: ")) =3D> Test: (\=E2=80=98y=E2=80=99 or \=E2=80=98n=E2=80=99) (let ((search-spaces-regexp " +")) (y-or-n-p "Test: ")) =3D> Test: (y or n) (let ((search-spaces-regexp " ")) (y-or-n-p "Test: ")) =3D> Test: (y or n) Steve Berman From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 14:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Gabriele Nicolardi , 71429@debbugs.gnu.org, Stefan Kangas Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171785518425909 (code B ref 71429); Sat, 08 Jun 2024 14:00:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 13:59:44 +0000 Received: from localhost ([127.0.0.1]:39171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFwbf-0006jp-Im for submit@debbugs.gnu.org; Sat, 08 Jun 2024 09:59:44 -0400 Received: from mout.gmx.net ([212.227.15.15]:48671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFwbb-0006jY-Ri for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 09:59:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717855154; x=1718459954; i=stephen.berman@gmx.net; bh=jwa4Ca7Q3X18TPpgG2yzsO+XVolnVPZcwv3R41qpcDA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=C5R9el5dyE5Mqak1OOp/mf5aPUeUt8hide1XRbMXjwrI0KlIS7/Syy0OFWQwsR04 9DUT2S86TDs/45mZZpLUVjD/S0KxX3I0UC3fL6DUt0HMyfuv1oA0oJ4pkaVMJHAl5 YozcicXW9BcZ7gFQr9d/ZwCJCNP4v3Uj6jlkoHKSRqLghniqmuAtxeO1piPNPlDmi 6JDQo59i3OqDU6K0P7iUgD661mZoY0zER/5K/enqqrpB+RT0JTF5M1xqisF7/noJ0 a54yg8NpaZ64HdY+yx73eurQuQMP1bqNMvjlWdS2mfaKZ98klRIWKwUgcEB0vstAY duVMmPmrc58nuAZ5Zg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([94.134.94.137]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQ5rO-1s2h4E0QrI-00NncL; Sat, 08 Jun 2024 15:59:14 +0200 From: Stephen Berman In-Reply-To: <87cyoreqpd.fsf@gmx.net> (Stephen Berman's message of "Sat, 08 Jun 2024 11:20:14 +0200") References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> Date: Sat, 08 Jun 2024 15:59:11 +0200 Message-ID: <87h6e3lemo.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:o6r7vWTiSLPy+7O0erydNpVmapqngC70/8dcCHabLyIQtT/a4G0 hWQOio+ZbnbBTpEI2Q73W6v0uDI8hETPgV3TiD6J7Nww36bCPT3icl4yVDqzd+06Ji69hP+ 6PunTw+k/gGULJoOyuWoEVx0TpGbH2wrGh2rzh3SzdNumXjXJQ8p2a2J+jo+wwimf3zVDlt 0iFriKJDPMeToLcMYnSZQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:d/5RhjO0spA=;dh3tir8u0K215M9fAAxvybeI7/V wSnE/rjzaJoo/Tr1CVDJRqk5tY+UGGq007ejlAnDLqIGePDkNhgk5Q/rUAQlfprygqEf657oF j1CjQRxCKZ2gUNWUIG3ciK74Mnz44dDyR+BBKJ66N6WVOQRrTCU17IIg6LpKSuQkdl2IxFbiz jWn6UemLzj9lNWgf8jUDR1NNmk19JYHVxHRzCxmwrAC6xU88f96CkPgHg9V3yxPSNXAJUIfny sbwPGUb1cGoXceGE1ugIqxYtUMNnq+3OvdJXwiXFr0SWftYd/6ZZyQHvt6+3/70X/XSdBPTft GTt8SlcMdoeE4tuTF+hz9kipsZgIxn5XKJkJpI86u1yKEgcWvZTfrdqyzOOTxy2EfERhb6Xjw 8oiko3GiCD3+KAvnsxBjgkmMWhqZJ1nMb0VeAigNPyYW5MCffmHuVWbzmOHmeBvnzfUr8NwL3 IfH8dcELk0MsBG7SdBQ9jqCRT6DJALGSFCmoV5+9sKl34nidCGbonOfPxryFXDiEWA4urovcA nrNZUhMrX31mYjjad5lWS9WwY9lkuvcFlkPvAFS+FxVrex/SiXYXP6W+IYybLpKWTbHhW9QMP 1I20fabGVni0KT52lZ5NXMSZi4j1g0JzBmMJf6q64prctpGqQ/RoA5tiOAUKh8KUkpp/scFvh 5eq5R15eqH2uQzMGITryUqvNk/D2ziLV9aVi9CbWDKJGyRWqNsywjLcS3DHzHZ5zaANMjNjfB 3ErIuP5YJivhBCL4KMaJcdMiN9XlZHYH/eDtpQkFg5mJD2RBHNbLVkLy38h4yAEwPb3Hr2T3P u+l/np3KAXnMSuEd8lSgsemD4YlBGKFOjMe/XzmZWIAFU= X-Spam-Score: -0.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: -1.7 (-) On Sat, 08 Jun 2024 11:20:14 +0200 Stephen Berman = wrote: > On Sat, 08 Jun 2024 11:24:50 +0300 Eli Zaretskii wrote: > >>> Date: Sat, 8 Jun 2024 09:03:37 +0200 >>> From: Gabriele Nicolardi >>>=20 >>> I have the following Emacs Lisp code: >>>=20 >>> (progn >>> (y-or-n-p "Test: ") >>> (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) >>> (y-or-n-p "Test: "))) >>>=20 >>> The first prompt from the y-or-n-p function appears as expected: >>>=20 >>> Test: (y or n) >>>=20 >>> However, the second prompt appears differently: >>>=20 >>> Test: (=E2=80=98y=E2=80=99 or =E2=80=98n=E2=80=99) >>>=20 >>> I=E2=80=99m trying to understand why the second prompt format changes. = What causes this inconsistency in the >>> y-or-n-p prompt? >>>=20 >>> I suspect it might be related to the search-spaces-regexp variable or h= ow Emacs handles interactive >>> prompts, but I=E2=80=99m not sure. Any insights or explanations would b= e greatly appreciated! >> >> Stefan, can you please look into this? It sounds like some issue with >> substitute-command-keys: >> >> (substitute-command-keys "(\\`y' or \\`n') ") >> =3D> #("(y or n) " 1 2 (font-lock-face help-key-binding face help-key= -binding) 6 7 (font-lock-face help-key-binding face help-key-binding)) >> >> But >> >> (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) >> (substitute-command-keys "(\\`y' or \\`n') ")) >> =3D> "(\\=E2=80=98y=E2=80=99 or \\=E2=80=98n=E2=80=99) " >> >> I actually don't understand why we use \\`y' and \\`n' in y-or-n-p. >> Why those backslashes, and not just `y' and `n'? That's your change >> in commit a36ecc408a. If I remove the backslashes, the results are >> identical whether or not search-spaces-regexp is let-bound. Without the backslashes the cond-clause in substitute-command-keys handling sequences starting with "\" is skipped, so "y" and "n" do not get the help-key-binding face property. > Removing the final '?' in the regexp, i.e. > > (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)")) > (y-or-n-p "Test: ")) > > results in the second prompt appearing like the first one. Likewise > with '*', but not with '+': > > (let ((search-spaces-regexp " ?")) > (y-or-n-p "Test: ")) > =3D> Test: (\=E2=80=98y=E2=80=99 or \=E2=80=98n=E2=80=99) > > (let ((search-spaces-regexp " *")) > (y-or-n-p "Test: ")) > =3D> Test: (\=E2=80=98y=E2=80=99 or \=E2=80=98n=E2=80=99) > > (let ((search-spaces-regexp " +")) > (y-or-n-p "Test: ")) > =3D> Test: (y or n) > > (let ((search-spaces-regexp " ")) > (y-or-n-p "Test: ")) > =3D> Test: (y or n) Stepping through substitute-command-keys in Edebug, I see that when the regexp ends in '?' or '*' the sexp (key-valid-p k) in substitute-command-keys returns nil for k set to "y" and then to "n", so these strings do not get the help-key-binding face property and "(\\`y' or \\`n') " is returned to y-or-n-p unaltered. When the regexp does not end in '?' or '*', (key-valid-p k) returns t for "y" and "n" and these strings get propertized. Stepping through key-valid-p, I see that when the regexp ends in '?' or '*' the sexp (split-string keys " ") returns (#1=3D"" "y" #1#) for keys set to "y", and key-valid-p loops over this lists, and the first element "" is an invalid key. When the regexp does not end in '?' or '*' the split-string sexp in key-valid-p returns ("y"), and "y" is valid. And stepping through split-string, I see that when the regexp ends in '?' or '*', the invocation of string-match in the while-loop with args REGEXP set to " ", STRING set to "y" and START set to 0 returns 0, which results in "" being pushed onto the list both before and after "y", hence returning (#1=3D"" "y" #1#). When the regexp does not end in '?' or '*', the string-match invocation returns nil and only "y" is pushed onto the list. Steve Berman From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman , Stefan Monnier Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171785872732314 (code B ref 71429); Sat, 08 Jun 2024 14:59:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 14:58:47 +0000 Received: from localhost ([127.0.0.1]:39205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFxWo-0008P7-FF for submit@debbugs.gnu.org; Sat, 08 Jun 2024 10:58:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFxWj-0008Oj-K0 for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 10:58:45 -0400 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 1sFxWN-0001Xd-AB; Sat, 08 Jun 2024 10:58:19 -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=ri22pFY3YA87e4t744VjKUlAYhPye5EkD8PUSeIi+OI=; b=AHv5mlLaPwej 3RqA0rLBEpH8QcigFuWEsptnHfPZhxNAO/eelsiASLpkY+CsmavRT9AcuY0BJvDf+pCv6Eg0Ht+3j zLYYbeFmYeqC2fBUoswA2fY5jmgLKA/HObYCO55jRsAROaNK36tAt1uAW3EndtU8IZ/9uKso3N1RB 6ZCuKAffmIBXgYiyPim1tyhDafWy3SHG1uU74Sjxe3C6nM/7nEXeIby++sKq8vK/waqjHWxD7l55H /sbDjsSy5RF7gE7ZkRcqy9Tw92CQTHlN6uibktp2xYv8Q1NqnSXPODiX1oT8cyczBbF+qzWzRHuXe BQENdcO664uQxzL3XFm+Ww==; Date: Sat, 08 Jun 2024 17:58:17 +0300 Message-Id: <861q57cwhi.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87h6e3lemo.fsf@gmx.net> (message from Stephen Berman on Sat, 08 Jun 2024 15:59:11 +0200) References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> X-Spam-Score: -2.3 (--) 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: Stephen Berman > Cc: Gabriele Nicolardi , Stefan Kangas > , 71429@debbugs.gnu.org > Date: Sat, 08 Jun 2024 15:59:11 +0200 > > >> I actually don't understand why we use \\`y' and \\`n' in y-or-n-p. > >> Why those backslashes, and not just `y' and `n'? That's your change > >> in commit a36ecc408a. If I remove the backslashes, the results are > >> identical whether or not search-spaces-regexp is let-bound. > > Without the backslashes the cond-clause in substitute-command-keys > handling sequences starting with "\" is skipped, so "y" and "n" do not > get the help-key-binding face property. This should be explained in a comment in y-or-n-p. > Stepping through substitute-command-keys in Edebug, I see that when the > regexp ends in '?' or '*' the sexp (key-valid-p k) in > substitute-command-keys returns nil for k set to "y" and then to "n", so > these strings do not get the help-key-binding face property and "(\\`y' > or \\`n') " is returned to y-or-n-p unaltered. When the regexp does not > end in '?' or '*', (key-valid-p k) returns t for "y" and "n" and these > strings get propertized. > > Stepping through key-valid-p, I see that when the regexp ends in '?' or > '*' the sexp (split-string keys " ") returns (#1="" "y" #1#) for keys > set to "y", and key-valid-p loops over this lists, and the first element > "" is an invalid key. When the regexp does not end in '?' or '*' the > split-string sexp in key-valid-p returns ("y"), and "y" is valid. Thanks. To me, this means that key-valid-p should bind search-spaces-regexp to nil, because otherwise the value will subvert its contract. Do you agree? I added Stefan Monnier to the discussion in the hope he would have comments to this. > And stepping through split-string, I see that when the regexp ends in > '?' or '*', the invocation of string-match in the while-loop with args > REGEXP set to " ", STRING set to "y" and START set to 0 returns 0, which > results in "" being pushed onto the list both before and after "y", > hence returning (#1="" "y" #1#). When the regexp does not end in '?' or > '*', the string-match invocation returns nil and only "y" is pushed onto > the list. We should ad to split-string's doc string the fact that search-spaces-regexp affects its results when SEPARATORS includes whitespace. From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Stephen Berman , Stefan Monnier Cc: "gabriele@medialab.sissa.it" , "71429@debbugs.gnu.org" <71429@debbugs.gnu.org>, "stefankangas@gmail.com" Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.17178606413604 (code B ref 71429); Sat, 08 Jun 2024 15:31:02 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 15:30:41 +0000 Received: from localhost ([127.0.0.1]:39224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFy1g-0000w4-UT for submit@debbugs.gnu.org; Sat, 08 Jun 2024 11:30:41 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:44442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFy1e-0000vt-LY for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 11:30:40 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4587apFm005364; Sat, 8 Jun 2024 15:30:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s= corp-2023-11-20; bh=pCAJLGsEuzkgaIGWlNIa/quqeKj0XjFNIzcgpI08K8c=; b= i26Nl4AHcITPGnx3nqNLu8fn2i1vlrnYvkJAD0JGeOpGciQCufdjxvZ+GoP4qrmm icKsDYbglYMyNXU7/1tHr8kw+9mGJXMGpGDcfQY/D5GPqLwVyx3m8TiitfTtEQy0 VagD00p/5luomZgvNGK2ckPDfA4BxcD5KAVvi2eZzp3UD8q7ThbCEtzKy67KY7Yx xcDlH7aYQA/DpWh9446jf0OPSwXSW2uLuZ1c3Z+OHVQTpUYwgKCPCTok9kcoZ0dZ EsgOQwidGLOyu9P9+4HCOqh2GBmmG3yIlrKqfUbA1UN0Muxy6Vf1E8jtFp36ygTU BvIYPhty9CPIsimbxr1oZw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymh1m8a7w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Jun 2024 15:30:21 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 458C4gFc018467; Sat, 8 Jun 2024 15:30:20 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ymdr5d68s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Jun 2024 15:30:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCSRUUQSauYl8ScY61B/y267CXxo9UVnEJKhtnH+dRF3EBNqLrA7UX4xP587P0mme/3fCoqqh8bqYz07uYZ9mP7snQUd9LKPw3E/i/YahqkWv+jEVqJUF1wi42UvQr6veW9EOfwf8xFEzvQN/xrqWB2Ef9U01eYnoG1I/xoFz5YvkfSk21RWOcwygCBIumdd3soAF+IL9HizZYOHgg4pzFAKZCudtuNRc5d6ZQijqad7o5VWdp+J+ltuFaKlzJ6uVGaL4tcpKRmNThB9TbzuXJDo0u7B862JLMWFDyN+TdfO+GwdD9Vl10NVqGnO430PJHJxL6Ld/2PC1zLWf+3qZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pCAJLGsEuzkgaIGWlNIa/quqeKj0XjFNIzcgpI08K8c=; b=JgilQvfwGjxaapPdpPYecDb1GkTXA95A+ICG1Bede8A3G9yBwCeAzJhszf1IiN8rIgGZUvxB7F9vJHN0nr4svxH+Q/f+PZ/saz4x0E/fufBZdOHfGfRNcHCjcVhE5YTqsGDz5HdYBWA8GtJzEGAJQ0Z0357u0GCseFqUT8DpRxnXrk+uE0yFST3VB+2hMqfaSzLEhuttGb2yNw9HwP4IkISrPqUj51IEelkO7Vj7gf+6zMpkp240kIV9Jb92tUyGh9MaVYUqd1H0nIwlAMw7F/aLeZM2KigtV4hr3eIaPRQ6+efX9NigHwH5Q2p0VUeak5d/4IPLsumqk6AtVWsyQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pCAJLGsEuzkgaIGWlNIa/quqeKj0XjFNIzcgpI08K8c=; b=U4XDzHm2o1t/1o6s/esOeKfS3t9Mbq6Yd5ZF7ExJhxftupY87FQnBsNJeVcQAMRTAzjHjZBuHWZMMoGxCg0BXj9WX38jr89HkHBrTBlx9hQLKzvdYl/HOxg5FXIg4J9PJVXtELBa75T4+1aHewhcfqwGaeXnrHhe1V3TL2+43zE= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CY8PR10MB6705.namprd10.prod.outlook.com (2603:10b6:930:91::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.35; Sat, 8 Jun 2024 15:30:18 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::b75a:ef76:884a:dd27]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::b75a:ef76:884a:dd27%4]) with mapi id 15.20.7633.036; Sat, 8 Jun 2024 15:30:17 +0000 From: Drew Adams Thread-Topic: [External] : bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Thread-Index: AQHaubRxe08rYPKjxkK/zPmUJwMN8bG9/QFQ Date: Sat, 8 Jun 2024 15:30:17 +0000 Message-ID: References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> In-Reply-To: <861q57cwhi.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CY8PR10MB6705:EE_ x-ms-office365-filtering-correlation-id: f1c23730-e40e-455e-3825-08dc87cfe6b2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|366007|376005|38070700009; x-microsoft-antispam-message-info: qXEuTqns7J0PA6fGbpZDTzHKPRM62VlHN025WzeMRqFy79UZ82Uo5Lq4RYvXJk73rpWwur4w4Fj34BwPOWALSJQPPFkbwlEwp4kBFHZv5JhbGdQPN7GpMRcoTmIuswEuzSzMa4JDgT+QMER19wz161ME4SASgRKlXsUN424EYKtHmfh9DYFNIP82mfCQN1LpSKz12Ost/EJZVoGD17lvh3c/98BsUUo65rFbGR+ocxfZes8eIx4JhtX+FP83tyhNNsgyC7lODVJ8yp3sckr28LLC2JPGVKhe4sGppFXhWBhJr7tk7AjUIicHH4VBkfR5xTtNjOzynHNiVrGvAAnH3R6ZbpipzwApqdMIPix0d8zpbxcHYksn/2+/0/zdC0LogdMccVpvKeK43mw/nzGhxVC6+thM3bCfCvVA3VNtCG5qIumqazGFjCz3s/eS0qnehT8EFPbA9olm84aMj3iDEff8sMgVFT0M9D0ELl/hh4HLbngQREQOAM3plYMJLXrG1K9sAhOSYQhjxZbzquiY/mOJovMxE5bME0D/wEFaf3/TBcUMAOETLPkLd3VXiKeQ9Bm2T7f/puriuEYEmBX4oxpCWLx+5iwlT2Abzkt10P12jh7fg6fz+yZ/qELx8J6lpB/DC8aqs+AwqEbmt4d7STMb+IIYr+JRVJg8qrgvyOF1CJhggw8hkfhDUoyGy+lM+Xs14f6c2KPDeHFpGUvV2vs6ATZAuAaUN3lWccZYWHvKASMMHCq9kwr2VMRcR3HaNXkfWfuKbTXbge3KePsDP9x12BNF/tzLTNEhsAfXtFxw2fkIrVd9zEPA7O1dL8MiH/KDq6AKvu+qkc7rmUOMZO93+AwJTMwRYBvZNq0t45sxmWybrjvsmbbPx5msuQa7Fd9kigEEyOWxVveuAMYQ7y6P/oQiK1gOHapY+dGvp8Kpt/ZWZcfeZOmSkC0cR1S2aqd5yiGaORQ6Z3L1ejKOksOrMajNibEIqB+NA+3IdPlSRZT5RYy7ERGhCmm4JDgNTgId25db0W7xp00wyWbmwnYQw+Gws1oIdySbs71WS1fycYJ6zLarciGduyojoVPn34lD5/0cySz9GRPLnaa1QhdDS32kXMYFao2t3XjcUBOHxZxgwuYoSF8mf2dl8LKTKZ7Vzkax1aWTRkjAyVgfXKiKjmt/a83MQklDdohTv8zSo+oivaX5ndY/rxvbsDvsBJqWZkn9eYFkM6zafgQMWJCF6EYiXp0sLrxldRBOZ8RoObq6EuoL7f80kbmbkKUV11xuxJA8G6yvdk1jvKQZXOyDOSvodZCVYNczZX1oRL4Kfwt8PqadHSixFmNpStJL x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: Q8Kh2iMQa9g8CLjJF+Ys/Oww+jitVBMitdyFUNVId5ezMFhwK41WImsMOLXonYmRvZLDEx6xPoGV8S7KpSGlwkBnqryzRp/Ykh6kMXsjvqry8OHqVFKnGsvs5LZjhFBL9WVdlkdRnbP+MYslhLUfTWaf0+jIK1+RBxIEAJCnXxWp21FWD2eTm+CxXHOafAJ1OblnrEpwdo1iK54O7zY4gZEGtU8kddS9+7+VGRakUln7Kg4QX58uGaMzkGIIQQ/SB55pmvt0911KeQy1fq8W+lMaoiPTFItEDUL7RMaLwa8ULbUbIhVJnCJ9ripdj/0pSZSwGaVEtsaUd1JM220TrMAjxYYcNpUBh7yBP5nSoc0T7bc/Yp3P7eaxRMj462wSETizpASJZ8tSGz8uMLtF8HZ/eB+2a/Gc352w8xcIzGDJ/lZHoSRDPhE8fF6QsO607Nrq3nSrAaOMmExlJx75Ph65+Vr3KgDAzgzVXfaohMWZEba9p+bbIC2T5gqbRAG3wnZ2XcoYFG6z1ylpSF5lZoiw8K8Q5uXhbqbiHEHR129wGGwnpjH+yxW1invR8N4P9tXTYr3xFbP4RJnkzI+q9FsUPm/Jx02aG9KaYFnf5mxlz67io+cxrikjUtmtprMGSzNpVXSC/suRG20oZ089Vx31SGobUnmX6bx/4MK9YtG75tCmSOlvg5xR45vEhqsznfnMgOV+le7K2s0S9FtPiUgE08VTI+rfHwUDH+o/SfGOymB9wzNrR0u95coE/4TPsAKbdgida34Bngsp0T7gJI/CsYR9gwUXOD/kdWUuTSVS5xQwBSmd6j/YGT+DTCpnhgvNOHawwOSMvHrRtFaUnVMPhhq8MtpTnjEQ5MwXVcI9xNBRt2nmBqJ9fRHt4hwQgCZMMK+hHtBnkn9pQEF0uI3JoGAaP9xeLiX/MVeMmUogeLIuZ8SO65sP4dnftUW5p95llf66Ij/dWrGwx7/T6CNexJLbkRL84IJX4hVQidwSuZ37uk4Ob2kJugN7tRw4FC+qK1fFYzFYuNEsqGvDigCvRWAKlUjpm39zsXbCHWkSY/QRBef/BCn+Xzdqrc/9cZgunhfC5m57q2Wh01GwURGWxoAA3NbGmWn476FI6+/ykW00vxNwSeMMc+UhZva+4K0W/N1jrPorGSjPpn1tEQE2o5mBAOLMjnSQ3CwrG80hA/bds6rTcwxF+173bmddqQZv6qV1TeY0cBhdmtti7nMNcm4jVyIKzBxK1mcXi0hq3v9os77okrM0BfY/4d9ljz2sUf7s6rZ4W7bc5vZQT192Kx4q+Fi4S7WMUbGhVMLO/4cuWwFHUHc2i+b3D1zVR2nY8NDN+wcuoXm4H1r51MK6KSzulI4Cw9QHvDXSI+NogUiTe9U9rg4lii3SGFGOqRn18Lam22oeFX9O4SSlFRBxLQX6FmzTEfXgoN08d2zTzq6YfPVflZXEa3cJ9uvocDhdyssL/giH1WS3BFvmQ0bUscJAeXau1Q8YOOILHRcYqYE8z47uWfos07yUSnDslvOy5RZ2D9Mh18wa2gTaAg0p6RKUXJI5AdG9anFN94I1p4nwRF52Ps3D3BrA8qxn Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 7B1ecnDBuVCygheWrvmJ/UOA2BQsbKOaa3wzdL1RbUkbhQOuMQ8YBDS+WoN7Xe4kt+yErtbLiMzRvV/xKs4xuqtzTgHf9A7TeVePAv4CmyP7SnsDI8wi892FoYFTVmvc6wFPc/r2M4fowJ9FMoOj+eC7I4mprIekjc/fiP0zDFCvq0+N/Q2+9QuZVJH7G48Kwv5bYYCvjBD/ioffSaBxMuyH/bnf/iwKfDowLmFSpQyEMbtiSKlj6cwnsDY+61+v5F//fd3j9Hhr8n445QiKnxWM0AoIUf+Eqm3gRUmpxmLdrwTjzEuByP9qV8Y6VIZA6F23TAnvDc0dceCn+U8tQsU2fcn9yldSxba+EQNBqKMKB7SemLWoDdLRx9vG1YYD+hp+SDEWAYmDcNyTX8vW5bxXrhXKzi43+fDRFZ4QGZANARtjSWj1pmoRoAlhq/BFW6K9cUvukWwzb0o5xr4I5rXw1fnZLjgikC9aaFWOYXjlvVDcwOxYg09QrrrkSNadqEMuvjB+eMH1FI8vnpvzMK0n4KL3ElwjhCP9XhW+kJ2KxR2hXgB99uLpvXqkpHz0eZAypyvb7vY7BCV8RdlsVnsMe++vpFZqExxHZCMSh6g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1c23730-e40e-455e-3825-08dc87cfe6b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2024 15:30:17.7902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4pFZtVYGXaqUj1EXgCg9Lnim5CIu5UBbN9+JmgO6n1zJ4+E0O7y/N0vUB1isgAc2NyNn3CuyE7gLCUEr8gHvFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6705 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-08_08,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=638 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406080117 X-Proofpoint-ORIG-GUID: YZAENfb2iyoI43aG98cCM8JOxAT6gskU X-Proofpoint-GUID: YZAENfb2iyoI43aG98cCM8JOxAT6gskU X-Spam-Score: -0.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: -1.7 (-) FWIW, the question/problem was also posed here: https://emacs.stackexchange.com/q/81433/105 From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, Stephen Berman , stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.17178611624555 (code B ref 71429); Sat, 08 Jun 2024 15:40:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 15:39:22 +0000 Received: from localhost ([127.0.0.1]:39257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyA5-0001BO-UB for submit@debbugs.gnu.org; Sat, 08 Jun 2024 11:39:22 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyA1-0001Ax-Aw for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 11:39:20 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 84A7E80822; Sat, 8 Jun 2024 11:38:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1717861134; bh=mj+a9eW9KI+zAUlnylk7O62opqp+TtlXEi6kpG7BCSQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=L2cWW9c280tLxd86Cl0YrVSH6uYkWARPuCCeSrQtgIoBxN+ZsVimWrNtzrn+RhALS wQF6bauminC4QAWEySQS7VF5m5/TltcUQOIUIEFtvPTvrNuqFWfLtD3uZf8kxKQFUQ 80uriIrXh5VcjCBWVgntPfnamOJy0rHviiQVVRfoVAIyKGduDsKg8QUfC6sd+g37gk IJjtoxueMtg5AgUzVPG/juqva3pVnH1nbkyGpk8pQbnm9q7jt3aTydrf7uDbHYendL Uk1Zc0UA0SXt7o+T3F02UjTVxJ6YBzRxrRi0FZYPRqSOGfixXqhmn1CVELrKHCaawe bOVbxrZYZS6qQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 815C6805E0; Sat, 8 Jun 2024 11:38:54 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4AF72120796; Sat, 8 Jun 2024 11:38:54 -0400 (EDT) From: Stefan Monnier In-Reply-To: <861q57cwhi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jun 2024 17:58:17 +0300") Message-ID: References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> Date: Sat, 08 Jun 2024 11:38:53 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) 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 (---) > Thanks. To me, this means that key-valid-p should bind > search-spaces-regexp to nil, because otherwise the value will subvert > its contract. Do you agree? I kind of agree, but I wonder why it would be non-nil at this point. AFAIK `search-spaces-regexp` is meant for interactive searches, so let-binding it around code like `substitute-command-keys`, `split-string`, or `key-valid-p` sounds like a bug. Stefan From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, Stefan Monnier , stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.17178616575407 (code B ref 71429); Sat, 08 Jun 2024 15:48:02 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 15:47:37 +0000 Received: from localhost ([127.0.0.1]:39261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyI4-0001P9-Sv for submit@debbugs.gnu.org; Sat, 08 Jun 2024 11:47:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:60015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyI2-0001Ou-2P for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 11:47:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717861625; x=1718466425; i=stephen.berman@gmx.net; bh=bDx4+8s5HLMUiFabKFVP16Lh9hqfyNJBEzOKeeO1odc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=JTJ5J542jiE5pqSNdZ//LRJDLBxSaVVXROKYtvb2xz9dEJEpvW0fhLhE70WICwoN 79YikXu+tchYVpMP22yNlKWyeiGeDpCQkBSZmKrIt28tbeB2rB1FyxbygIZTGE/3x xE9Vc5BCa1QXp8ol/y4h+o7R5roRDbqaz3j6zkiHadtUwATmCmNajDJUFzSyddWCA UPqsHjD2ejIM2Bpl4kfJP89N7/1U56lUEFcBz4AyUEvT6Zul208SaGoR5Rnl/JZil Y/Ep/g+UYQYT1n9Rsck+gctgq7QwOiLH28kQHtIK2TYYfHB7GP/GgP7MBNoN1Fpmb nY6+xlg65gyKtS1D2w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([94.134.94.137]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MGyxX-1sCLda0ywt-003m6N; Sat, 08 Jun 2024 17:47:05 +0200 From: Stephen Berman In-Reply-To: <861q57cwhi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jun 2024 17:58:17 +0300") References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> Date: Sat, 08 Jun 2024 17:47:04 +0200 Message-ID: <878qzfl9mv.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Rc9nIXAkFghtf6kO/j2+6hrwvQqOdX+kisDYX7BlZ4RzB2bz7el QGITcyhBdWpuSJIz0zHGR1RtXDdf3iOJMBmowwNoLGM3ocoxaJqnLMLDqxTAYkcwJVaSP31 rW3hzKUZWzyXaU9wYJpOhDaSV9jdYNzyzt7ohz76ArxgQvuTyfrD7HBRDACwOqtvTl2vEuo hrwsEYLBPVZwZ8p29rTXA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YU8C7UVwW3o=;snZSNFcTzKzQ7yUnl3oJ7RmMMu9 erZGtVMaYGdDnHe7IYgEtXW/gYx6YWiYkpJJKVtKXUx6wHo5Zk/q+GfVxZRTdyLarfCsf9UCz FWqwGClqvbhLipVrASrMi7NGmsiJyXdL/xDJxody9d1LUgWV2PvEDQWtw81kfDhFfs1hB22qZ VqsVQfnLWZUxGyjXFxRRlLVDBUjF2k9n+6WMSrKzW5Oxzjla6zNCjCnCJ5D0Q/fYo799zFNAd dCAAGIfzEeYxihBYX6arANK7kYB8q0Zu+4EJfYnRfsyqF+j9UKtJFdh0rYnC/b7gnvFWOZf8v Z6zlvLuVzOKkd5id70SVPOT0GXwS6qYolqIgCTRpYTyon6PSLpwqfB2gOE185FqM2FAveHG1X 4zD74r4F0aAo3oTJwJamDx4CVebes5eZJHkkYo7+DqE652O8FbZ3S3JeejgbA17M3soqjcI8d h7Zruvr4XBXJlg9XzpLp3UH3F0azOGjhxHcy2bEUrbttwzUktchnWkN955ThrAet8vngzeM3J NoCZR/pnmK1xv3cZ/J+VNTHM2RD+Z7n3gqNZ4og4snRPInSUIdj7PMKgtGO3BcWi+aYbN5rkl wejPcPUnZFDxYjJxn1tNSAftMDMRbfnWBLGYojgLMok9rjtkwJmQEp6w+6Z9gXWFL1KhGzWeG BcYmQVTHYsBL38jKi0IwC7vVBq1OAyF43+QuyguLbMtAb9bBZnD8zKT3D16T3F265DP1WCKoT m+jx8wHEWhIQunKBlPbRkdzRLNjeFDxQKLVR9iGhCQ3Yd//Qf2pqJvSvj8sQx8dbshGwb2TKC cZdEnslSc2s9g5N1QlcNlObKmuZBGN6nyMNXg4UV0Yc1M= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.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: -1.7 (-) On Sat, 08 Jun 2024 17:58:17 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: Gabriele Nicolardi , Stefan Kangas >> , 71429@debbugs.gnu.org >> Date: Sat, 08 Jun 2024 15:59:11 +0200 >> >> >> I actually don't understand why we use \\`y' and \\`n' in y-or-n-p. >> >> Why those backslashes, and not just `y' and `n'? That's your change >> >> in commit a36ecc408a. If I remove the backslashes, the results are >> >> identical whether or not search-spaces-regexp is let-bound. >> >> Without the backslashes the cond-clause in substitute-command-keys >> handling sequences starting with "\" is skipped, so "y" and "n" do not >> get the help-key-binding face property. > > This should be explained in a comment in y-or-n-p. Since this effect of using a backslash is part of what substitute-command-keys does (and it's commented there: ";; 1C. \`f' is replaced with a fontified f."), would adding a comment to y-or-n-p be an exception or would all callers of substitute-command-keys that use this handling of the backslash also need to have such a comment? >> Stepping through substitute-command-keys in Edebug, I see that when the >> regexp ends in '?' or '*' the sexp (key-valid-p k) in >> substitute-command-keys returns nil for k set to "y" and then to "n", s= o >> these strings do not get the help-key-binding face property and "(\\`y' >> or \\`n') " is returned to y-or-n-p unaltered. When the regexp does no= t >> end in '?' or '*', (key-valid-p k) returns t for "y" and "n" and these >> strings get propertized. >> >> Stepping through key-valid-p, I see that when the regexp ends in '?' or >> '*' the sexp (split-string keys " ") returns (#1=3D"" "y" #1#) for keys >> set to "y", and key-valid-p loops over this lists, and the first elemen= t >> "" is an invalid key. When the regexp does not end in '?' or '*' the >> split-string sexp in key-valid-p returns ("y"), and "y" is valid. > > Thanks. To me, this means that key-valid-p should bind > search-spaces-regexp to nil, because otherwise the value will subvert > its contract. Do you agree? The value can break key-valid-p, e.g. by only optionally matching whitespace. Maybe that's reason enough to have key-valid-p bind it to nil. The OP's use case (mentioned the the stackexchange thread Drew referred to) seems legitimate, but maybe it can be achieved without changing search-spaces-regexp. Steve Berman From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 16:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, stephen.berman@gmx.net, stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171786462010722 (code B ref 71429); Sat, 08 Jun 2024 16:37:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 16:37:00 +0000 Received: from localhost ([127.0.0.1]:39324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFz3s-0002ms-1w for submit@debbugs.gnu.org; Sat, 08 Jun 2024 12:37:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFz3q-0002mg-L8 for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 12:36:59 -0400 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 1sFz3T-0003Ky-9p; Sat, 08 Jun 2024 12:36:35 -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=daQdiL30fW3RJ/rKCKVyLWYODRHuJk7lcpZe8jTO2ws=; b=aq582GXORbSN Yb+SEzNePJznmvKmyRrYeIp+LcmaTiIlI0zA8JNhgyDHrWN0iCo4qhswHjxZvsGhXiVsF3ihi7xG6 dA+EYH23n4q/2xKzKB1/QiBT1Co5uvuvcAwNTx3noTHlSMX+imunAPL3m6BG2sVAs58lt3g9eVyTQ sJaHVUGxrmC+Q+ytKKkaRFkjIEMv/WcmsVyhQoeQSj9cpkQYmkW+UVNIQtNhTyFGaOmy611UuHCX0 +hirCnjRxG2TAgOBHDjuvCYXIYYb4nxE6CsNF6k9o3Fpm7KmWb2P0q8czEMIAxGiuFI7r+fZ9tlMQ AanPbZwbkNA54fb3qvtKnw==; Date: Sat, 08 Jun 2024 19:36:32 +0300 Message-Id: <86wmmzbddb.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sat, 08 Jun 2024 11:38:53 -0400) References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Stefan Monnier > Cc: Stephen Berman , gabriele@medialab.sissa.it, > stefankangas@gmail.com, 71429@debbugs.gnu.org > Date: Sat, 08 Jun 2024 11:38:53 -0400 > > > Thanks. To me, this means that key-valid-p should bind > > search-spaces-regexp to nil, because otherwise the value will subvert > > its contract. Do you agree? > > I kind of agree, but I wonder why it would be non-nil at this point. > AFAIK `search-spaces-regexp` is meant for interactive searches, so > let-binding it around code like `substitute-command-keys`, > `split-string`, or `key-valid-p` sounds like a bug. You are saying that our implementation of search-spaces-regexp is incorrect? Because search.c uses its value regardless of whether it was invoked interactively or not. Or maybe you are saying that a Lisp program that binds search-spaces-regexp has a bug, because Lisp code is not supposed to bind that? From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 16:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, monnier@iro.umontreal.ca, stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171786525011796 (code B ref 71429); Sat, 08 Jun 2024 16:48:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 16:47:30 +0000 Received: from localhost ([127.0.0.1]:39329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFzE2-00034C-9H for submit@debbugs.gnu.org; Sat, 08 Jun 2024 12:47:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFzE0-000340-PV for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 12:47:29 -0400 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 1sFzBY-0004L8-Hm; Sat, 08 Jun 2024 12:44:56 -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=lkpfoQZGSATwUEG3QenbaHoYAH4h+wLdkbHmNeTL6pw=; b=TZDvt3qiEcC0 GXCnM0ww3eIvWCAS0NYhFx+4qTod/Fo/2DJKNzYcm6ai6Smo0rJjFRUlD3QwPa/pCtqV0NwvN6M7n p31jrn8mUNfEb4j5HMxnbURfCqpHtHGBCxn1kfurfPuU8/HiqZL3kVpvq0ePdgk4sGvHHw2iINnJB 3JNn5yWpZt9fvQUJ6xUSi6WVDXyYEdrQipQOZ3C4BOA69hfEBu8E+q0YeKyile4JlWg+SZDS/hd7J q55tBvqs93j6vL9SZRLAGcO53+3lWmplNu82AHWSq4JnulBUaFg25BPymwCwaIUnhTpUNlZobyQlQ fqKbfMfRyGoyq+ar0tYfXw==; Date: Sat, 08 Jun 2024 19:44:54 +0300 Message-Id: <86v82jbczd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <878qzfl9mv.fsf@gmx.net> (message from Stephen Berman on Sat, 08 Jun 2024 17:47:04 +0200) References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> <878qzfl9mv.fsf@gmx.net> X-Spam-Score: -2.3 (--) 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: Stephen Berman > Cc: Stefan Monnier , gabriele@medialab.sissa.it, > stefankangas@gmail.com, 71429@debbugs.gnu.org > Date: Sat, 08 Jun 2024 17:47:04 +0200 > > On Sat, 08 Jun 2024 17:58:17 +0300 Eli Zaretskii wrote: > > >> Without the backslashes the cond-clause in substitute-command-keys > >> handling sequences starting with "\" is skipped, so "y" and "n" do not > >> get the help-key-binding face property. > > > > This should be explained in a comment in y-or-n-p. > > Since this effect of using a backslash is part of what > substitute-command-keys does (and it's commented there: ";; 1C. \`f' is > replaced with a fontified f."), would adding a comment to y-or-n-p be an > exception or would all callers of substitute-command-keys that use this > handling of the backslash also need to have such a comment? Not necessarily all the callers, but some definitely. This is an unusual convention, which is mentioned in the doc string of substitute-command-keys, but not in the ELisp manual, and is used in our tree not too many times. The fact that I didn't know about it should already speak volumes. And in this case, how can the reader guess that `y' and `n' are meant as key bindings, not as simple characters? From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 17:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, stephen.berman@gmx.net, stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171786850717377 (code B ref 71429); Sat, 08 Jun 2024 17:42:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 17:41:47 +0000 Received: from localhost ([127.0.0.1]:39383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG04X-0004W9-1I for submit@debbugs.gnu.org; Sat, 08 Jun 2024 13:41:47 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG04S-0004Vt-7S for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 13:41:44 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E5F21441151; Sat, 8 Jun 2024 13:41:17 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1717868476; bh=cHNS/Mt0P+KQ/zs5XVXOayTeUqBXtnj9EQjj2L7nG9c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ja0Abh79kLa5XhphIszWIyNQFaV/A3Sj9Hc5ms1ZVF0+sFq83eDE0FwP8oInl8ocQ iHhZfc3kqTT7cr/sbXGUDGB6BEeDeLVbh04hjZcoYm5/Ti0+iQgTyh9IeeSOYb5qll RcAe9Tv70lZiqDF+vLUmmbIWXBmWwidjNi0KVFyfT4Kxyugsd1mVgU0j/GiPquM0IH LEFajG9skLlMIIZyhN+VYN0clFwu4ubXdwKHWk+0nkgITdZCNiVJ5alfv0jYj9KpKC gOD8Jam3basfMR4TGcrEMN5LA4zq0Uxb/blJBgNPsg1X/qVjLA+XDax6vWshZYAkNj XGXoTF9JBKzSA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 97BF2441109; Sat, 8 Jun 2024 13:41:16 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5A639120550; Sat, 8 Jun 2024 13:41:16 -0400 (EDT) From: Stefan Monnier In-Reply-To: <86wmmzbddb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jun 2024 19:36:32 +0300") Message-ID: References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> <86wmmzbddb.fsf@gnu.org> Date: Sat, 08 Jun 2024 13:41:14 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.049 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) 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 (---) > Or maybe you are saying that a Lisp program that binds > search-spaces-regexp has a bug, because Lisp code is not supposed to > bind that? That, yes. Binding it should be done carefully only at those places where the contained Lisp code is performing a search whose regexp was built from interactive user input. If you let bind that var and then call arbitrary code, I'd expect breakage. Stefan From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, stephen.berman@gmx.net, stefankangas@gmail.com Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.171787016020918 (code B ref 71429); Sat, 08 Jun 2024 18:10:01 +0000 Received: (at 71429) by debbugs.gnu.org; 8 Jun 2024 18:09:20 +0000 Received: from localhost ([127.0.0.1]:39407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG0VE-0005RK-Gt for submit@debbugs.gnu.org; Sat, 08 Jun 2024 14:09:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG0VA-0005R3-Eg for 71429@debbugs.gnu.org; Sat, 08 Jun 2024 14:09:19 -0400 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 1sG0Un-0001uG-FX; Sat, 08 Jun 2024 14:08:53 -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=1XgzHjYtYkVx1joUrENeOLr8sDKiQY1IVW3DUQf0auk=; b=GC8NFK9lb87H ZWK8MCIVfw5ladf5wXRBR8rYFNgrx4efDjrdhOEFcAffpCcPPB9/r8W26sD1qbSNHe+98l/nDpxlP 9L6wmFKiHFPJNQBqjWrJ1paYQsdRcWuKYyU/LtATBUY/GM8yNYWqeJ9wDcLYra8AONztfxlQnAJlS nLyB7k1UW6FPB9Ym+gyxOdEQ3KEOgv7V6rR0P2IvL0NM9lDcN4Qwk4EB7sk56H9EoplWhuE79E32/ xA03NH0nZRVSp6m501/XhcUHK/rWSVo9AZThWAmx7ol5+MC3bECOr53KRBCPdSR4vnR+1eK2tTs2V bQYc/P3RE5T2K1sin3t0/Q==; Date: Sat, 08 Jun 2024 21:08:29 +0300 Message-Id: <86msnvb942.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sat, 08 Jun 2024 13:41:14 -0400) References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> <86wmmzbddb.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Stefan Monnier > Cc: stephen.berman@gmx.net, gabriele@medialab.sissa.it, > stefankangas@gmail.com, 71429@debbugs.gnu.org > Date: Sat, 08 Jun 2024 13:41:14 -0400 > > > Or maybe you are saying that a Lisp program that binds > > search-spaces-regexp has a bug, because Lisp code is not supposed to > > bind that? > > That, yes. Binding it should be done carefully only at those places > where the contained Lisp code is performing a search whose regexp was > built from interactive user input. > > If you let bind that var and then call arbitrary code, I'd > expect breakage. OK, thanks. So I now added the above caveat to the ELisp manual, and I'm closing this bug. From unknown Thu Aug 21 12:12:08 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gabriele Nicolardi Subject: bug#71429: closed (Re: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp) Message-ID: References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> X-Gnu-PR-Message: they-closed 71429 X-Gnu-PR-Package: emacs Reply-To: 71429@debbugs.gnu.org Date: Sun, 09 Jun 2024 11:05:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1717931102-3742-1" This is a multi-part message in MIME format... ------------=_1717931102-3742-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 71429@debbugs.gnu.org. --=20 71429: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71429 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1717931102-3742-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 71429-done) by debbugs.gnu.org; 9 Jun 2024 11:04:20 +0000 Received: from localhost ([127.0.0.1]:59460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGGLU-0000wG-Ki for submit@debbugs.gnu.org; Sun, 09 Jun 2024 07:04:20 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:49637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGGLS-0000vo-ND for 71429-done@debbugs.gnu.org; Sun, 09 Jun 2024 07:04:19 -0400 Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-57a30dbdb7fso4820684a12.3 for <71429-done@debbugs.gnu.org>; Sun, 09 Jun 2024 04:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717930976; x=1718535776; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=z1y+nZtIBjcS5eZjEWMzOYhP+JI14ld0Ov4e/AcuejY=; b=XtTovny2qQjnMmQh+DowEFDIiVlIpJ7jyBlWoJZbh707S9pklU/Dn6PywDTlMtZyki YH82Z0sgBrt99zbOOhgKmduten0TjnALGibOhCLB6Ua1vPzR3YtP44ju6aeX9Bt16sTS +1rXVdfEqvMrcqX6m5CmwM4r/RHz8VMD8TaE7DEPHLYqMY+z+XXKBYmC44F/qsFn+GSF IzcBbkXwswadvGMK9XoDksjK0dgtx4WWKU/6DN/KW1aCDZKygwXQgaBSX0J4a4RtnC59 0p5eohC0TDQ9w8jse0lZFLwBUdIvxsRvYzxr5a3TkEebEPrjy45ppnDAZLis5v3JEiyB E/AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717930976; x=1718535776; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z1y+nZtIBjcS5eZjEWMzOYhP+JI14ld0Ov4e/AcuejY=; b=jfQjuWa2T9Keq/yvuyd3FslfBXqjdtZ4XbHbu+tdghx+YsSDkOvJQXEbQwRPmCUYLe XS8wPpZbVQ63k4S4mgdFOuYYGzBX1qK29++sZhglZtQFQiMxXwv2P8gq5N0Fn3Y9+lPU b15LK3BfNYZe5ban2YikDd++JnTbepJUUxLnZb+gzlfArLEcMYJx8p6RvATkvvJllSDe fFk18F2Z3h3XjkRUse8lS3t3TwvCrh4+lBiGWYiHMqViYbRVl8Mg7orVkr0+8P2W5keD grfpLnOkMGy0+peJNdczY6b1OfZjq8UhAYfLZ39hqy5ed6PELzmeE0doFBDCtReAmJu2 sw6w== X-Forwarded-Encrypted: i=1; AJvYcCUtRLsoI0uxoxj//gVl1cJVTpvHLh/Cf1RnYBq+MtrasiomWIu1iZuXmP9FmJ1jT0RGmgx1UIwUOGBZxW4Xi2dBypI0Bup8MZLw0Q== X-Gm-Message-State: AOJu0YwsHyhJ5JsPTiasR7bZcgzjXuFPvMUC/7JnOrH+l/+Sr0+3b6jb EdnQ2Gzkdc+69WuL/mmGU+put02+tBPlHalRnvX3K+idSt274lyCHsdzjGFt8cHu6KJZ+2wfjDr b/4NFPgbRV/qRnbU2YYZB6m0qpdU= X-Google-Smtp-Source: AGHT+IEdNwtvRq/z8F8zQOblvBS6afyaD+6wWCNJR9XQpvt36Td4pGTq7WdEcvJpW2Ah8ftn39sh5HLjL0IDJz5U81s= X-Received: by 2002:a50:d743:0:b0:57c:70a6:baf with SMTP id 4fb4d7f45d1cf-57c70a60bcamr1394477a12.40.1717930976228; Sun, 09 Jun 2024 04:02:56 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 9 Jun 2024 07:02:56 -0400 From: Stefan Kangas In-Reply-To: <86msnvb942.fsf@gnu.org> References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> <86wmmzbddb.fsf@gnu.org> <86msnvb942.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 9 Jun 2024 07:02:55 -0400 Message-ID: Subject: Re: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp To: Eli Zaretskii , Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71429-done Cc: gabriele@medialab.sissa.it, 71429-done@debbugs.gnu.org, stephen.berman@gmx.net 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.0 (-) Eli Zaretskii writes: > OK, thanks. So I now added the above caveat to the ELisp manual, and > I'm closing this bug. Actually closing. ------------=_1717931102-3742-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Jun 2024 07:19:25 +0000 Received: from localhost ([127.0.0.1]:51785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFqMG-00024L-NT for submit@debbugs.gnu.org; Sat, 08 Jun 2024 03:19:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:38144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFqMC-00023Z-At for submit@debbugs.gnu.org; Sat, 08 Jun 2024 03:19:21 -0400 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 1sFq7A-0006b3-Ti for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:03:48 -0400 Received: from smtp06.cbsolt.net ([185.97.217.45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFq78-0001iu-8K for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:03:48 -0400 Received: from [10.0.2.15] (host-79-24-247-102.retail.telecomitalia.it [79.24.247.102]) by smtp06.cbsolt.net (Postfix) with ESMTPSA id 4Vx8DV1YJlz3wf4 for ; Sat, 8 Jun 2024 09:03:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1717830219; bh=/RG3P38j1g061va+T7bWpZA+MPmuSq6QnGuCoucT/SY=; h=Date:To:From:Subject:From; b=WNf8rZQzahmUZQ0eUvEoxtw14f3PbAuAE0/UTN5cXlD1M6+vn5qiGn9JfeJvNQhlJ ZwN3J0leT9d5bhISbWriPqEjb8fsMa8lzYqSUcIVGB+/GaKHNrey0BKHrUn8UWSall t2e8h//Iy4IYl969uddHJ01YLhxj3oW+s0BO0ZPQ= Content-Type: multipart/alternative; boundary="------------rU6IkDa6BSNsYet3G0WaLAwZ" Message-ID: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> Date: Sat, 8 Jun 2024 09:03:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org From: Gabriele Nicolardi Content-Language: en-US Subject: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Received-SPF: pass client-ip=185.97.217.45; envelope-from=gabriele@medialab.sissa.it; helo=smtp06.cbsolt.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.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: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------rU6IkDa6BSNsYet3G0WaLAwZ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I have the following Emacs Lisp code: |(progn (y-or-n-p "Test: ") (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?")) (y-or-n-p "Test: "))) | The first prompt from the |y-or-n-p| function appears as expected: |Test: (y or n) | However, the second prompt appears differently: |Test: (‘y’ or ‘n’) | I’m trying to understand why the second prompt format changes. What causes this inconsistency in the |y-or-n-p| prompt? I suspect it might be related to the |search-spaces-regexp| variable or how Emacs handles interactive prompts, but I’m not sure. Any insights or explanations would be greatly appreciated! Best regards, Gabriele Nicolardi ​ --------------rU6IkDa6BSNsYet3G0WaLAwZ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi,
I have the following Emacs Lisp code:

(progn
  (y-or-n-p "Test: ")
  (let ((search-spaces-regexp "\\(?:\\n?[\s\t]+\\|\n\\)?"))
    (y-or-n-p "Test: ")))

The first prompt from the y-or-n-p function appears as expected:

Test: (y or n)

However, the second prompt appears differently:

Test: (‘y’ or ‘n’)

I’m trying to understand why the second prompt format changes. What causes this inconsistency in the y-or-n-p prompt?

I suspect it might be related to the search-spaces-regexp variable or how Emacs handles interactive prompts, but I’m not sure. Any insights or explanations would be greatly appreciated!

Best regards,

Gabriele Nicolardi

--------------rU6IkDa6BSNsYet3G0WaLAwZ-- ------------=_1717931102-3742-1-- From unknown Thu Aug 21 12:12:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2024 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71429 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Stephen Berman Cc: gabriele@medialab.sissa.it, 71429@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 71429-submit@debbugs.gnu.org id=B71429.17179323287545 (code B ref 71429); Sun, 09 Jun 2024 11:26:02 +0000 Received: (at 71429) by debbugs.gnu.org; 9 Jun 2024 11:25:28 +0000 Received: from localhost ([127.0.0.1]:60440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGGfw-0001xZ-AF for submit@debbugs.gnu.org; Sun, 09 Jun 2024 07:25:28 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:43510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGGPw-00018x-Sq for 71429@debbugs.gnu.org; Sun, 09 Jun 2024 07:08:57 -0400 Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-57a677d3d79so8453743a12.1 for <71429@debbugs.gnu.org>; Sun, 09 Jun 2024 04:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717931255; x=1718536055; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Yz67PtpmVnwtDrVhFVRWWQFpkoyjOSUfAudaDuKnchA=; b=JwN8q7ef/MTLekIejb+5xErNyE1tbK/5sD5VbRZvXvSMhKeJzNQNxj064Za/7RiKos jqRHw1ED0115WMftf4s2FY7Y2MkC+LlM5KdOoyJ7neYcdHlIBULvol952QGXOI5xPRt0 bhpDTruYYhKTmxMWXL5FEJKU4q/68+j1cmhP7/ct37YWDUgxm2iWqXebel7Kg7yT5fLg ISPhPqlRRsGbt5lnjGXfLjEUNfw8kn9j+65ed4ZCYZIu+tg5gCYQz53lviTilcd4z9ik g/pL6bwb68a+EKVgk4caW7trxvM3/enXL2+3EOmyztGW7Ue7NBjVTrVU71fLs6OfjNOC awKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717931255; x=1718536055; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Yz67PtpmVnwtDrVhFVRWWQFpkoyjOSUfAudaDuKnchA=; b=u9g5ypgLqJ63mjiphtn2K55sx1oq8PgfubRExoWk9ymAWUEZyhqEmXw/VqkZmwv2ll z4uUe4ifK7IVb1Y//wd6+PXYCBUtNHm/+SNGzfaCXGpyXzC5V4IlWolE74mlYfV3H+pg 3VBA7JqotYTYvX8CXv/XE0nO96s9kGX1xBPjySQn8QSvmD4T1nPNLuU5ZfiYVp06xBMU pPXiGVFio3wBJD6VarDMJ8t/C31kWRa8F44rK4/hehDn8dbXswdz48vijFisbQW1HztD 0+del+7srls5wledHOjUK+c5MXBPqn9nIrCBkeALN92B62e3ksRRfqe1iZ7djhDNz2aB oH1g== X-Forwarded-Encrypted: i=1; AJvYcCX97aAYdw4UX6T4LSAI4n/ezkWhaRRqPtKfLhiNvrXb0SD71fqlcxEbVYkv8tM5tgbpcKnBLkkDwMY697UBYIfmMH9YtCo= X-Gm-Message-State: AOJu0Yw/QwhLO8MYXAL6/2S3omRiHjDmaFseiDYzcOm9+MN1gcUfEPUV mIlzUQalERLzTGu0iF8DMQgaddoz64m6+y7vXQ4Iw/5shXZtlnEbFFA582e4SgeCzaZSsMMKP2p wQlpFUTGCO7IK1YKuDoVat/cdWnv8kXHT X-Google-Smtp-Source: AGHT+IGVWkX677W/0xrjzDI+GneZfymF3R/M1RuCxQVaI9rRomfXhH9rdmIVQ/hufanq3/kn3Ndz+4TQ6ADxmrh+vOU= X-Received: by 2002:a50:9e6d:0:b0:579:fa8e:31a0 with SMTP id 4fb4d7f45d1cf-57aa5410e6bmr7733111a12.10.1717930883020; Sun, 09 Jun 2024 04:01:23 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 9 Jun 2024 07:01:22 -0400 From: Stefan Kangas In-Reply-To: <86v82jbczd.fsf@gnu.org> References: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> <86bk4bet9p.fsf@gnu.org> <87cyoreqpd.fsf@gmx.net> <87h6e3lemo.fsf@gmx.net> <861q57cwhi.fsf@gnu.org> <878qzfl9mv.fsf@gmx.net> <86v82jbczd.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 9 Jun 2024 07:01:22 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) 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.0 (-) Eli Zaretskii writes: >> Since this effect of using a backslash is part of what >> substitute-command-keys does (and it's commented there: ";; 1C. \`f' is >> replaced with a fontified f."), would adding a comment to y-or-n-p be an >> exception or would all callers of substitute-command-keys that use this >> handling of the backslash also need to have such a comment? > > Not necessarily all the callers, but some definitely. This is an > unusual convention, which is mentioned in the doc string of > substitute-command-keys, but not in the ELisp manual, It is documented in (info "(elisp) Keys in Documentation"). See commit 1aef1a6673bc29784effe10d2e01e62b49c0112c and Bug#50804.