[Top][All Lists]

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

Re: address@hidden: RE: weirddefadvicebugwithbyte-compilation]

From: Eli Zaretskii
Subject: Re: address@hidden: RE: weirddefadvicebugwithbyte-compilation]
Date: Tue, 13 Dec 2005 06:30:54 +0200

> From: "Drew Adams" <address@hidden>
> Date: Mon, 12 Dec 2005 13:53:31 -0800
>     > This makes me wonder now if byte-compiling in defadvice (i.e.
>     > on the fly)
>     > should display a *Compile Log* buffer at all. I don't know.
>     Why not?  It's a byte compilation like any other one, and these
>     warnings do serve a purpose: your code, as posted, had a bug.
> Where is the bug? The byte-compiler warning presumably arose because it
> compiled a defadvice that referred to variable my-mode. That variable is not
> bound in the defadvice body and it might not be bound at the point in the
> file when the defadvice is compiled. Is that a bug?

Well, it might be.  (I thought you actually said elsewhere in this
thread that it was a bug, and that you deliberately kept it in the
code to reproduce the crash.)  The warning alerts you to look into

> Should people systematically place defadvice last in a file or do
> (provide 'x)(require 'x) just to make sure that all variables in a
> defadvice body are defined before it is compiled?

If you want the byte compiler help you find such typos, then yes, you
should try to eliminate gratuitous warnings, to keep the noise level
low enough for you to see the real warnings.

> I also don't understand, as I mentioned, _why_ the defadvice in foo.el is
> byte-compiled - it has no `compile' keyword.

I thought this was how defadvice worked, but I might be wrong.  In any
case, the fact that the byte compiler is run is clear from the

reply via email to

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