From 6bf56a3614ccd23a31e34ae997b2a6bb0d158489 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 25 Feb 2021 20:58:44 +0200 Subject: [PATCH] Fix documentation of a recent change * src/fns.c (Fyes_or_no_p): Don't use braces around one-line block. (syms_of_fns) : Improve the wording of the doc string. * etc/NEWS: Improve wording of the entry about 'use-short-answers'. --- etc/NEWS | 5 +++-- src/fns.c | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1ec080a6db57..f8f41e21e2d8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2416,8 +2416,9 @@ use the function 'read-key' to read a character instead of using the minibuffer. --- ** New variable 'use-short-answers' to use 'y-or-n-p' instead of 'yes-or-no-p'. -This relieves of the need to define an alias that maps one to another -in the init file. The same variable also affects the function 'read-answer'. +This eliminates the need to define an alias that maps one to another +in the init file. The same variable also controls whether the +function 'read-answer' accepts short answers. +++ ** 'set-window-configuration' now takes an optional 'dont-set-frame' diff --git a/src/fns.c b/src/fns.c index 79b5a1e9930b..7914bd47790a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2874,9 +2874,7 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) } if (use_short_answers) - { - return call1 (intern ("y-or-n-p"), prompt); - } + return call1 (intern ("y-or-n-p"), prompt); AUTO_STRING (yes_or_no, "(yes or no) "); prompt = CALLN (Fconcat, prompt, yes_or_no); @@ -5911,10 +5909,10 @@ this variable. */); DEFVAR_BOOL ("use-short-answers", use_short_answers, doc: /* Non-nil means `yes-or-no-p' uses shorter answers "y" or "n". -It's discouraged to use single-key answers because `yes-or-no-p' is -intended to be used when it's thought that you should not respond too -quickly, so you take time and perhaps think more about the answer. -When non-nil, then `yes-or-no-p' uses `y-or-n-p' to read an answer. +When non-nil, `yes-or-no-p' will use `y-or-n-p' to read the answer. +We recommend against setting this variable non-nil, because `yes-or-no-p' +is intended to be used when users are expected not to respond too +quickly, but to take their time and perhaps think about the answer. The same variable also affects the function `read-answer'. */); use_short_answers = false;