# HG changeset patch # User Richard M. Stallman # Date 1177260979 0 # Node ID 954d7a5a16f617c34616a967905fc6f21dbb2ae9 # Parent 7ecfd3e438e0bf5b5908be166115525e5ed6d791 (read-number): Catch errors. diff -r 7ecfd3e438e0 -r 954d7a5a16f6 lisp/subr.el --- 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)