From 0281cb7d22a9e02dcd235cf08de4bb5b4b05a9fa Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Thu, 9 Oct 2025 11:13:51 +0200 Subject: [PATCH] Conditionally call package-initialize Emacs 28+ will warn you if you call package-initialize in init.el, which is not necessary since Emacs 27. However, package-archive-contents is not populated by default if package-initialize is not called, because Emacs is not aware of the archives in early-init. Therefore, we need to populate it manually. --- Emacs.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Emacs.org b/Emacs.org index 0f27905..350cdd0 100644 --- a/Emacs.org +++ b/Emacs.org @@ -58,7 +58,9 @@ Emacs has a built in package manager but it doesn't make it easy to automaticall ("org" . "https://orgmode.org/elpa/") ("elpa" . "https://elpa.gnu.org/packages/"))) - (package-initialize) + (if (>= emacs-major-version 27) + (package-read-all-archive-contents) + (package-initialize)) (unless package-archive-contents (package-refresh-contents))