Fix doom//byte-compile when recompiling plugins
This would cause odd void-variable/function errors because doom//byte-compile would erroneously try to compile *everything* after recompiling plugins.
This commit is contained in:
parent
2784e3cb72
commit
b1ab80ec3f
1 changed files with 28 additions and 18 deletions
|
@ -280,7 +280,8 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(":private" (push doom-private-dir targets))
|
(":private" (push doom-private-dir targets))
|
||||||
(":plugins"
|
(":plugins"
|
||||||
(byte-recompile-directory package-user-dir 0 t)
|
(byte-recompile-directory package-user-dir 0 t)
|
||||||
(setq compile-plugins-p t))
|
(setq compile-plugins-p t
|
||||||
|
modules (delete ":plugins" modules)))
|
||||||
((pred file-directory-p)
|
((pred file-directory-p)
|
||||||
(push module targets))
|
(push module targets))
|
||||||
((pred (string-match "^\\([^/]+\\)/\\([^/]+\\)$"))
|
((pred (string-match "^\\([^/]+\\)/\\([^/]+\\)$"))
|
||||||
|
@ -288,24 +289,33 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(intern (format ":%s" (match-string 1 module)))
|
(intern (format ":%s" (match-string 1 module)))
|
||||||
(intern (match-string 2 module)))
|
(intern (match-string 2 module)))
|
||||||
targets))))
|
targets))))
|
||||||
(unless (equal modules (list ":plugins"))
|
(cl-block 'byte-compile
|
||||||
(let ((inhibit-message t)
|
;; If we're just here to byte-compile our plugins, we're done!
|
||||||
noninteractive)
|
(and (not modules)
|
||||||
;; But first we must be sure that Doom and your private config have been
|
compile-plugins-p
|
||||||
;; fully loaded. Which usually aren't so in an noninteractive session.
|
(cl-return-from 'byte-compile t))
|
||||||
(doom//reload-autoloads)
|
(unless targets
|
||||||
(doom-initialize t)))
|
(let ((inhibit-message t)
|
||||||
;; If no targets were supplied, then we use your module list.
|
noninteractive)
|
||||||
(unless targets
|
;; But first we must be sure that Doom and your private config have
|
||||||
(doom-initialize-modules t)
|
;; been fully loaded. Which usually aren't so in an noninteractive
|
||||||
(setq targets (append (list doom-core-dir)
|
;; session.
|
||||||
(doom-module-load-path))))
|
(doom//reload-autoloads)
|
||||||
;; Assemble el files we want to compile; taking into account that MODULES
|
(doom-initialize t)))
|
||||||
;; may be a list of MODULE/SUBMODULE strings from the command line.
|
;; If no targets were supplied, then we use your module list.
|
||||||
(let ((target-files (doom-files-in targets :depth 2 :match "\\.el$")))
|
(unless modules
|
||||||
(if (not target-files)
|
(doom-initialize-modules t)
|
||||||
(unless compile-plugins-p
|
(setq targets (append (list doom-core-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.
|
||||||
|
(let ((target-files (doom-files-in targets :depth 2 :match "\\.el$")))
|
||||||
|
(unless target-files
|
||||||
|
(if targets
|
||||||
|
(message "Couldn't find any valid targets")
|
||||||
(message "No targets to %scompile" (if recompile-p "re" "")))
|
(message "No targets to %scompile" (if recompile-p "re" "")))
|
||||||
|
(cl-return-from 'byte-compile))
|
||||||
(condition-case ex
|
(condition-case ex
|
||||||
(let ((use-package-expand-minimally t))
|
(let ((use-package-expand-minimally t))
|
||||||
;; Always compile private init file
|
;; Always compile private init file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue