help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: unexpected byte-compiler behaviour


From: John Mastro
Subject: Re: unexpected byte-compiler behaviour
Date: Thu, 9 Mar 2017 10:18:13 -0800

hector <hectorlahoz@gmail.com> wrote:
> I'm trying to compile a file and it's driving me crazy.
> At some point of the file I'm reading unexpected messages:
>
> lyqi.el:137:1:Warning: `(abbrev :initarg :abbrev)' is a malformed function
>
> There's something weird going on here. So I write a nonsense function call
> at top level:
> (djghalkjhg)
>
> The byte-compiler just skips this and keeps showing the first message.
>
> When I cut the file at this point the compiler says what I expect:
>
> tmp.el:136:1:Warning: the function `djghalkjhg' is not known to be defined.
>
> How can this be?
>
> This leads me to think that the parser is doing more than one pass since
> a text after this point is affecting compilation at this point.
>
> If this is true, what the heck is causing it to not report that
> function "djghalkjhg" is not defined?

In Emacs 25.1, I see the behavior you would expect. With this content in
a file test.el:

    ;; test.el

    ((abbrev :initarg :abbrev) 'foo)

    (djghalkjhg)

I call `byte-compile-file' and see these warnings:

    Compiling file /tmp/test.el at Thu Mar  9 10:14:23 2017
    Entering directory ‘/tmp/’
    test.el:3:1:Warning: ‘(abbrev :initarg :abbrev)’ is a malformed function

    In end of data:
    test.el:6:1:Warning: the function ‘djghalkjhg’ is not known to be defined.

Warnings don't cause the byte compiler to stop, so you should indeed see
both warnings, as I do.

        John



reply via email to

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