emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50482: closed (Unhelpful error message whilst byte-compiling a funct


From: GNU bug Tracking System
Subject: bug#50482: closed (Unhelpful error message whilst byte-compiling a function.)
Date: Thu, 09 Sep 2021 18:13:02 +0000

Your message dated Thu, 9 Sep 2021 18:12:08 +0000
with message-id <YTpOeOTECwkceHi+@ACM>
and subject line Re: bug#50482: Unhelpful error message whilst byte-compiling a 
function.
has caused the debbugs.gnu.org bug report #50482,
regarding Unhelpful error message whilst byte-compiling a function.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
50482: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50482
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- 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).



--- End Message ---
--- Begin Message --- 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@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).


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]