From 5be0e2be4a7ac99f20b18f1b43c81319697eb689 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 5 Apr 2019 03:19:38 -0400 Subject: [PATCH] Omit private module on `doom compile` The private module won't be byte-compiled implicitly anymore, as it can cause unexpected problems with stale code and config portability. doom compile -> only compiles ~/.emacs.d doom compile :core -> ~/.emacs.d/core doom compile :plugins -> ~/.emacs.d/.local/packages/elpa doom compile :private -> ~/.doom.d --- core/cli/byte-compile.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/cli/byte-compile.el b/core/cli/byte-compile.el index be1a509eb..8b45bb491 100644 --- a/core/cli/byte-compile.el +++ b/core/cli/byte-compile.el @@ -99,8 +99,11 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files." (doom-initialize-modules 'force)) ;; If no targets were supplied, then we use your module list. (unless modules - (setq targets (append (list doom-core-dir) - (doom-module-load-path)))) + (let ((doom-modules-dirs (delete (expand-file-name "modules/" doom-private-dir) + doom-modules-dirs))) + (setq targets + (append (list doom-core-dir) + (delete doom-private-dir (doom-module-load-path)))))) ;; Assemble el files we want to compile; taking into account that ;; MODULES may be a list of MODULE/SUBMODULE strings from the command ;; line. @@ -127,8 +130,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files." (eval pred t))))) use-package-defaults) ;; Always compile private init file - (push (expand-file-name "init.el" doom-private-dir) target-files) - (push (expand-file-name "init.el" doom-emacs-dir) target-files) + (push (expand-file-name "init.el" doom-emacs-dir) target-files) (dolist (target (cl-delete-duplicates (mapcar #'file-truename target-files) :test #'equal)) (if (or (not recompile-p) (let ((elc-file (byte-compile-dest-file target)))