summaryrefslogtreecommitdiff
path: root/tw/home/files/emacs-early-init.el
diff options
context:
space:
mode:
Diffstat (limited to 'tw/home/files/emacs-early-init.el')
-rw-r--r--tw/home/files/emacs-early-init.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/tw/home/files/emacs-early-init.el b/tw/home/files/emacs-early-init.el
new file mode 100644
index 00000000..f4d4e765
--- /dev/null
+++ b/tw/home/files/emacs-early-init.el
@@ -0,0 +1,13 @@
+;;; early-init.el --- Emacs early-start initialisation
+;;; Commentary:
+;;; Put native-compiled binaries in the cache. Do this in early-init so that
+;;; Emacs doesn't start compiling stuff and putting it in the wrong directory
+;;; before loading init.el.
+;;; Code:
+
+;; Don't require 'comp (which defines `native-compile-target-directory'), so
+;; that we don't load-and-compile subr.el before the variable is set properly.
+(setq native-compile-target-directory ; not a `customize' option
+ (expand-file-name "emacs/eln" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
+
+;;; early-init.el ends here