From 577b10541f6de997a6222d58036157dd874da2d1 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Thu, 2 Nov 2023 17:46:29 +0000 Subject: [PATCH] Better workaround for seq-25 loading woes in first-time startup --- lisp/init-elpa.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/init-elpa.el b/lisp/init-elpa.el index 872127ff94..81749ecdc1 100644 --- a/lisp/init-elpa.el +++ b/lisp/init-elpa.el @@ -85,10 +85,18 @@ advice for `require-package', to which ARGS are passed." (advice-add 'require-package :around 'sanityinc/note-selected-package) -;; Work around an issue in Emacs 29 where this gets implicitly + +;; Work around an issue in Emacs 29 where seq gets implicitly ;; reinstalled via the rg -> transient dependency chain, but fails to -;; reload cleanly, breaking first-time start-up -(require-package 'seq "2.24") +;; reload cleanly due to not finding seq-25.el, breaking first-time +;; start-up +(defun sanityinc/reload-previously-loaded-with-load-path-updated (orig pkg-desc) + (let ((load-path (cons (package-desc-dir pkg-desc) load-path))) + (funcall orig pkg-desc))) + +(advice-add 'package--reload-previously-loaded :around + 'sanityinc/reload-previously-loaded-with-load-path-updated) + (when (fboundp 'package--save-selected-packages) (require-package 'seq)