unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tim Landscheidt <tim@tim-landscheidt.de>
Cc: 63399@debbugs.gnu.org
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	[thread overview]
Message-ID: <83edno8fgw.fsf@gnu.org> (raw)
In-Reply-To: <874jolxmyf.fsf@vagabond.tim-landscheidt.de> (message from Tim Landscheidt on Tue, 09 May 2023 20:35:20 +0000)

> From: Tim Landscheidt <tim@tim-landscheidt.de>
> 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.





  parent reply	other threads:[~2023-05-10 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 20:35 bug#63399: 28.2; Documentation for yes-or-no-p wrong/different between docstring and lispref Tim Landscheidt
2023-05-10 10:08 ` Michael Albinus
2023-05-10 14:05   ` Eli Zaretskii
2023-05-10 14:07     ` Michael Albinus
2023-05-10 14:42       ` Eli Zaretskii
2023-05-10 14:57         ` Michael Albinus
2023-05-10 15:44           ` Eli Zaretskii
2023-05-10 16:04             ` Tim Landscheidt
2023-05-10 16:44               ` Eli Zaretskii
2023-05-10 16:57                 ` Michael Albinus
2023-05-10 16:55             ` Michael Albinus
2023-05-12 10:49             ` Michael Albinus
2023-05-10 13:48 ` Eli Zaretskii [this message]
2023-05-10 14:05   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83edno8fgw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63399@debbugs.gnu.org \
    --cc=tim@tim-landscheidt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).