From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63399: 28.2; Documentation for yes-or-no-p wrong/different between docstring and lispref Date: Wed, 10 May 2023 16:48:31 +0300 Message-ID: <83edno8fgw.fsf@gnu.org> References: <874jolxmyf.fsf@vagabond.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39252"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63399@debbugs.gnu.org To: Tim Landscheidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 10 15:48:41 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pwkBL-0009zj-P3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 May 2023 15:48:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwkAz-0002UD-Sy; Wed, 10 May 2023 09:48:17 -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 1pwkAk-0002TR-MR for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 09:48:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwkAk-0001oQ-ES for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 09:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwkAk-0005qg-B7 for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2023 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63399 X-GNU-PR-Package: emacs Original-Received: via spool by 63399-submit@debbugs.gnu.org id=B63399.168372645622338 (code B ref 63399); Wed, 10 May 2023 13:48:02 +0000 Original-Received: (at 63399) by debbugs.gnu.org; 10 May 2023 13:47:36 +0000 Original-Received: from localhost ([127.0.0.1]:45574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwkAK-0005oD-3N for submit@debbugs.gnu.org; Wed, 10 May 2023 09:47:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwkAG-0005nz-M4 for 63399@debbugs.gnu.org; Wed, 10 May 2023 09:47:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwkAA-0001is-OI; Wed, 10 May 2023 09:47:26 -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=riTxLgKL+pxFUVCgKmbp2BTWw0Kdr/fJcOcEJH1g588=; b=JYV0zIHQrb0gXObPACiM aW/F3q4/FcggQvQ40k17CLBU4iRG4OVEPrKhbLT6nUVROLs5hApZdieHBN+ndGtrce9GLWaN64QZS DiqG0zXyqq+uM+NgDwMdcYkiaCQtIDah5ir19qu2jZTR9573UaCAqYzmpXB3f8pO1Jwgx04A4RE8Y WRouAq0k8tHfeehtEc3z2n4etUbEMAy3XoYf17/h2r0pPpQbznMZfSB1k49J52mFiwQE3hAuM0a/2 SsgiiolYCJJvtda3hOaPZXMNIR+/JlDdwo0qAPsiNsZLERmY1sD8NZSHYoDr/geBNiEwdWbZjtA89 PCsyAdis20/hOA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwkAA-0008NW-8P; Wed, 10 May 2023 09:47:26 -0400 In-Reply-To: <874jolxmyf.fsf@vagabond.tim-landscheidt.de> (message from Tim Landscheidt on Tue, 09 May 2023 20:35:20 +0000) 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:261495 Archived-At: > From: Tim Landscheidt > Date: Tue, 09 May 2023 20:35:20 +0000 > > The documentation for yes-or-no-p in Emacs 28.2 reads: > > | yes-or-no-p is a built-in function in ‘C source code’. > > | (yes-or-no-p PROMPT) > > | Ask user a yes-or-no question. > | Return t if answer is yes, and nil if the answer is no. > > | PROMPT is the string to display to ask the question; ‘yes-or-no-p’ > | adds "(yes or no) " to it. It does not need to end in space, but if > | it does up to one space will be removed. > > | […] > > This is wrong: (yes-or-no-p "Prompt? ") gives the prompt > "Prompt? (yes or no) ", but according to the docstring it > should be "Prompt?(yes or no) ". The doc string in Emacs 29 no longer includes the above confusing and inaccurate text about removing the space. So I think this documentation bug was already fixed. > Also, (elisp) Yes-or-No Queries reads (since 7f53446a10ea; > doc/lispref/minibuf.texi): > > | […] > > | Here is an example: > > | (yes-or-no-p "Do you really want to remove everything?") > > | ;; After evaluation of the preceding expression, > | ;; the following prompt appears, > | ;; with an empty minibuffer: > > | ---------- Buffer: minibuffer ---------- > | Do you really want to remove everything? (yes or no) > | ---------- Buffer: minibuffer ---------- > > | […] > > This is not the actual result: (yes-or-no-p "Do you really > want to remove everything?") gives the prompt "Do you really > want to remove everything?(yes or no) ", i. e., the space > before the parenthesis is missing. I've now fixed the example to be consistent with the result. > Finally, the behaviour is different when using > use-short-answers: > > | (yes-or-no-p "Prompt?") > > gives "Prompt?(yes or no) ", while: > > | (let ((use-short-answers t)) (yes-or-no-p "Prompt?")) > > gives "Prompt? (y or n) ". You are supposed to include the trailing blank if you want to ensure there's a blank between the prompt and the "(y or n)" part. I think we should close this bug now.