Cache doom-modules on doom refresh
This commit is contained in:
parent
b58b5e1d64
commit
71d505b893
3 changed files with 42 additions and 36 deletions
|
@ -148,7 +148,7 @@ markdown and copies it to your clipboard, ready to be pasted into bug reports!"
|
||||||
package-user-dir ,package-user-dir
|
package-user-dir ,package-user-dir
|
||||||
package-archives ',package-archives
|
package-archives ',package-archives
|
||||||
user-emacs-directory ,doom-emacs-dir
|
user-emacs-directory ,doom-emacs-dir
|
||||||
doom-modules-cache nil)
|
doom--modules-cache nil)
|
||||||
(with-eval-after-load 'undo-tree
|
(with-eval-after-load 'undo-tree
|
||||||
;; undo-tree throws errors because `buffer-undo-tree' isn't
|
;; undo-tree throws errors because `buffer-undo-tree' isn't
|
||||||
;; corrrectly initialized
|
;; corrrectly initialized
|
||||||
|
|
|
@ -274,6 +274,7 @@ Run this whenever your `doom!' block, or a module autoload file, is modified."
|
||||||
(make-directory (file-name-directory doom-autoload-file) t)
|
(make-directory (file-name-directory doom-autoload-file) t)
|
||||||
(with-temp-file doom-autoload-file
|
(with-temp-file doom-autoload-file
|
||||||
(doom--generate-header 'doom-reload-doom-autoloads)
|
(doom--generate-header 'doom-reload-doom-autoloads)
|
||||||
|
(prin1 `(setq doom--modules-cache ',doom-modules) (current-buffer))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(doom--generate-autoloads (reverse enabled-targets)))
|
(doom--generate-autoloads (reverse enabled-targets)))
|
||||||
;; Replace autoload paths (only for module autoloads) with absolute
|
;; Replace autoload paths (only for module autoloads) with absolute
|
||||||
|
|
|
@ -52,6 +52,7 @@ your `doom!' block, a warning is emitted before replacing it with :emacs vc and
|
||||||
|
|
||||||
(defvar doom--current-module nil)
|
(defvar doom--current-module nil)
|
||||||
(defvar doom--current-flags nil)
|
(defvar doom--current-flags nil)
|
||||||
|
(defvar doom--modules-cache ())
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -334,6 +335,10 @@ The overall load order of Doom is as follows:
|
||||||
Module load order is determined by your `doom!' block. See `doom-modules-dirs'
|
Module load order is determined by your `doom!' block. See `doom-modules-dirs'
|
||||||
for a list of all recognized module trees. Order defines precedence (from most
|
for a list of all recognized module trees. Order defines precedence (from most
|
||||||
to least)."
|
to least)."
|
||||||
|
(if doom--modules-cache
|
||||||
|
(progn
|
||||||
|
(setq doom-modules doom--modules-cache)
|
||||||
|
(doom-log "Using `doom-modules' cache"))
|
||||||
(unless doom-modules
|
(unless doom-modules
|
||||||
(setq doom-modules
|
(setq doom-modules
|
||||||
(make-hash-table :test 'equal
|
(make-hash-table :test 'equal
|
||||||
|
@ -366,9 +371,9 @@ to least)."
|
||||||
modules)
|
modules)
|
||||||
(push (car key) modules))
|
(push (car key) modules))
|
||||||
(throw 'doom-modules t))))
|
(throw 'doom-modules t))))
|
||||||
(if-let* ((path (doom-module-locate-path category module)))
|
(if-let (path (doom-module-locate-path category module))
|
||||||
(doom-module-set category module :flags flags :path path)
|
(doom-module-set category module :flags flags :path path)
|
||||||
(message "WARNING Couldn't find the %s %s module" category module))))))))
|
(message "WARNING Couldn't find the %s %s module" category module)))))))))
|
||||||
(when noninteractive
|
(when noninteractive
|
||||||
(setq doom-inhibit-module-warnings t))
|
(setq doom-inhibit-module-warnings t))
|
||||||
`(setq doom-modules ',doom-modules))
|
`(setq doom-modules ',doom-modules))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue