From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: JURTA Message-ID: <877gjbgozi.fsf@mail.jurta.org> References: <87ehe0ayf9.fsf@gmail.com> <87bo93abt8.fsf@mail.jurta.org> <87ppxi49xd.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1367916431 5479 80.91.229.3 (7 May 2013 08:47:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 08:47:11 +0000 (UTC) Cc: 14254@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 07 10:47:10 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UZdYD-0001AA-4v for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2013 10:47:09 +0200 Original-Received: from localhost ([::1]:51754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZdYC-0005ir-Ni for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2013 04:47:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZdY8-0005ij-NP for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 04:47:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZdY5-00029b-D9 for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 04:47:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZdY5-00029W-9e for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 04:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UZdZ4-0005zZ-D4 for bug-gnu-emacs@gnu.org; Tue, 07 May 2013 04:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2013 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14254 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14254-submit@debbugs.gnu.org id=B14254.136791642222811 (code B ref 14254); Tue, 07 May 2013 08:48:02 +0000 Original-Received: (at 14254) by debbugs.gnu.org; 7 May 2013 08:47:02 +0000 Original-Received: from localhost ([127.0.0.1]:60579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZdY5-0005vi-17 for submit@debbugs.gnu.org; Tue, 07 May 2013 04:47:02 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:55444 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZdY2-0005vW-GQ for 14254@debbugs.gnu.org; Tue, 07 May 2013 04:46:59 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6414E258B9E93C; Tue, 7 May 2013 01:45:55 -0700 (PDT) In-Reply-To: <87ppxi49xd.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 25 Apr 2013 23:44:45 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74044 Archived-At: >>> `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]);