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 dialog ""
|
||||
(substitute-command-keys
|
||||
(if help-form
|
||||
(format "(\\`y', \\`n' or \\`%s') "
|
||||
(key-description
|
||||
(vector help-char)))
|
||||
"(\\`y' or \\`n') ")))))))
|
||||
;; Don't clobber caller's match data.
|
||||
(save-match-data
|
||||
(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').
|
||||
|
|
Loading…
Add table
Reference in a new issue