]> git.eshelyaron.com Git - emacs.git/commitdiff
Doc fix for y-or-n-p; trailing space is no longer needed
authorStefan Kangas <stefan@marxist.se>
Thu, 16 Sep 2021 07:23:51 +0000 (09:23 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 16 Sep 2021 07:38:24 +0000 (09:38 +0200)
* doc/lispref/minibuf.texi (Yes-or-No Queries):
* doc/lispref/os.texi (Suspending Emacs):
* doc/lispref/tips.texi (Programming Tips):
* doc/misc/gnus-faq.texi (FAQ 5-9):
* lisp/subr.el (y-or-n-p):
* src/fns.c (Fyes_or_no_p): Doc fix to reflect that a trailing space
is no longer needed; one is added or removed automatically.

doc/lispref/minibuf.texi
doc/lispref/os.texi
doc/lispref/tips.texi
doc/misc/gnus-faq.texi
etc/NEWS
lisp/subr.el
src/fns.c

index d54c654562f718ea87454fb8c3d885e98e770025..281e987e7f15f6ccc6eacbe90b3711b9810b30af 100644 (file)
@@ -2209,7 +2209,7 @@ Here is an example:
 
 @smallexample
 @group
-(yes-or-no-p "Do you really want to remove everything? ")
+(yes-or-no-p "Do you really want to remove everything?")
 
 ;; @r{After evaluation of the preceding expression,}
 ;;   @r{the following prompt appears,}
index 12ddaf04b6a831fa91abb5f899276f1e71329e88..658f742c418e9fdb4a4814aebfdda1abe73edabb 100644 (file)
@@ -813,7 +813,7 @@ Here is an example of how you could use these hooks:
 @smallexample
 @group
 (add-hook 'suspend-hook
-          (lambda () (or (y-or-n-p "Really suspend? ")
+          (lambda () (or (y-or-n-p "Really suspend?")
                          (error "Suspend canceled"))))
 @end group
 (add-hook 'suspend-resume-hook (lambda () (message "Resumed!")
index 0b20c107bbaaa5fadcf1afaeb50ac7503ba1f640..1611b983ea22dbd0f5dabe15a20699ac3eba02b1 100644 (file)
@@ -398,7 +398,7 @@ with a period.
 @item
 A question asked in the minibuffer with @code{yes-or-no-p} or
 @code{y-or-n-p} should start with a capital letter and end with
-@samp{? }.
+@samp{?}.
 
 @item
 When you mention a default value in a minibuffer prompt,
index 28bee11d2bd13c188aa62d4235b989fc8cf8a986..eac5f0861ff119c7b26e2c04a676cc8c390b75ef 100644 (file)
@@ -1559,7 +1559,7 @@ if you already use Gnus 5.10, if you still use 5.8.8 or
       "Request confirmation when replying to news."
       (interactive)
       (when (or (not (gnus-news-group-p gnus-newsgroup-name))
-                (y-or-n-p "Really reply by mail to article author? "))
+                (y-or-n-p "Really reply by mail to article author?"))
         ad-do-it))))
 @end example
 @noindent
index f22801cfbef5c787ea64ba0ce34497004a3db421..17c42ce104d8438e7f61893667cba3773a27355f 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -4084,6 +4084,11 @@ The special events 'dbus-event' and 'file-notify' are now ignored in
 ** 'start-process-shell-command' and 'start-file-process-shell-command'
 do not support the old calling conventions any longer.
 
++++
+** 'yes-or-no-p' and 'y-or-n-p' PROMPT parameter no longer needs trailing space.
+This has been the case since Emacs 24.4 but was not announced or
+documented until now.
+
 +++
 ** The 'uniquify' argument in 'auto-save-file-name-transforms' can be a symbol.
 If this symbol is one of the members of 'secure-hash-algorithms',
index be13fc0d653981637a32b996e849644dda3376c0..b80d1c28385d4af3bfd38117cfee6d8daebc1265 100644 (file)
@@ -3204,8 +3204,10 @@ character.  This is not possible when using `read-key', but using
 (defun y-or-n-p (prompt)
   "Ask user a \"y or n\" question.
 Return t if answer is \"y\" and nil if it is \"n\".
-PROMPT is the string to display to ask the question.  It should
-end in a space; `y-or-n-p' adds \"(y or n) \" to it.
+
+PROMPT is the string to display to ask the question; `y-or-n-p'
+adds \" (y or n) \" to it.  It does not need to end in space, but
+if it does up to one space will be removed.
 
 If you bind the variable `help-form' to a non-nil value
 while calling this function, then pressing `help-char'
index c39fce21c7032a1fb3e7ff97458ed3da09133b5a..4e74589ef264a7fa63f9263c8ebd4f30acc4d92d 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -2950,8 +2950,10 @@ do_yes_or_no_p (Lisp_Object prompt)
 DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0,
        doc: /* 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.  It should end in
-a space; `yes-or-no-p' adds \"(yes or no) \" to it.
+
+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.
 
 The user must confirm the answer with RET, and can edit it until it
 has been confirmed.