Manually finalize straight transactions

Straight expects to be used interactively, which don't do (yet). Its
transactional system depends on idle timers, which don't run in a
noninteractive session, so we have to nudge it ourselves.
This commit is contained in:
Henrik Lissner 2019-07-25 17:20:53 +02:00
parent 2aa7dbfb27
commit bdcb156b91
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,7 @@
(doom-reload-core-autoloads)
(when (progn ,@body)
(doom-reload-package-autoloads 'force-p))
(doom--finalize-straight)
t))

View file

@ -116,6 +116,10 @@ missing) and shouldn't be deleted.")
(let ((user-emacs-directory doom-local-dir))
(apply orig-fn args)))
(defun doom--finalize-straight ()
(mapc #'funcall (delq nil (mapcar #'cdr straight--transaction-alist)))
(setq straight--transaction-alist nil))
;;
;;; Bootstrapper
@ -140,7 +144,7 @@ necessary package metadata is initialized and available for them."
:branch ,straight-repository-branch))
(mapc #'straight-use-package doom-core-packages)
(when noninteractive
(add-hook 'kill-emacs-hook #'straight--transaction-finalize))
(add-hook 'kill-emacs-hook #'doom--finalize-straight))
(dolist (package (straight--directory-files (straight--build-dir)))
(add-to-list 'load-path (directory-file-name (straight--build-dir package)))))
(when (or force-p (not doom-packages))