[Top][All Lists]

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

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

From: Drew Adams
Subject: RE: address@hidden:RE:weirddefadvicebugwithbyte-compilation]
Date: Wed, 14 Dec 2005 17:46:46 -0800

    > So, the presence of `compile' in one defadvice turns on
    > byte-compilation for subsequent defadvices - IOW, it's modal? I
    > don't see that explained anywhere.

    What part of "`maybe' will compile if the byte-compiler is already
    loaded" don't you understand?

Got it. Thanks again. It all comes back to `ad-default-compilation-action' -
the "explanation" of the defadvice `compile' flag behavior is the
description of option `ad-default-compilation-action' (3 long pages later,
with no forward xref to it). A few simple turns around Robinson's barn, and
we have it!

I think the doc string and the Info description of `defadvice' should
explicitly mention that the behavior of the `compile' FLAG value is
overridden by the value of `ad-default-compilation-action'. The current text
gives the impression that for a `defadvice' to be compiled you need both
defadvice flags present: `activate' and `compile'. And it gives the
impression that if both are present then the defadvice will be compiled.
Neither impression is necessarily correct, in fact - it all depends on

Also, given 1) this overriding behavior, 2) the default value of `maybe' for
`ad-default-compilation-action', and 3) the fact that a single `compile'
flag will turn on compilation modally, I don't see much sense in having that
flag.  __What is the use case for it?__

If the value of `ad-default-compilation-action' is `always', `never', or
`like-original' then the defadvice `compile' flag presumably does nothing
(it's presence or absence is irrelevant). If the option value is `maybe',
then the first occurrence of the `compile' flag in a defadvice turns
compilation on forever (until you change `ad-default-compilation-action').

That is, it would seem that the only time defadvice's `compile' has any
effect at all is for the first occurrence of the flag in some defadvice, and
then only if 1) flag `activate' is also present and 2)
`ad-default-compilation-action' is `maybe'. Is that right? Not much of a
raison d'etre.

I haven't tried the numerous possible combinations. I'm just trying to
understand the behavior from the descriptions. Summary: To me, the doc for
the defadvice `compile' flag conflicts with the doc for option
`ad-default-compilation-action', and it appears that the latter is what's
correct. And I don't really see why the `compile' flag exists.

I'm probably missing something here, as I was before by being ignorant of
`ad-default-compilation-action'. Let me know.

reply via email to

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