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
This commit is contained in:
Henrik Lissner 2019-04-05 03:19:38 -04:00
parent cb5abcea0e
commit 5be0e2be4a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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)))