diff lisp/subr.el @ 77423:954d7a5a16f6

(read-number): Catch errors.
author Richard M. Stallman <rms@gnu.org>
date Sun, 22 Apr 2007 16:56:19 +0000
parents d57bf0ca865e
children d53cb34bfd32 62535fec6ee1 41aaac7180d5 e6fdae9180d4
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)