Add doom/recompile-packages (make compile:elpa)

If you upgrade (or downgrade) Emacs, there may be byte-compilation
errors. This works around that.
This commit is contained in:
Henrik Lissner 2017-07-19 14:09:29 +02:00
parent 5fe3cfbc75
commit 5346670ab0
2 changed files with 9 additions and 0 deletions

View file

@ -32,6 +32,9 @@ compile: init.el clean
compile\:core: init.el clean
@$(EMACS) -f doom/compile -- init.el core
compile\:elpa: init.el
@$(EMACS) -f doom/recompile-packages
$(patsubst %, compile\:%, $(MODULES)): init.el .local/autoloads.el
@rm -fv $(shell find $(patsubst compile:%, modules/%, $@) -type f -name '*.elc')
@$(EMACS) -f doom/compile -- $(patsubst compile:%, modules/%, $@)

View file

@ -632,6 +632,12 @@ If ONLY-RECOMPILE-P is non-nil, only recompile out-of-date files."
;; Forcibly recompile core.el in case `load-path' has changed
(byte-recompile-file (expand-file-name "core.el" doom-core-dir) t))
(defun doom/recompile-packages ()
"Recompile all installed elpa packages. If you're getting odd errors after
upgrading Emacs, this may fix it."
(interactive)
(byte-recompile-directory package-user-dir 0 t))
(defun doom/reset ()
"Clear the local cache completely (in `doom-cache-dir').