summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2007-04-22 16:56:19 +0000
committerRichard M. Stallman <rms@gnu.org>2007-04-22 16:56:19 +0000
commit219f06f7b847f4a905d670ad067c4eb6b953aae3 (patch)
treec29a02314933c734468ce734a7184f06d02ccc3c /lisp/subr.el
parent00b7c149fe20e2e508bf58c697735037af2169e8 (diff)
downloademacs-219f06f7b847f4a905d670ad067c4eb6b953aae3.tar.gz
(read-number): Catch errors.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index fac2398a795..a05c1d15780 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1735,9 +1735,11 @@ The value of DEFAULT is inserted into PROMPT."
(let ((str (read-from-minibuffer prompt nil nil nil nil
(and default
(number-to-string default)))))
- (setq n (cond
- ((zerop (length str)) default)
- ((stringp str) (read str)))))
+ (condition-case nil
+ (setq n (cond
+ ((zerop (length str)) default)
+ ((stringp str) (read str))))
+ (error nil)))
(unless (numberp n)
(message "Please enter a number.")
(sit-for 1)