GNU bug report logs - #14254
24.3; read-number fails to recognize faulty numbers (string-to-number to blame)

Previous Next

Package: emacs;

Reported by: Vitalie Spinu <spinuvit <at> gmail.com>

Date: Wed, 24 Apr 2013 12:53:02 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 14254 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Vitalie Spinu'" <spinuvit <at> gmail.com>,
	"'Andreas Schwab'" <schwab <at> linux-m68k.org>
Cc: 14254 <at> debbugs.gnu.org
Subject: RE: bug#14254: 24.3;
	read-number fails to recognize faulty numbers (string-to-number
	toblame)
Date: Wed, 24 Apr 2013 08:13:41 -0700
>  >> Now (string-to-number "junk") returns 0.
> 
>  > It always did, as documented.
> 
> That presumably means that read-number never worked as originally
> expected. The comment in source file says that read-number should be
> used for "n" interactive spec, but "n" spec works as expected, so
> read-number is not used there.
> 
> Wouldn't it be more natural for string-to-number to return nil rather
> than 0 in a non-number case?

See my last reply.  It's not about `string-to-number'.  It's about
`read-number'.  

And no, it has always worked as expected, up through Emacs 24.2.  It was broken
in 24.3, by changing (read str) to (string-to-number str).





This bug report was last modified 12 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.