GNU bug report logs - #15433
24.3.50; wrong-type-argument wholenump -3

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 21 Sep 2013 18:15:01 UTC

Severity: normal

Found in version 24.3.50

Fixed in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15433 in the body.
You can then email your comments to 15433 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15433; Package emacs. (Sat, 21 Sep 2013 18:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 21 Sep 2013 18:15:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; wrong-type-argument wholenump -3
Date: Sat, 21 Sep 2013 11:13:43 -0700 (PDT)
This regression is from Emacs 24.1 onward.  No such problem before that.

emacs -Q

M-x set-variable debug-on-error t

M-x M-- 3 f

Debugger entered--Lisp error: (wrong-type-argument wholenump -3)
  self-insert-command(-3)
  call-interactively(self-insert-command nil nil)
  command-execute(self-insert-command)
  read-from-minibuffer("M-x " nil (keymap (10 . minibuffer-complete-and-exi=
t) (13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Mi=
nibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete=
 as far as possible") (space menu-item "Complete Word" minibuffer-complete-=
word :help "Complete at most one word") (63 menu-item "List Completions" mi=
nibuffer-completion-help :help "Display all possible completions") "Minibuf=
")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completion=
s) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . m=
inibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (prev=
ious menu-item "Previous History Item" previous-history-element :help "Put =
previous minibuffer history element in the minibuffer") (next menu-item "Ne=
xt History Item" next-history-element :help "Put next minibuffer history el=
ement in the minibuffer") (isearch-backward menu-item "Isearch History Back=
ward" isearch-backward :help "Incrementally search minibuffer history backw=
ard") (isearch-forward menu-item "Isearch History Forward" isearch-forward =
:help "Incrementally search minibuffer history forward") (return menu-item =
"Enter" exit-minibuffer :key-sequence "..." :help "Terminate input and exit=
 minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort inpu=
t and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minib=
uffer) (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) =
(9 . self-insert-command) (XF86Back . previous-history-element) (up . previ=
ous-history-element) (prior . previous-history-element) (XF86Forward . next=
-history-element) (down . next-history-element) (next . next-history-elemen=
t) (27 keymap (114 . previous-matching-history-element) (115 . next-matchin=
g-history-element) (112 . previous-history-element) (110 . next-history-ele=
ment))) nil extended-command-history nil nil)
  completing-read-default("M-x " [widget-field-validate menu-path easy-menu=
-filter-return cl-cdadr widget-default-button-face-get :buttons semantic-mo=
des gnus-summary-format cl-member-if-not custom-group-reset-current file-or=
-data widget-key-sequence-map erc-log :custom-form docs ns-drag-color widge=
t-field-value-create iso-8859-13-dos vc-backend-subdirectory-name comment-u=
se-syntax mm-decode custom-field-keymap Custom-no-edit texinfo cl--random-t=
ime org-clock prefix-face :custom-mark-to-reset-standard widget-regexp-vali=
date dired-before-readin-hook custom-modified erc-replace font-lock-choose-=
keywords gnus-dired gnus-html widget-info-link-action question-mark cl-acon=
s vhdl-naming tooltip-strip-prompt TGA Custom-help choice-item custom-promp=
t-variable register widget-children-value-delete view-register cl-callf2 :a=
ction custom-group-sample-face-get ...] commandp t nil extended-command-his=
tory nil nil)
  completing-read("M-x " [widget-field-validate menu-path easy-menu-filter-=
return cl-cdadr widget-default-button-face-get :buttons semantic-modes gnus=
-summary-format cl-member-if-not custom-group-reset-current file-or-data wi=
dget-key-sequence-map erc-log :custom-form docs ns-drag-color widget-field-=
value-create iso-8859-13-dos vc-backend-subdirectory-name comment-use-synta=
x mm-decode custom-field-keymap Custom-no-edit texinfo cl--random-time org-=
clock prefix-face :custom-mark-to-reset-standard widget-regexp-validate dir=
ed-before-readin-hook custom-modified erc-replace font-lock-choose-keywords=
 gnus-dired gnus-html widget-info-link-action question-mark cl-acons vhdl-n=
aming tooltip-strip-prompt TGA Custom-help choice-item custom-prompt-variab=
le register widget-children-value-delete view-register cl-callf2 :action cu=
stom-group-sample-face-get ...] commandp t nil extended-command-history)
  read-extended-command()
  byte-code("..." [current-prefix-arg read-extended-command] 2)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-09-20 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=3D-O0 -g3' CPPFLAGS=3D-DGLYPH_DEBUG=
=3D1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15433; Package emacs. (Sat, 21 Sep 2013 21:40:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: gnu-emacs-bug <at> moderators.isc.org
Subject: Re: bug#15433: 24.3.50; wrong-type-argument wholenump -3
Date: Sat, 21 Sep 2013 21:39:09 +0000 (UTC)
Drew Adams <drew.adams <at> oracle.com> wrote:
> This regression is from Emacs 24.1 onward.  No such problem before that.

You forget to say what the problem is.  It isn't obvious.

> emacs -Q

> M-x set-variable debug-on-error t

> M-x M-- 3 f

It appears you are trying to enter -3 f's.  This is nonsensical.  If
this isn't what you're trying to do, what is it?  Why is that error
message not the right thing to do?

> Debugger entered--Lisp error: (wrong-type-argument wholenump -3)
>  self-insert-command(-3)
>  call-interactively(self-insert-command nil nil)
 .....

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15433; Package emacs. (Sun, 22 Sep 2013 01:22:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Alan Mackenzie <acm <at> muc.de>, gnu-emacs-bug <at> moderators.isc.org
Subject: RE: bug#15433: 24.3.50; wrong-type-argument wholenump -3
Date: Sat, 21 Sep 2013 18:20:23 -0700 (PDT)
> > This regression is from Emacs 24.1 onward.  No such problem before that.
> 
> 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
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15433; Package emacs. (Mon, 10 Feb 2014 04:30:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15433 <at> debbugs.gnu.org
Subject: Re: bug#15433: 24.3.50; wrong-type-argument wholenump -3
Date: Sun, 09 Feb 2014 20:27:34 -0800
Drew Adams <drew.adams <at> oracle.com> writes:

> This regression is from Emacs 24.1 onward.  No such problem before that.
>
> emacs -Q
>
> M-x set-variable debug-on-error t
>
> M-x M-- 3 f
>
> Debugger entered--Lisp error: (wrong-type-argument wholenump -3)
>   self-insert-command(-3)

This has been fixed earlier.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug marked as fixed in version 24.4, send any further explanations to 15433 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 10 Feb 2014 04:30:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Mar 2014 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 105 days ago.

Previous Next


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