💥 Redesign private sub-module system

~/.doom.d/modules is now a full module tree, like ~/.emacs.d/modules.
Symlinks are no longer involved.

Private modules can now shadow Doom modules. e.g.
~/.doom.d/modules/lang/org will take precendence over
~/.emacs.d/modules/lang/org.

Also, made doom--*-load-path variables public (e.g. doom--site-load-path
=> doom-site-load-path), and rearranged the load-path for a 10-15%
startup boost.
This commit is contained in:
Henrik Lissner 2018-02-16 02:02:58 -05:00
parent 8ca4fbd8fe
commit 2b1c323dbf
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
12 changed files with 122 additions and 145 deletions

View file

@ -7,15 +7,11 @@
"The directory that serves as the root of your external private config for
Doom Emacs.")
(defvar +private-symlink-path
(expand-file-name "private" doom-modules-dir)
"Where the place the symbolic link to the private modules directory.")
;; Ensure `doom//reload-autoloads', `doom//byte-compile' and
;; `doom-initialize-packages' all include this module in their operations.
(add-to-list 'doom-extra-module-paths +private-config-path)
(add-to-list 'doom-psuedo-module-dirs +private-config-path)
(add-to-list 'doom-modules-dirs (expand-file-name "modules/" +private-config-path))
;;
(load (expand-file-name "init.el" +private-config-path)
'noerror 'nomessage)

View file

@ -1,15 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; config/private/packages.el
(let ((modules-path (expand-file-name "modules/" +private-config-path)))
(when (file-directory-p modules-path)
;; automatically symlinks your private modules to `doom-modules-dir'.
(if (and (file-directory-p +private-symlink-path)
(not (file-symlink-p +private-symlink-path)))
(lwarn "config/private" :warning
"modules/%s already exists; can't create symlink" +private-symlink-path)
(make-symbolic-link modules-path +private-symlink-path t))))
;;
(load (expand-file-name "packages.el" +private-config-path)
'noerror 'nomessage)

View file

@ -233,7 +233,7 @@ compilation database is present in the project.")
;; later, so we un-byte-compile it before we load it.
(eval-when-compile
(when (>= emacs-major-version 26)
(when-let* ((elc-file (locate-library "rtags.elc" t doom--package-load-path)))
(when-let* ((elc-file (locate-library "rtags.elc" t doom-package-load-path)))
(delete-file elc-file))))
:config (setq rtags-display-result-backend 'ivy))

View file

@ -198,8 +198,8 @@ unfold to point on startup."
(def-org-file-link! "org" +org-dir)
(def-org-file-link! "doom" doom-emacs-dir)
(def-org-file-link! "doom-module" doom-modules-dir)
(def-org-file-link! "doom-docs" doom-docs-dir)
(def-org-file-link! "doom-modules" doom-modules-dir)
;; Update UI when theme is changed
(add-hook 'doom-init-theme-hook #'+org|setup-ui))

View file

@ -263,7 +263,7 @@ controlled by `+doom-dashboard-pwd-policy'."
(+doom-dashboard--center
+doom-dashboard--width
(format "Loaded %d packages in %d modules in %.02fs"
(length doom--package-load-path)
(length doom-package-load-path)
(hash-table-size doom-modules)
doom-init-time))
'face 'font-lock-comment-face)