From bdcb156b914351a92426927bf9e55de0e553d5a7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 25 Jul 2019 17:20:53 +0200 Subject: [PATCH] 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. --- core/cli/packages.el | 1 + core/core-packages.el | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/cli/packages.el b/core/cli/packages.el index 8e31ae5d5..978ce3e48 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -6,6 +6,7 @@ (doom-reload-core-autoloads) (when (progn ,@body) (doom-reload-package-autoloads 'force-p)) + (doom--finalize-straight) t)) diff --git a/core/core-packages.el b/core/core-packages.el index 3cdfd581a..45ba87ebd 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -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))