Set up automatic compilation of emacs-lisp

We set the load-prefer-newer in init.el, so automatic compilation should
be relatively safe. Still worth looking out for any issues this commit
might cause.
This commit is contained in:
Ivan Malison 2016-06-21 22:35:37 -07:00
parent 60404e6f78
commit 62ba0f0413
2 changed files with 17 additions and 0 deletions

View File

@ -15,6 +15,20 @@ This makes it so that the file that is produced from tangling this file uses lex
(replace-regexp-in-string "\n$" "" (shell-command-to-string (replace-regexp-in-string "\n$" "" (shell-command-to-string
"git config --get user.email"))) "git config --get user.email")))
#+END_SRC #+END_SRC
** auto-compile
This is here because it needs to be activated as early as possible
#+BEGIN_SRC emacs-lisp
(use-package auto-compile
:config
(progn
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)))
#+END_SRC
** Prefer Newer Versions
To reduce the risk of loading outdated byte code files, we set load-prefer-newer and enable auto-compile-on-load-mode as early as possible.
#+BEGIN_SRC emacs-lisp
(setq load-prefer-newer t)
#+END_SRC
** Custom Files ** Custom Files
It's annoying to have emacs randomly add stuff to your init.el whenever you customize a variable. By setting a custom file other than init.el that is ignored in git, random commits with nothing but variable settings are avoided. It's annoying to have emacs randomly add stuff to your init.el whenever you customize a variable. By setting a custom file other than init.el that is ignored in git, random commits with nothing but variable settings are avoided.

View File

@ -1,6 +1,9 @@
;; -*- no-byte-compile: t -*-
(require 'package) (require 'package)
(package-initialize) (package-initialize)
(setq load-prefer-newer t)
(setq custom-file "~/.emacs.d/custom-before.el") (setq custom-file "~/.emacs.d/custom-before.el")
(when (file-exists-p custom-file) (load custom-file)) (when (file-exists-p custom-file) (load custom-file))