Mercurial > emacs
changeset 77423:954d7a5a16f6
(read-number): Catch errors.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 22 Apr 2007 16:56:19 +0000 |
parents | 7ecfd3e438e0 |
children | d3f723361ea3 |
files | lisp/subr.el |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Sun Apr 22 16:53:57 2007 +0000 +++ b/lisp/subr.el Sun Apr 22 16:56:19 2007 +0000 @@ -1735,9 +1735,11 @@ (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)