Subject: Re: bug#28525: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p

From: Tino Calancha <[email-masked]>
Date: Tue, 3 Oct 2017 17:00:57 +0900 (JST)

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.