unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18966: 25.0.50; unhelpful error message from byte compiler
@ 2014-11-05 23:54 Tom Tromey
  2020-08-20 17:54 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2014-11-05 23:54 UTC (permalink / raw)
  To: 18966


Byte compile this code:

(push zzz)

I get:

q.el:1:1:Error: Wrong number of arguments: (2 . 2), 1

This should at least mention "push".
If you have a longer program, the line number will not always be
helpful.  In my case it pointed to the start of a long defun -- but the
bad push was toward the end.




In GNU Emacs 25.0.50.7 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9)
 of 2014-11-02 on bapiya
Repository revision: 118270 larsi@gnus.org-20141103010307-bxryy53hat500i4w
Windowing system distributor `Fedora Project', version 11.0.11404000
Configured using:
 `configure --prefix=/home/tromey/Emacs/install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  flyspell-mode: t
  which-function-mode: t
  global-auto-revert-mode: t
  desktop-save-mode: t
  erc-services-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill

Recent input:
C-b C-f C-SPC C-M-b C-M-f C-f C-SPC C-M-b C-M-b M-f 
C-M-f C-M-f C-f C-M-b M-b C-b C-M-f C-M-b C-x C-x C-f 
C-] C-] C-g M-< C-z n C-x b * c o m <tab> <return> 
C-x b <return> C-c g 2 3 <return> C-M-SPC M-w C-z n 
C-u C-u C-n C-u C-n C-p C-o C-o ( m a c r o e x p a 
n d - a l l SPC ' C-y ) C-j C-v C-] C-z n C-p C-M-b 
C-n M-f C-f C-f C-f C-a C-u C-n C-u C-n C-n C-n C-n 
C-e C-M-b C-M-f C-M-f C-M-f C-e C-M-b C-M-f C-a M-f 
C-M-f C-M-f C-M-f M-b C-z n C-p C-e C-j C-n C-e C-a 
C-n C-e C-a C-] C-z n C-a C-u C-p C-u C-p s p u s h 
C-/ C-s f a k e C-w C-w <backspace> C-s C-s C-e C-M-f 
C-M-f C-M-f C-p C-p C-p C-e C-M-b C-p C-p C-e C-M-b 
C-M-f C-M-f C-a M-f M-f C-M-f C-n C-b C-n C-a C-M-SPC 
M-w C-z n C-u C-p C-u C-p M-f M-f C-f C-f C-M-k C-y 
M-y C-M-b C-M-f C-e C-M-b C-M-f C-j C-] C-z n C-u C-p 
C-s o r e f C-n C-a C-M-f C-M-b C-f C-f C-M-f C-M-f 
C-M-b C-M-f C-n C-a M-f C-M-f C-M-f C-M-b C-M-f C-o 
<return> C-/ C-/ C-e C-M-b C-M-f C-z n <return> ( m 
a c r M-/ SPC ' ( u p s h SPC C-u C-b C-t C-e z z z 
) ) C-j C-] C-x b q . j <backspace> e <tab> <return> 
<tab> C-g C-x C-f M-r q . e l <return> <return> C-n 
C-p C-SPC C-u C-u C-n C-w ( p u s h SPC z z z ) <return> 
C-x C-s M-x r e p o r t - <tab> <return>

Recent messages:
forward-sexp: Scan error: "Containing expression ends prematurely", 1057, 1058
Undo! [2 times]
Entering debugger...
Quit
Making completion list...
Quit
Mark set
next-line: End of buffer
Saving file /home/tromey/Emacs/ET/q.el...
Wrote /home/tromey/Emacs/ET/q.el

Load-path shadows:
/home/tromey/.emacs.d/elpa/css-mode-1.0/css-mode hides /home/tromey/Emacs/install/share/emacs/25.0.50/lisp/textmodes/css-mode
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/25.0.50/lisp/play/bubbles

