From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46594: [External] : bug#46594: Use short answers Date: Wed, 24 Feb 2021 22:50:21 +0200 Organization: LINKOV.NET Message-ID: <87blc9gpgy.fsf@mail.linkov.net> References: <87im6qikpo.fsf@mail.linkov.net> <878s7gjftt.fsf@gnus.org> <87v9ahi9uk.fsf@mail.linkov.net> <834ki1tggh.fsf@gnu.org> <87h7m1gsao.fsf@mail.linkov.net> <8335xltdmi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18775"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: larsi@gnus.org, 46594@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 24 21:51:10 2021 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 1lF17l-0004mY-Of for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 21:51:09 +0100 Original-Received: from localhost ([::1]:59564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lF17k-0002zD-Q8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 15:51:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lF17e-0002yn-An for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 15:51:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lF17e-00037C-3C for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 15:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lF17e-0006nJ-0G for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 15:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2021 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46594-submit@debbugs.gnu.org id=B46594.161419986026110 (code B ref 46594); Wed, 24 Feb 2021 20:51:01 +0000 Original-Received: (at 46594) by debbugs.gnu.org; 24 Feb 2021 20:51:00 +0000 Original-Received: from localhost ([127.0.0.1]:36062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF17c-0006n4-CQ for submit@debbugs.gnu.org; Wed, 24 Feb 2021 15:51:00 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:49021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF17a-0006mr-JE for 46594@debbugs.gnu.org; Wed, 24 Feb 2021 15:50:58 -0500 X-Originating-IP: 91.129.96.116 Original-Received: from mail.gandi.net (m91-129-96-116.cust.tele2.ee [91.129.96.116]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 9F8E61BF206; Wed, 24 Feb 2021 20:50:50 +0000 (UTC) In-Reply-To: <8335xltdmi.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Feb 2021 22:27:49 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:200757 Archived-At: --=-=-= Content-Type: text/plain >> This is not only about about y-or-n-p/yes-or-no-p. It also affects >> the function 'read-answer' and its option 'read-answer-short'. > > Then why neither NEWS nor the doc string mention those other APIs? Sorry, this fixes the omission: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=use-short-answers-2.patch diff --git a/etc/NEWS b/etc/NEWS index caa366aaef..1ec080a6db 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2414,6 +2414,11 @@ and display the result. When non-nil, then functions 'read-char-choice' and 'y-or-n-p' (respectively) 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'. + +++ ** 'set-window-configuration' now takes an optional 'dont-set-frame' parameter which, when non-nil, instructs the function not to select diff --git a/src/fns.c b/src/fns.c index c16f9c6399..7c35957e0f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5904,6 +5909,16 @@ syms_of_fns (void) this variable. */); use_file_dialog = true; + 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, and giving the wrong answer would have serious consequences. +When non-nil, it uses `y-or-n-p'. In this case it means also obeying +the value of `y-or-n-p-use-read-key'. The same variable also affects +the function `read-answer'. */); + use_short_answers = false; + defsubr (&Sidentity); defsubr (&Srandom); defsubr (&Slength); --=-=-=--