about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-packages.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-10-11 17:17:33 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-10-11 17:17:33 +0100
commitecc14cd182391359b6f4ff54db3d093639e92145 (patch)
treecfa3e39fd8c4c7c26f7f22b6e03512a2ace0b780 /.emacs.d/lisp/init-packages.el
parent147697113297e0d3cd663117d6a7d98c49879db1 (diff)
downloaddotfiles-ecc14cd182391359b6f4ff54db3d093639e92145.tar.gz
Reload init before running straight-check-all
Diffstat (limited to '.emacs.d/lisp/init-packages.el')
-rw-r--r--.emacs.d/lisp/init-packages.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-packages.el b/.emacs.d/lisp/init-packages.el
index 68f7c43..6b69f18 100644
--- a/.emacs.d/lisp/init-packages.el
+++ b/.emacs.d/lisp/init-packages.el
@@ -48,6 +48,10 @@ that everything loaded by `require' or `use-package' is re-loaded."
   (setq features (seq-filter '(lambda (elt) (not (string-prefix-p "init-" (prin1-to-string elt)))) features))
   (funcall func))
 
+(defun reload-init ()
+  "Reload `user-init-file', ensuring that requires are reloaded."
+  (run-straight-lock-file-function #'(lambda () (load (or user-init-file "~/.emacs.d/init.el") nil 'nomessage))))
+
 ;; emacs --batch -l "~/.emacs.d/init.el" -f "my/upgrade-packages"
 (defun my/upgrade-packages ()
   "Upgrade all packages installed with straight."
@@ -55,7 +59,8 @@ that everything loaded by `require' or `use-package' is re-loaded."
   (straight-pull-recipe-repositories) ;; TODO is this needed?
   (straight-x-fetch-all)
   (straight-merge-all)
-  (run-straight-lock-file-function 'straight-check-all)
+  (reload-init)
+  (straight-check-all)
   ;; Do this automatically, as we can always revert and thaw
   (run-straight-lock-file-function 'straight-freeze-versions))