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


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14254 <at> debbugs.gnu.org
Subject: bug#14254: 24.3; read-number fails to recognize faulty numbers (string-to-number to blame)
Date: Tue, 07 May 2013 11:42:41 +0300
>>> `call-interactively' doesn't use `read-number'.  It duplicates code
>>> from `read-number' with a similar loop to re-read non-numbers.
>>
>> Could you try and see if/how the C code could be changed to just call
>> the Elisp function?
>
> === modified file 'src/callint.c'
> --- src/callint.c	2013-02-27 07:42:43 +0000
> +++ src/callint.c	2013-04-25 20:41:12 +0000
> [...]
> -	  visargs[i] = args[i];
> +	  args[i] = call1 (Qread_number, callint_message);
>  	  break;

I should have mentioned that original code contained the line

          visargs[i] = args[i];

but I omitted it in the change since it has no effect
because this code at the end of `Fcall_interactively'

      for (i = 1; i < nargs; i++)
        {
          if (varies[i] > 0)
            visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil);
          else
            visargs[i] = quotify_arg (args[i]);
        }

overwrites elements of `visargs' anyway.  I don't understand why
`Fcall_interactively' contains many lines of such useless code as

	  visargs[i] = last_minibuf_string;

If the intention was to collect strings in `visargs' and use them later
then old code for numbers (currently still useless) was wrong,
it should convert numbers to strings with something like

          visargs[i] = Fnumber_to_string(args[i]);




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.