Features:
(mailalias view xterm shadow emacsbug python json elcomp mail-hist
find-dired pcmpl-unix pcmpl-gnu shell make-mode flow-fill mule-util
bbdb-gui bbdb-hooks sort gnus-cite smiley shr-color color shr browse-url
mm-archive gnus-async gnus-bcklg qp gnus-ml disp-table gnus-topic
nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-snarf mail-extr bbdb-com
warnings cl gnutls network-stream starttls gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache gnus-registry
registry eieio-base gnus-art mm-uu mml2015 mm-view mml-smime smime dig
mailcap gnus-sum gnus-group gnus-undo smtpmail sendmail gnus-start
gnus-cloud nnimap nnmail mail-source tls utf7 netrc nnoo parse-time
gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader idutils
derived log-edit message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
mail-utils gmm-utils mailheader pcvs-util eieio-opt speedbar sb-image
ezimage dframe dabbrev help-mode debug copyright misearch multi-isearch
edebug texinfo sh-script smie executable sgml-mode org-element org-rmail
org-mhe org-irc org-info org-gnus org-docview doc-view image-mode
org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs smerge-mode diff-mode easy-mmode bug-reference goto-addr
add-log vc-arch vc-mtn vc-hg jka-compr dired vc-sccs vc-svn vc-cvs
vc-rcs vc-bzr cc-mode cc-fonts cc-guess cc-menus cc-cmds vc-git flyspell
ispell diminish projectile edmacro kmacro pkg-info find-func lisp-mnt
epl grep compile dash s appt diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs which-func imenu minimap autorevert filenotify desktop
frameset cus-start cus-load status erc-services erc-list erc-menu
erc-join erc-ring erc-networks erc-pcomplete pcomplete erc-track
erc-match erc-button wid-edit erc-fill erc-stamp erc-netsplit
erc-goodies erc erc-backend erc-compat format-spec auth-source cl-macs
gv eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core
cl-loaddefs cl-lib gnus-util mm-util mail-prsvr password-cache thingatpt
pp advice help-fns vc-dir ewoc vc vc-dispatcher cc-styles cc-align
cc-engine cc-vars cc-defs bbdb timezone ange-ftp comint ansi-color ring
server savehist dwarf-mode-autoloads gdb-shell-autoloads
jabber-autoloads lisppaste-autoloads pydoc-info-autoloads info-look info
easymenu weblogger-autoloads package epg-config bbdb-autoloads time-date
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 1067070 134237)
 (symbols 48 101418 16)
 (miscs 40 41994 5114)
 (strings 32 315336 71947)
 (string-bytes 1 7458435)
 (vectors 16 97649)
 (vector-slots 8 2097105 84558)
 (floats 8 566 1009)
 (intervals 56 62391 6207)
 (buffers 976 229)
 (heap 1024 259978 33479))

Tom





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18966: 25.0.50; unhelpful error message from byte compiler
  2014-11-05 23:54 bug#18966: 25.0.50; unhelpful error message from byte compiler Tom Tromey
@ 2020-08-20 17:54 ` Lars Ingebrigtsen
  2020-08-20 18:19   ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-20 17:54 UTC (permalink / raw)
  To: Tom Tromey; +Cc: 18966, Stefan Monnier

Tom Tromey <tom@tromey.com> writes:

> Byte compile this code:
>
> (push zzz)
>
> I get:
>
> q.el:1:1:Error: Wrong number of arguments: (2 . 2), 1
>
> This should at least mention "push".

This problem is still present in Emacs 28.

Like in bug#35186, I'm not able to actually chase down where this error
message comes from.  I've tried to look at all the relevant
wrong-number-of-arguments in lisp/emacs-lisp, but it doesn't look like
any of them are responsible.

Anybody knows where this comes from?

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18966: 25.0.50; unhelpful error message from byte compiler
  2020-08-20 17:54 ` Lars Ingebrigtsen
@ 2020-08-20 18:19   ` Andreas Schwab
  2020-08-21 11:20     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2020-08-20 18:19 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18966, Tom Tromey, Stefan Monnier

On Aug 20 2020, Lars Ingebrigtsen wrote:

> Like in bug#35186, I'm not able to actually chase down where this error
> message comes from.

It's just a generic macro expansion error:

ELISP> (macroexpand '(push zzz))
*** Eval error ***  Wrong number of arguments: (2 . 2), 1
ELISP> (push zzz)
*** Eval error ***  Wrong number of arguments: (2 . 2), 1

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18966: 25.0.50; unhelpful error message from byte compiler
  2020-08-20 18:19   ` Andreas Schwab
@ 2020-08-21 11:20     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-21 11:20 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 18966, Tom Tromey, Stefan Monnier

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Aug 20 2020, Lars Ingebrigtsen wrote:
>
>> Like in bug#35186, I'm not able to actually chase down where this error
>> message comes from.
>
> It's just a generic macro expansion error:
>
> ELISP> (macroexpand '(push zzz))
> *** Eval error ***  Wrong number of arguments: (2 . 2), 1
> ELISP> (push zzz)
> *** Eval error ***  Wrong number of arguments: (2 . 2), 1

Hm...  I grepped through *.c for the error, and the place where it seems
to actually trigger in the test case:

./src/emacs -Q --batch -f batch-byte-compile /tmp/t.el 
-> /tmp/t.el:3:1: Error: Wrong number of arguments: (2 . 2), 1

Is here:

Lisp_Object
exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
		Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args)
{
[...]
      if (! (mandatory <= nargs && nargs <= maxargs))
	Fsignal (Qwrong_number_of_arguments,
		 list2 (Fcons (make_fixnum (mandatory), make_fixnum (nonrest)),
			make_fixnum (nargs)));

Which seems odd -- you'd expect it to bug out much earlier, in
macroexpand, as Andreas says.

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-21 11:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 23:54 bug#18966: 25.0.50; unhelpful error message from byte compiler Tom Tromey
2020-08-20 17:54 ` Lars Ingebrigtsen
2020-08-20 18:19   ` Andreas Schwab
2020-08-21 11:20     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).