Subject: bug#14254: 24.3; read-number fails to recognize faulty numbers (string-to-number to blame)

From: Vitalie Spinu <[email-masked]>
Date: Wed, 24 Apr 2013 14:46:50 +0200

Hi, 

Try (read-number "Number: ") and insert some non-numeric junk. The
expected behavior is for the read-number to recognize the faulty string
and ask again, like documented in (elisp) Interactive Codes:

   `n'
        A number, read with the minibuffer.  If the input is not a number,
        the user has to try again. 

This doesn't happen because read-number relies on string-to-number to
throw an error, which presumably was happening some time ago. Now
(string-to-number "junk") returns 0.

    Vitalie

In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13)
 of 2013-03-12 on vitoshka-home
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description:	Ubuntu 12.10