* lisp/subr.el (y-or-n-p): Use substitute-command-keys.

This commit is contained in:
Stefan Kangas
2022-10-04 17:39:28 +02:00
parent d9bd14975b
commit a36ecc408a

View File

@@ -3547,11 +3547,12 @@ like) while `y-or-n-p' is running)."
(if (or (zerop l) (eq ?\s (aref prompt (1- l))))
"" " ")
(if dialog ""
(if help-form
(format "(y, n or %s) "
(key-description
(vector help-char)))
"(y or n) "))))))
(substitute-command-keys
(if help-form
(format "(\\`y', \\`n' or \\`%s') "
(key-description
(vector help-char)))
"(\\`y' or \\`n') ")))))))
;; Preserve the actual command that eventually called
;; `y-or-n-p' (otherwise `repeat' will be repeating
;; `exit-minibuffer').