bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27979: tab completion for "(yes or no)?"


From: Drew Adams
Subject: bug#27979: tab completion for "(yes or no)?"
Date: Sun, 6 Aug 2017 09:48:15 -0700 (PDT)

Here's a thought -

Whoever writes a function that prompts for confirmation
decides whether to use `yes-or-no-p' or `y-or-n-p'.
A general choice is made for all users, based on the
importance of the decision, consequences, etc. in that
context.

But not all users will agree with that choice, for that
particular function's prompting.

We could perhaps give users a way to say, "From now on,
for this particular prompting (i.e., in this particular
function/context), use `y-or-n-p', not `yes-or-no-p'.

That would be a bit like what we do for commands, such
as `narrow-to-region', that are disabled out of the box.
We give users a way to enable them one by one.

Dunno how hard it would be to implement this.  Perhaps
`yes-or-no-p' could be changed somehow to:

1. Accept a third input, such as `use-y-or-n-p-here',
   that would record the current context as one in which
   `yes-or-no-p' would just use `y-or-n-p'.

2. Recognize the calling context somehow, and substitute
   `y-or-n-p' if that context is recognized and if it
   has been recorded by the user as one where `y-or-n-p'
   should be used.

Dunno how hard that would be - in particular #2.  Or
whether it would be worth doing.  But I can see the
possibility of someone not wanting to do `yes-or-no-p'
in some particular contexts but also not wanting to
replace `yes-or-no-p' by `y-or-n-p' everywhere.

(Of course, such a user could always advise or redefine
the particular calling function, replacing `yes-or-no-p'
by `y-or-n-p'.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]