I've got one file including
(eval-when-compile (require 'cl))
Some other files require this file, and also need to have cl
required when they are byte-compiled. This is not happening - this first file does not appear to know it is getting byte compiled, when it is required by other files that are getting byte compiled. Is there a way to craft an eval-when-compile
statement in this first file, such that files that require it to also require cl
when they are getting byte compiled?
EDIT: Context of the question:
When I download https://github.com/idris-hackers/idris-mode
and run make build
to byte compile, I get warnings in two separate files, idris-prover.el
and idris-repl.el
. Both of these files require inferior-idris.el
which contains the line (eval-when-compile (require 'cl))
. If I add that line to the two files, the warnings disappear. I am wondering if that would be the best solution to fix the warnings. Warnings include:
idris-prover.el:224:44:Warning: `:ok' called as a function
idris-prover.el:239:19:Warning: `:error' called as a function
idris-prover.el:253:67:Warning: `t' called as a function
eval-when-compile
statements are processed just like A's are? – jcarpenter2 Dec 16 '17 at 05:09(setq hello t)
, B contains(require C)
, and A contains(require B)
, then for succeeding lines in A,hello
will be defined ast
? – jcarpenter2 Dec 16 '17 at 05:53eval-when-compile
statements not be executed inside the packages that it requires? – jcarpenter2 Dec 16 '17 at 05:54(eval-wnen-compile (require 'B)
is not(require 'B)
. 2. If you load or compile A then B gets loaded (and thus C gets loaded). Loading B is not the same as compiling B. See (elisp)Named Features.This looks like it might be an X-Y problem - what is it that you are really trying to do?
– Drew Dec 16 '17 at 06:09(require 'A)
are having their requires satisfied by the.elc
(rather than.el
) file. and, for whatever reason, the.elc
doesn't note the require? you could test by removingA.elc
. – Greg Minshall Apr 05 '21 at 06:40