From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.bugs Subject: bug#63399: 28.2; Documentation for yes-or-no-p wrong/different between docstring and lispref Date: Tue, 09 May 2023 20:35:20 +0000 Organization: https://www.tim-landscheidt.de/ Message-ID: <874jolxmyf.fsf@vagabond.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36533"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: 63399@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 09 22:36:19 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 1pwU4J-0009Hy-H7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 May 2023 22:36:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwU45-0007t4-2o; Tue, 09 May 2023 16:36:05 -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 1pwU43-0007sl-DF for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 16:36: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 1pwU43-0006JU-52 for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 16:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwU42-0006z0-IC for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 16:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tim Landscheidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 May 2023 20:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63399 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.168366453126803 (code B ref -1); Tue, 09 May 2023 20:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 May 2023 20:35:31 +0000 Original-Received: from localhost ([127.0.0.1]:44580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwU3X-0006yF-Hh for submit@debbugs.gnu.org; Tue, 09 May 2023 16:35:31 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwU3R-0006y2-I0 for submit@debbugs.gnu.org; Tue, 09 May 2023 16:35:29 -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 1pwU3R-0007nz-CZ for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 16:35:25 -0400 Original-Received: from andalucia.tim-landscheidt.de ([2a01:4f8:1c1c:d4d0::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwU3P-0006C0-EV for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 16:35:25 -0400 Original-Received: from [195.226.160.202] (port=59366 helo=vagabond) by andalucia.tim-landscheidt.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1pwU3M-0006k1-H9 for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 20:35:20 +0000 Received-SPF: pass client-ip=2a01:4f8:1c1c:d4d0::1; envelope-from=tim@tim-landscheidt.de; helo=andalucia.tim-landscheidt.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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:261448 Archived-At: The documentation for yes-or-no-p in Emacs 28.2 reads: | yes-or-no-p is a built-in function in =E2=80=98C source code=E2=80=99. | (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; =E2=80=98yes-or-no-p= =E2=80=99 | 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. | [=E2=80=A6] 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) ". With the big caveat that I have never looked deeper at Emacs's C code, the source in src/fns.c does not appear to change the prompt given as an argument in any way, but just append yes-or-no-prompt to it. Also, (elisp) Yes-or-No Queries reads (since 7f53446a10ea; doc/lispref/minibuf.texi): | [=E2=80=A6] | 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 ---------- | [=E2=80=A6] 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. 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) ".