From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriele Nicolardi Newsgroups: gmane.emacs.bugs Subject: bug#71429: Inconsistent y-or-n-p prompt behavior in Emacs Lisp Date: Sat, 8 Jun 2024 09:03:37 +0200 Message-ID: <0a72f9c4-3f1c-4fc8-a412-169dca892b57@medialab.sissa.it> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------rU6IkDa6BSNsYet3G0WaLAwZ" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19045"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 71429@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 08 09:20:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sFqN4-0004nG-Do for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jun 2024 09:20:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFqMh-0001Db-7X; Sat, 08 Jun 2024 03:19:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFqMe-0001Cw-SG for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:19:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFqMe-00049V-Ke for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:19:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFqMu-00026r-5W for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:20:04 -0400 X-Loop: help-debbugs@gnu.org 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-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17178311657962 (code B ref -1); Sat, 08 Jun 2024 07:20:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Jun 2024 07:19:25 +0000 Original-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 Original-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 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFq7A-0006b3-Ti for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 03:03:48 -0400 Original-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 Original-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-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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286814 Archived-At: 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--