Subject: Re: bug#42425: 26.3.50; Compilation warnings when compiling eldoc.el under Emacs 26.3

From: João Távora <[email-masked]>
Date: Sat, 23 Jan 2021 17:53:48 +0000

On Sat, Jan 23, 2021 at 5:35 PM Philipp Stephani <[email-masked]> wrote:
>
> Am Fr., 22. Jan. 2021 um 20:58 Uhr schrieb Lars Ingebrigtsen <[email-masked]>:
> >
> > Philipp Stephani <[email-masked]> writes:
> >
> > > eldoc is now a separate package that claims to support Emacs 26.3.
> > > However, compiling eldoc.el results in a few warnings:
> > >
> > > emacs -Q -batch -l bytecomp -f batch-byte-compile eldoc.el
> > >
> > > In eldoc--eval-expression-setup:
> > > eldoc.el:236:9:Warning: assignment to free variable
> > >     ‘eldoc-documentation-strategy’
> > >
> > > In eldoc--supported-p:
> > > eldoc.el:615:19:Warning: reference to free variable
> > >     ‘eldoc-documentation-strategy’
> > >
> > > In eldoc--invoke-strategy:
> > > eldoc.el:732:28:Warning: reference to free variable
> > >     ‘eldoc-documentation-strategy’
> > >
> > > In end of data:
> > > eldoc.el:804:1:Warning: the following functions are not known to be defined:
> > >     elisp-eldoc-var-docstring, elisp-eldoc-funcall
> > >
> > > 1. Probably the definition of `eldoc-documentation-strategy' needs to be
> > >    moved before its first use.
> >
> > Doing so seems easy enough, but I'm not sure how high our ambitions are
> > for doing warning-free ELPA packages on older Emacs versions?  (I've
> > added João to the CCs.)
>
> I think our ambitions should be quite high. (I personally think we
> should treat almost all compiler warnings as errors/bugs and fix them
> whenever realistically possible.)

I agree, but with strong emphasis on the realism bit.  So if you can fix this
and not break the master, 28 + ELPA, 27.1 + ELPA, 26.3 + ELPA cases, I'm
fine with it.

Just noting that shushing a warning is not the same as "fixing" it, but
of course you know that.

I remember there being extra trouble because eldoc.el is preloaded
(because it is required by elisp-mode.el, which is also preloaded).

Maybe the warnings you are bringing up have nothing to do with this,
though.

Another note, it must compile in version X and load in that version X.
This has to be able to happen in the same session or in separate sessions.
so you have 4 test cases per version.

When aliasing some variables for backward compat, there were problems
because of that. I think the direction of the alias is different in 26 and 27,
or something like that.  In practice it makes no difference: code referencing
that name points to the same thing, though the thing is different in 26 and 27.

Extra credit if you can avoid pre-loading Eldoc altogether.   CC'in
Stefan cause I think he had some input on that (sorry for the noise if I'm
mistaken,Stefan).

Good luck, João