This must've happened during the last month or two. I'm not sure who's to blame for it, but now when I'm trying to byte-compile a mode derived from c-mode, Emacs can't find any of c-mode functions referenced in the derived mode.
I've looked into cc-bytecom.el and (I'm not sure if it is new, but looks like it is) it defines two macros: cc-requre
and cc-provide
. I can't really understand what they are doing, but they seem to prevent Emacs from finding out that these functions must be available. If, in my code, I try to substitute (requre 'cc-mode)
to (cc-requre 'cc-mode)
nothing changes.
The said macros only seem to apply to the compilation time, but I can't tell for sure, they also call (eval-when-compile (cc-bytecomp-restore-environment))
and (eval-when-compile (cc-bytecomp-load (symbol-name ,cc-part)))
. I'm having hard time figuring what does it do.
I don't see the problem you describe: when I compile the haxe-mode files, I just see a warning about several c-mode functions, saying that they may be undefined at runtime, because haxe-mode.el calls those functions but only loads the correspond files inside an
eval-when-compile
.BTW, those warnings seem to be due to some weird code, probably copied from the infamous cc-bytecomp. The patch below seem to result in a clean compilation: