Skip to content

Commit

Permalink
Fix documentation of a recent change
Browse files Browse the repository at this point in the history
* src/fns.c (Fyes_or_no_p): Don't use braces around one-line
block.
(syms_of_fns) <use-short-answers>: Improve the wording of the doc
string.
* etc/NEWS: Improve wording of the entry about 'use-short-answers'.
  • Loading branch information
Eli-Zaretskii committed Feb 25, 2021
1 parent 297c0e0 commit 6bf56a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions etc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 5 additions & 7 deletions src/fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 6bf56a3

Please sign in to comment.