GNU bug report logs - #50482
Unhelpful error message whilst byte-compiling a function.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Wed, 8 Sep 2021 20:39:01 UTC

Severity: minor

Tags: notabug

Done: Alan Mackenzie <acm <at> muc.de>

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 50482 in the body.
You can then email your comments to 50482 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#50482; Package emacs. (Wed, 08 Sep 2021 20:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 Sep 2021 20:39:01 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Unhelpful error message whilst byte-compiling a function.
Date: Wed, 8 Sep 2021 20:37:45 +0000
Hello, Emacs

I'm working on Emacs 28.  Not emacs -Q, but it shouldn't matter.

I'm working on a function which begins thus:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun jit-lock--run-functions-new (beg end &optional last-fun)
  (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified.
        (loose-beg beg) (loose-end end)) ; The maximum region we have fontified
                                        ; with at least some of
                                        ; `jit-lock-functions'.
    (run-hook-wrapped
     'jit-lock-functions
......
......
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

On doing M-x compile-defun on this function, I get as sum total of the
output in *Compile-Log* this:

Buffer jit-lock.el:416:1: Error: Wrong number of arguments: #<subr
macroexp--warn-wrap>, 3

..  I don't know what this means.  Line 416 is the line where the defun
starts.  I don't have `macroexp--warn-wrap' anywhere in my source code,
it's not clear to what form 3 arguments are being wrongly passed, or
where.

Emacs compilation messages should not be so obscure.  This message
should be so formulated that I can see immediately what needs fixing.

#########################################################################

Second curiosity.  I can evaluate that defun form, and when I do C-h C-f
on it, I get:

jit-lock--run-functions-new is a Lisp closure in `jit-lock.el'.

A "closure" for crying out loud.  It's a FUNCTION, created by defun.
Calling a function a "closure" seems very pretentious and somewhat
patronising.  Not all users will know what it means.

Was there some discussion on emacs-devel which I somehow missed, where
this was agreed to?  If not, can we restore this word to "function",
please?

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50482; Package emacs. (Thu, 09 Sep 2021 14:43:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 50482 <at> debbugs.gnu.org
Subject: Re: bug#50482: Unhelpful error message whilst byte-compiling a
 function.
Date: Thu, 09 Sep 2021 16:42:29 +0200
Alan Mackenzie <acm <at> muc.de> writes:

> I'm working on a function which begins thus:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (defun jit-lock--run-functions-new (beg end &optional last-fun)
>   (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified.
>         (loose-beg beg) (loose-end end)) ; The maximum region we have fontified
>                                         ; with at least some of
>                                         ; `jit-lock-functions'.
>     (run-hook-wrapped
>      'jit-lock-functions
> ......
> ......
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> On doing M-x compile-defun on this function, I get as sum total of the
> output in *Compile-Log* this:
>
> Buffer jit-lock.el:416:1: Error: Wrong number of arguments: #<subr
> macroexp--warn-wrap>, 3

If I just put that in a buffer (and add some closing parentheses), I
don't get that warning.  Is there something else needed?

> ..  I don't know what this means.  Line 416 is the line where the defun
> starts.  I don't have `macroexp--warn-wrap' anywhere in my source code,
> it's not clear to what form 3 arguments are being wrongly passed, or
> where.

The warn-wrap stuff comes from `with-suppressed-warnings', I think.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50482; Package emacs. (Thu, 09 Sep 2021 17:14:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50482 <at> debbugs.gnu.org
Subject: Re: bug#50482: Unhelpful error message whilst byte-compiling a
 function.
Date: Thu, 9 Sep 2021 17:13:19 +0000
[Message part 1 (text/plain, inline)]
Hello, Lars.

On Thu, Sep 09, 2021 at 16:42:29 +0200, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm <at> muc.de> writes:

> > I'm working on a function which begins thus:

> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > (defun jit-lock--run-functions-new (beg end &optional last-fun)
> >   (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified.
> >         (loose-beg beg) (loose-end end)) ; The maximum region we have fontified
> >                                         ; with at least some of
> >                                         ; `jit-lock-functions'.
> >     (run-hook-wrapped
> >      'jit-lock-functions
> > ......
> > ......
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> > On doing M-x compile-defun on this function, I get as sum total of the
> > output in *Compile-Log* this:

> > Buffer jit-lock.el:416:1: Error: Wrong number of arguments: #<subr
> > macroexp--warn-wrap>, 3

> If I just put that in a buffer (and add some closing parentheses), I
> don't get that warning.  Is there something else needed?

It would appear so.  On putting the entire function into *scratch*,
compile-defun gives the same error in scratch, so I'm attaching the file.
Note that lexical-binding was t in my *scratch*.

> > ..  I don't know what this means.  Line 416 is the line where the defun
> > starts.  I don't have `macroexp--warn-wrap' anywhere in my source code,
> > it's not clear to what form 3 arguments are being wrongly passed, or
> > where.

> The warn-wrap stuff comes from `with-suppressed-warnings', I think.

Just to be entirely clear, I'm not asking for help in debugging this
error message (although that wouldn't go amiss) - I'm asking that Emacs
be amended such that this unhelpful message cannot appear any more.

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

-- 
Alan Mackenzie (Nuremberg, Germany).

[jit-lock--run-functions-new.el (text/plain, attachment)]

Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Thu, 09 Sep 2021 18:13:02 GMT) Full text and rfc822 format available.

Notification sent to Alan Mackenzie <acm <at> muc.de>:
bug acknowledged by developer. (Thu, 09 Sep 2021 18:13:02 GMT) Full text and rfc822 format available.

Message #16 received at 50482-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50482-done <at> debbugs.gnu.org
Subject: Re: bug#50482: Unhelpful error message whilst byte-compiling a
 function.
Date: Thu, 9 Sep 2021 18:12:08 +0000
Hello again, Lars.

On Thu, Sep 09, 2021 at 16:42:29 +0200, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm <at> muc.de> writes:

> > I'm working on a function which begins thus:
> >
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > (defun jit-lock--run-functions-new (beg end &optional last-fun)
> >   (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified.
> >         (loose-beg beg) (loose-end end)) ; The maximum region we have fontified
> >                                         ; with at least some of
> >                                         ; `jit-lock-functions'.
> >     (run-hook-wrapped
> >      'jit-lock-functions
> > ......
> > ......
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >
> > On doing M-x compile-defun on this function, I get as sum total of the
> > output in *Compile-Log* this:
> >
> > Buffer jit-lock.el:416:1: Error: Wrong number of arguments: #<subr
> > macroexp--warn-wrap>, 3

> If I just put that in a buffer (and add some closing parentheses), I
> don't get that warning.  Is there something else needed?

> > ..  I don't know what this means.  Line 416 is the line where the defun
> > starts.  I don't have `macroexp--warn-wrap' anywhere in my source code,
> > it's not clear to what form 3 arguments are being wrongly passed, or
> > where.

> The warn-wrap stuff comes from `with-suppressed-warnings', I think.

The problem was I hadn't compiled macroexp.el for a long time, and in
the meantime macroexp--warn-wrap had indeed acquired an extra parameter.
The version I have is expecting 2 arguments, but is being supplied with
3.

Apologies for sending you on a wild goose chase.  I will close the bug
as not a bug.

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

-- 
Alan Mackenzie (Nuremberg, Germany).




Added tag(s) notabug. Request was from Alan Mackenzie <acm <at> muc.de> to control <at> debbugs.gnu.org. (Thu, 09 Sep 2021 18:20:03 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. (Fri, 08 Oct 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 199 days ago.

Previous Next


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