Reduce configuration done in `early-init.el`

As per the documentation (see "(elisp)Startup Summary"), only variable
customization that affect package initialization should go into the early init
file.  Defining package archives is explicitly mentioned as something that still
may go into the main init file.  So we move it there and adjust comments
accordingly.
This commit is contained in:
Daniel - 2021-03-28 19:55:59 +02:00
parent 4d0264b34b
commit 185f1d75f3
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
2 changed files with 8 additions and 8 deletions

View File

@ -1,11 +1,5 @@
;; -*- lexical-binding: t -*- ;; -*- lexical-binding: t -*-
(require 'package)
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) (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/")))

View File

@ -42,9 +42,15 @@
;; * Packages ;; * Packages
(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/")))
(when (< emacs-major-version 27) (when (< emacs-major-version 27)
;; Before Emacs 27.1, we had to do package initialization ourselves. In Emacs ;; Before Emacs 27.1, we had to do package initialization ourselves. In Emacs
;; 27.1 and later, it's done in early-init.el. See ;; 27.1 and later, it's done directly after loading early-init.el. See
;; https://www.gnu.org/software/emacs/news/NEWS.27.1 ;; https://www.gnu.org/software/emacs/news/NEWS.27.1
(load-file (expand-file-name "early-init.el" emacs-d)) (load-file (expand-file-name "early-init.el" emacs-d))
(package-initialize)) (package-initialize))