Move package initialization to early-init.el

This is done in preparation for using Emacs 27.1, which sources this file
automatically before package activation.
This commit is contained in:
Daniel - 2020-08-15 16:49:32 +02:00
parent 845d5d137c
commit ed7266bd65
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
2 changed files with 16 additions and 13 deletions

13
early-init.el Normal file
View File

@ -0,0 +1,13 @@
;; -*- lexical-binding: t -*-
(require 'package)
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")))
(setq package-enable-at-startup nil)

16
init.el
View File

@ -32,19 +32,9 @@
;; * Packages ;; * Packages
(require 'package) (when (< emacs-major-version 27)
(load-file (expand-file-name "early-init.el" emacs-d))
(setq package-user-dir (expand-file-name "elpa" emacs-d)) (package-initialize))
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")))
(setq package-enable-at-startup nil)
(package-initialize)
(eval-when-compile (eval-when-compile
(dolist (package '(bind-key use-package)) (dolist (package '(bind-key use-package))