Variable: y-or-n-p-use-read-key

y-or-n-p-use-read-key is a variable defined in subr.el.gz.

Value

nil

Documentation

Prefer read-key when answering a "y or n" question by y-or-n-p.

Otherwise, use the minibuffer.

When using the minibuffer, the user is less constrained, and can use the normal commands available in the minibuffer, and can, for instance, switch to another buffer, do things there, and then switch back again to the minibuffer before entering the character. This is not possible when using read-key, but using read-key may be less confusing to some users.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defvar y-or-n-p-use-read-key nil
  "Prefer `read-key' when answering a \"y or n\" question by `y-or-n-p'.
Otherwise, use the minibuffer.

When using the minibuffer, the user is less constrained, and can
use the normal commands available in the minibuffer, and can, for
instance, switch to another buffer, do things there, and then
switch back again to the minibuffer before entering the
character.  This is not possible when using `read-key', but using
`read-key' may be less confusing to some users.")