Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew

From: Eli Zaretskii <[email-masked]>
Date: Sun, 28 Jul 2024 07:58:51 +0300

> Cc: [email-masked], [email-masked]
> From: Tassilo Horn <[email-masked]>
> Date: Sat, 27 Jul 2024 22:50:35 +0200
> 
> Arash Esbati <[email-masked]> writes:
> 
> > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
> > text editors" <[email-masked]> writes:
> >
> >>> So the conclusion is to simply (require 'cl-lib) instead of
> >>> (eval-when-compile (require 'cl-lib))?  But how can the
> >>> byte-compiler conclude that cl-member might not be defined at
> >>> runtime given that it's an autoloaded function?
> >>
> >> It's autoloaded from `cl-seq` when `cl-lib` is loaded.
> >> It's not autoloaded at startup.
> 
> What's that magic?
> 
>   emacs -Q
>   (featurep 'cl-lib) ;=> nil
>   (describe-function 'cl-member) ; prints the help string to *Messages*
>   (featurep 'cl-lib) ;=> t
> 
> Do the help facilities load stuff on demand?

Yes, of course.  As the rest of Emacs, actually.  In fact, only
help.el is preloaded, the rest of Help facilities (help-mode,
help-fns, apropos, etc.) are loaded on demand only.