Closed sfllaw closed 3 years ago
I was planning something like that eventually but haven't done so yet because I think this is not as trivial as you make it out to be and will require some thought. E.g. we might want to do it asynchronously because we do it on every save. Byte-compile first in that case? Should it work differently during load than during save? ...
I definitely plan to have this ready by the time a nativecomp powered Emacs is due to be released, but might delay working on this until that release gets closer. You can redefine packed-byte-compile-file
if you desperately need this now.
@tarsius Fair enough! I didn’t check if running packed-byte-compile-file
on save was a good enough experience. If it is slow, then I agree that it might make sense to do this asynchronously.
I've added an option to enable this but I recommend against enabling it as explained in the doc-string.
When native compilation is available,
(and (fboundp 'native-comp-available-p) (native-comp-available-p)))
, usenative-compile
instead ofpacked-byte-compile-file
.Auto-compile should provide a
auto-compile-function
that defaults to native compilation when available, but falls back to the old function.