diff options
| author | Glenn Morris | 2013-07-02 20:13:07 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-07-02 20:13:07 -0700 |
| commit | 208dee4daaae38f870322142388c43cff848e452 (patch) | |
| tree | 77f3e0f70e0bd32b6f5011b310446c751837c706 | |
| parent | a944db142f61600922660250cfe264118011dcb4 (diff) | |
| download | emacs-208dee4daaae38f870322142388c43cff848e452.tar.gz emacs-208dee4daaae38f870322142388c43cff848e452.zip | |
* lisp/subr.el (y-or-n-p): Handle empty prompts.
Fixes: debbugs:14770
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2204d474be9..1cf0d190130 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-07-03 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (y-or-n-p): Handle empty prompts. (Bug#14770) | ||
| 4 | |||
| 1 | 2013-05-26 Fabián Ezequiel Gallina <fgallina@gnu.org> | 5 | 2013-05-26 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 6 | ||
| 3 | * progmodes/python.el (python-indent-block-enders): Add break, | 7 | * progmodes/python.el (python-indent-block-enders): Add break, |
diff --git a/lisp/subr.el b/lisp/subr.el index 88f27c75764..0434e3856f9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2352,7 +2352,8 @@ is nil and `use-dialog-box' is non-nil." | |||
| 2352 | (cond | 2352 | (cond |
| 2353 | (noninteractive | 2353 | (noninteractive |
| 2354 | (setq prompt (concat prompt | 2354 | (setq prompt (concat prompt |
| 2355 | (if (eq ?\s (aref prompt (1- (length prompt)))) | 2355 | (if (or (zerop (length prompt)) |
| 2356 | (eq ?\s (aref prompt (1- (length prompt))))) | ||
| 2356 | "" " ") | 2357 | "" " ") |
| 2357 | "(y or n) ")) | 2358 | "(y or n) ")) |
| 2358 | (let ((temp-prompt prompt)) | 2359 | (let ((temp-prompt prompt)) |
| @@ -2369,7 +2370,8 @@ is nil and `use-dialog-box' is non-nil." | |||
| 2369 | (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip))))) | 2370 | (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip))))) |
| 2370 | (t | 2371 | (t |
| 2371 | (setq prompt (concat prompt | 2372 | (setq prompt (concat prompt |
| 2372 | (if (eq ?\s (aref prompt (1- (length prompt)))) | 2373 | (if (or (zerop (length prompt)) |
| 2374 | (eq ?\s (aref prompt (1- (length prompt))))) | ||
| 2373 | "" " ") | 2375 | "" " ") |
| 2374 | "(y or n) ")) | 2376 | "(y or n) ")) |
| 2375 | (while | 2377 | (while |