From a1c54210d1a59315842fd4655a5224d89479681f Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 22 May 2020 15:17:47 +0200 Subject: [PATCH] Emacsg: init: Setup auto-compile in early-init.el That way "init.el" can also benefit from `auto-compile-on-load-mode' and `load-prefer-newer'. "early-init.el" still cannot of course, but we already don't compile that file (for this very reason). --- early-init.el | 9 +++++++++ init.el | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/early-init.el b/early-init.el index 06edd7c..14f24aa 100644 --- a/early-init.el +++ b/early-init.el @@ -1,5 +1,14 @@ ;;; early-init.el --- earliest birds -*- lexical-binding: t -*- +(setq load-prefer-newer t) + +(let ((dir (file-name-directory (or load-file-name buffer-file-name)))) + (add-to-list 'load-path (expand-file-name "lib/packed" dir)) + (add-to-list 'load-path (expand-file-name "lib/auto-compile" dir))) +(require 'auto-compile) +(auto-compile-on-load-mode) +(auto-compile-on-save-mode) + (setq package-enable-at-startup nil) (with-eval-after-load 'package diff --git a/init.el b/init.el index 82344ac..0462ae6 100644 --- a/init.el +++ b/init.el @@ -18,7 +18,6 @@ (setq inhibit-startup-echo-area-message "locutus") (setq initial-buffer-choice t) (setq initial-scratch-message "") - (setq load-prefer-newer t) (scroll-bar-mode 0) (tool-bar-mode 0) (menu-bar-mode 0)) @@ -33,10 +32,7 @@ (setq use-package-verbose t)) (use-package auto-compile - :demand t :config - (auto-compile-on-load-mode) - (auto-compile-on-save-mode) (setq auto-compile-display-buffer nil) (setq auto-compile-mode-line-counter t) (setq auto-compile-source-recreate-deletes-dest t)