emacscollective / auto-compile

Automatically compile Emacs Lisp libraries
GNU General Public License v3.0
172 stars 16 forks source link

README lacks explanation as to why avoiding init.el compilation #18

Closed DamienCassou closed 6 years ago

DamienCassou commented 6 years ago

README says:

You should also consider not byte-compiling your personal init file, or setting load-prefer-newer in a system-wide init file.

I don't understand two things:

I have a problem that might be related to this: https://github.com/jwiegley/use-package/issues/574.

tarsius commented 6 years ago

At the time the init file is loaded load-prefer-newer is nil and the auto-compile modes are not in effect, so you might end up loading an outdated init.elc. By not ever compiling init.el that can be prevented.

The alternative is to set load-prefer-newer to t in another init file that is loaded earlier. Then init.elc might still be outdated (like any other *.elc file), but at least it is not loaded. And of course you could also setup auto-compile in that other file. But now it might be a good idea to not compile that other file...

I think load-prefer-newer's default value should be t - why would you ever want to load an outdated file?

Anyway, I am not following my own recommendation here and do compile ~/.emacs.d/init.el and I should probably remove this recommendation and instead just point out that this potential issue exists (and that it could be avoided by not compiling, but that you probably don't want that for other reasons (performance, use-package,...).

DamienCassou commented 6 years ago

Thanks for the explanation. The ticket I reference above seems to indicate there is an issue when init.el is byte compiled and it relies on use-package. /cc @jwiegley.