Common idiom to workaround macro expansion or resolve warning about undefined variables during byte-compilation:
(eval-when-compile
(require 'cl-lib))
But this require ...
compiled into .elc
file! I found that cl-eval-when
have proper semantic (according to name).
Normally we don't need for require
as site file and package.el
For example I want to byte-compile my .emacs
which uses some external macros, but silently pass through if there are no such package:
(cl-eval-when 'compile
(condition-case err
(require 'w3m-util)
(error (byte-compile-warn "Failed by: %S" err))))
(w3m-util-DEPENDENT-CODE ...)
Another way to do this is:
(ignore-error
(require 'w3m-util)
(w3m-util-DEPENDENT-CODE ...))
But now we are not a top level form...
Do I properly fill that eval-when-compile
name do something that is not expected from its name?