* lisp/subr.el (y-or-n-p): Handle empty prompts.

Fixes: debbugs:14770
This commit is contained in:
Glenn Morris 2013-07-02 20:13:07 -07:00
parent a944db142f
commit 208dee4daa
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2013-07-03 Glenn Morris <rgm@gnu.org>
* subr.el (y-or-n-p): Handle empty prompts. (Bug#14770)
2013-05-26 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-indent-block-enders): Add break,

View file

@ -2352,7 +2352,8 @@ is nil and `use-dialog-box' is non-nil."
(cond
(noninteractive
(setq prompt (concat prompt
(if (eq ?\s (aref prompt (1- (length prompt))))
(if (or (zerop (length prompt))
(eq ?\s (aref prompt (1- (length prompt)))))
"" " ")
"(y or n) "))
(let ((temp-prompt prompt))
@ -2369,7 +2370,8 @@ is nil and `use-dialog-box' is non-nil."
(x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip)))))
(t
(setq prompt (concat prompt
(if (eq ?\s (aref prompt (1- (length prompt))))
(if (or (zerop (length prompt))
(eq ?\s (aref prompt (1- (length prompt)))))
"" " ")
"(y or n) "))
(while