Subject: Re: bug#16573: 24.3; Auctex (11.87.2) in Elpa issues hundreds of warnings on compile

From: Achim Gratz <[email-masked]>
Date: Tue, 28 Jan 2014 23:29:02 +0100

Stefan Monnier writes:
>> (eval-and-compile
>>   (unless (fboundp 'declare-function)
>>     (defmacro declare-function (fn file &optional arglist fileonly)
>>       `(autoload ',fn ,file))))
>
> Yuck!  This is an ugly trick trying to silence warnings.

Not much uglier than declare-function itself.  These things would
perhaps benefit if one could declare-require the source file in question
(it's almost invariably callbacks and guarded calls into external
packages that end up needing this treatment), but that still doesn't
address how to make it backward compatible.

> Better macroexpand it to nil: you'll get warnings in older Emacsen, but
> at least you won't end up changing the code's behavior.

That's certainly not recommended for everyone and everything, but since
declare-function must used in situations were the function to be
declared is known to be already defined at runtime, the autoload will
never do anything anyway; if it does it was a bug to begin with.
Defining this nil and then not finding the one warning that must be
dealt with in the hundreds of spurious warnings is decidedly worse.

Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs