unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 28525@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>,
	npostavs@users.sourceforge.net
Subject: bug#28525: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p
Date: Tue, 3 Oct 2017 17:00:57 +0900 (JST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1710031637300.25777@calancha-pc> (raw)
In-Reply-To: <83wp4d1m84.fsf@gnu.org>



On Mon, 2 Oct 2017, Eli Zaretskii wrote:

>>> In my previous patch i checked if `yes-or-no-p' is aliased to
>>> `y-or-n-p'.
>>> A more general way is to add new functions `yes-or-no-or-else-p',
>>> `y-or-n-or-else-p': they ask the question and
>>> accept additional answers according with an optional argument.
>> Indeed, we don't need new functions just add an optional argument makes
>> the thing (see below patch).
>> In some cases it might be useful to allow more answers than just 'yes'
>> or 'no'.
>
> On second thought, maybe we should simply ignore this issue, and let
> users who want to override these functions write their own variants
> for them?  Especially since packages do exist out there to do
> something like that already.  We don't need to solve every single
> problem with exotic customizations in the core.
Thank you for the comment.  That's also a sensible suggestion.

Even if we ignore this issue, the existance of a `questionp'
which ask a question and allow more than 2 answers
(and returns a symbol, easy to check in a `cond' block) might be
a useful addition; this is quite general and avoid the need to use
`read-string' in cases where the programmer prefers a symbol.

If we provide the possible answers as an argument, like
in my previous patch, it looks quite explicit.

Following the analogy with `yes-or-no-p', `y-or-n-p'
it might be a couple of functions so that fset lovers can do:
(fset 'questionp 'question-mini-p)

So that they can answer just with one key and without RET.

Just an idea in mind.  Sorry if it's a bad one.






  reply	other threads:[~2017-10-03  8:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  9:51 bug#28525: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p Tino Calancha
2017-09-21  8:15 ` Eli Zaretskii
2017-09-30 13:00   ` Tino Calancha
2017-10-01  4:06     ` Tino Calancha
2017-10-01 23:15       ` Drew Adams
2017-10-02  5:40         ` Tino Calancha
2017-10-02 13:33           ` Drew Adams
2017-10-03  8:02             ` Tino Calancha
2017-10-02 17:41       ` Eli Zaretskii
2017-10-03  8:00         ` Tino Calancha [this message]
2017-10-03 11:10           ` Michael Heerdegen

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=alpine.DEB.2.20.1710031637300.25777@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=28525@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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).