Extract installation of core packages to function
This commit is contained in:
parent
235b69bd20
commit
944d7ec83f
1 changed files with 10 additions and 9 deletions
|
@ -151,20 +151,21 @@ uses a straight or package.el command directly).")
|
||||||
(eval-region (search-forward "(require 'straight)")
|
(eval-region (search-forward "(require 'straight)")
|
||||||
(point-max))))))
|
(point-max))))))
|
||||||
|
|
||||||
|
(defun doom--ensure-core-packages ()
|
||||||
|
(doom-log "Installing core packages")
|
||||||
|
(dolist (package doom-packages)
|
||||||
|
(let ((name (car package)))
|
||||||
|
(when-let (recipe (plist-get (cdr package) :recipe))
|
||||||
|
(straight-override-recipe (cons name recipe)))
|
||||||
|
(straight-use-package name))))
|
||||||
|
|
||||||
(defun doom-initialize-core-packages (&optional force-p)
|
(defun doom-initialize-core-packages (&optional force-p)
|
||||||
"Ensure `straight' is installed and was compiled with this version of Emacs."
|
"Ensure `straight' is installed and was compiled with this version of Emacs."
|
||||||
(when (or force-p (null (bound-and-true-p straight-recipe-repositories)))
|
(when (or force-p (null (bound-and-true-p straight-recipe-repositories)))
|
||||||
(doom-log "Initializing straight")
|
(doom-log "Initializing straight")
|
||||||
(let ((doom-disabled-packages nil)
|
(let ((doom-packages (doom-package-list nil 'core-only)))
|
||||||
(doom-packages (doom-package-list nil 'core-only)))
|
|
||||||
(doom--ensure-straight)
|
(doom--ensure-straight)
|
||||||
(doom-log "Installing core packages")
|
(doom--ensure-core-packages))))
|
||||||
(dolist (package doom-packages)
|
|
||||||
(cl-destructuring-bind (name &key recipe &allow-other-keys)
|
|
||||||
package
|
|
||||||
(when recipe
|
|
||||||
(straight-override-recipe (cons name recipe)))
|
|
||||||
(straight-use-package name))))))
|
|
||||||
|
|
||||||
(defun doom-initialize-packages (&optional force-p)
|
(defun doom-initialize-packages (&optional force-p)
|
||||||
"Process all packages, essential and otherwise, if they haven't already been.
|
"Process all packages, essential and otherwise, if they haven't already been.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue