Byte Compilation Verbosity Management (CL Library)

When byte-compiling multiple eLisp files in a package, the compiler output is cluttered with the warning Warning: function `position' from cl package called at runtime . I understand, although I do not agree with the policy in the cl package. But this makes it difficult to identify other, more useful warnings. So, while there is no real way to avoid a warning, is there a way to selectively turn off all warnings of a particular pattern?

EDIT: (attached example)

create a file called doodles.el

 (require 'cl) (eval-when-compile (require 'cl)) (dotimes (i 1) (position ?\x "x")) 

Mx byte-compile-file RET doodles.el

Switch to the *Compile-Log* buffer:

 doodles.el:1:1:Warning: cl package required at runtime 

this is what you get.

+7
source share
2 answers

You can manage byte compiler warnings with a local variable block that sets the byte-compile-warnings . To disable the CL-at-runtime warning, put this near the end of your module:

 ;; Local Variables: ;; byte-compile-warnings: (not cl-functions) ;; End: 
+5
source

The warning function position from cl package called at runtime does not exist due to the policy on the CL (well, it has something to do with it, though), but it points to a real real problem: you are using position in a file that does not (require 'cl) . The file probably has (eval-when-compile (require 'cl)) , which means that CL is available at compile time (for example, for CL macro extensions), but will not load at run time.

Often this does not lead to an error, because some other file is somewhere (require 'cl) for you, but you just got lucky.

+1
source

All Articles