Don't clobber match data in 'y-or-n-p'
* lisp/subr.el (y-or-n-p): Avoid clobbering caller's match data. (Bug#61091)
This commit is contained in:
parent
4c765d93ab
commit
3a64f81ebc
1 changed files with 8 additions and 6 deletions
14
lisp/subr.el
14
lisp/subr.el
|
@ -3573,12 +3573,14 @@ like) while `y-or-n-p' is running)."
|
||||||
(if (or (zerop l) (eq ?\s (aref prompt (1- l))))
|
(if (or (zerop l) (eq ?\s (aref prompt (1- l))))
|
||||||
"" " ")
|
"" " ")
|
||||||
(if dialog ""
|
(if dialog ""
|
||||||
(substitute-command-keys
|
;; Don't clobber caller's match data.
|
||||||
(if help-form
|
(save-match-data
|
||||||
(format "(\\`y', \\`n' or \\`%s') "
|
(substitute-command-keys
|
||||||
(key-description
|
(if help-form
|
||||||
(vector help-char)))
|
(format "(\\`y', \\`n' or \\`%s') "
|
||||||
"(\\`y' or \\`n') ")))))))
|
(key-description
|
||||||
|
(vector help-char)))
|
||||||
|
"(\\`y' or \\`n') "))))))))
|
||||||
;; Preserve the actual command that eventually called
|
;; Preserve the actual command that eventually called
|
||||||
;; `y-or-n-p' (otherwise `repeat' will be repeating
|
;; `y-or-n-p' (otherwise `repeat' will be repeating
|
||||||
;; `exit-minibuffer').
|
;; `exit-minibuffer').
|
||||||
|
|
Loading…
Add table
Reference in a new issue