emacs-devel
[Top][All Lists]
Advanced

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

Re: Confused by y-or-n-p


From: Juri Linkov
Subject: Re: Confused by y-or-n-p
Date: Sun, 27 Dec 2020 18:25:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> The most simple approach to get the old behavior back is to restore the
> old code for 'y-or-n-p', rename it to something like 'y-or-n-p-old' and
> call it when an option like `y-or-n-p-use-old' is non-nil.

This is exactly what we recently did for the function 'read-char-choice'.
Instead of changing its long-standing implementation that uses 'read-key',
we left it unchanged, and only changed its caller to rely on a different
function that uses the minibuffer to read a character.

The same way we could add a function with old implementation of 'y-or-n-p',
and depending on an option use either of them.  So two new options are
needed: to select an implementation of y-or-n-p and and also an option
to choose either to use yes-or-no-p or y-or-n-p with shorter answers.

Or maybe just one variable with three choices: long answers with yes-or-no-p,
short answers with read-key, short answers with the minibuffer.



reply via email to

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