From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15433: 24.3.50; wrong-type-argument wholenump -3 Date: Sat, 21 Sep 2013 18:20:23 -0700 (PDT) Message-ID: <34d7a335-c625-4ae8-b6c3-de3ee74c8777@default> References: <> <> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1379812948 8900 80.91.229.3 (22 Sep 2013 01:22:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Sep 2013 01:22:28 +0000 (UTC) To: Alan Mackenzie , gnu-emacs-bug@moderators.isc.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 22 03:22:27 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 1VNYNV-0003Bs-RT for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Sep 2013 03:22:26 +0200 Original-Received: from localhost ([::1]:33588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYNV-0006ON-1p for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 21:22:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYNI-0006NB-Bm for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:22:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNYN8-0006c2-4I for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:22:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYN8-0006bJ-0N for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VNYN7-0000P0-Ix for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Sep 2013 01:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15433 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.13798128631474 (code B ref -1); Sun, 22 Sep 2013 01:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2013 01:21:03 +0000 Original-Received: from localhost ([127.0.0.1]:54523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNYMB-0000Ni-7F for submit@debbugs.gnu.org; Sat, 21 Sep 2013 21:21:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37916) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNYM7-0000N7-UN for submit@debbugs.gnu.org; Sat, 21 Sep 2013 21:21:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNYLs-00063s-Al for submit@debbugs.gnu.org; Sat, 21 Sep 2013 21:20:54 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYLs-00063o-6y for submit@debbugs.gnu.org; Sat, 21 Sep 2013 21:20:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYLj-0006Jy-1l for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:20:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNYLa-00061V-5O for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:20:34 -0400 Original-Received: from xvm-90.mit.edu ([18.181.2.90]:49055 helo=mod-relay.xvm.mit.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNYLa-00061L-1D for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 21:20:26 -0400 Original-Received: by mod-relay.xvm.mit.edu (Postfix) id 2D54021B35; Sat, 21 Sep 2013 21:20:25 -0400 (EDT) Original-Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by mod-relay.xvm.mit.edu (Postfix) with ESMTP id 11BAE219DF for ; Sat, 21 Sep 2013 21:20:24 -0400 (EDT) Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8M1KNum026121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 22 Sep 2013 01:20:24 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8M1KLai020380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 22 Sep 2013 01:20:23 GMT Original-Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8M1KLt0025035; Sun, 22 Sep 2013 01:20:21 GMT In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:78666 Archived-At: > > This regression is from Emacs 24.1 onward. No such problem before that= . >=20 > You forget to say what the problem is. It isn't obvious. I didn't forget that. It should be obvious. The problem is that Emacs gives the user a wrong-type-argument error in this context. That's a low-level error and message. If the command raises an error at all in this context then it should show a user-friendly msg - a message specific to the command. > > emacs -Q > > M-x set-variable debug-on-error t > > M-x M-- 3 f >=20 > It appears you are trying to enter -3 f's. This is nonsensical. Yes. Yes. > If this isn't what you're trying to do, what is it? Why is that > error message not the right thing to do? This is the user providing a prefix arg, which is perfectly normal. This is not faulty code somewhere providing an arg of the wrong type. It is a user error to provide a negative prefix arg here. In Emacs before 24.1, this particular user error was simply ignored. A better behavior is to raise a reasonable, helpful error for the user. Pretty much *any* command that does things based on a numeric prefix arg (or any prefix arg, for that matter), should check whether the prefix arg value provided by the user makes sense for that command. The command itself should check. It should not just fall back on some low-level error handling. If a numeric prefix arg N is required by some command to be non-negative, or an odd number, or a power of seven, or whatever, then any other N that a user provides should result in a reasonable error message from that command. Preferably the message would help the user by saying what the command expects/requires (e.g., N must be a power of seven that is a power of two). A user should never, or at least almost never, see a wrong-type-arg msg. At a minimum, s?he should not see such a msg for cases where it is easy for Emacs to DTRT and be helpful, i.e., command-specific, with its message.