Emacs: Only call package-initialize in Emacs < 27 and some cleanup.

<http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS.27>
This commit is contained in:
tastytea 2019-12-26 07:06:00 +01:00
parent e74e7ce5c2
commit 5991434fc0

View File

@ -1,6 +1,6 @@
;;; package-management.el --- Initialize package management. -*- lexical-binding: t; -*-
;; Time-stamp: <2019-12-04T06:07:31+00:00>
;; Time-stamp: <2019-12-26T06:00:54+00:00>
;;; Commentary:
;; * Sets up package sources and their priorities.
@ -24,7 +24,8 @@
;; Workaround for 26.2 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341>.
(defvar gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(package-initialize)
(when (< emacs-major-version 27)
(package-initialize))
;; Add path for custom packages.
(add-to-list 'load-path "~/.emacs.d/custom-packages/")
@ -38,14 +39,19 @@
(require 'use-package))
;; Always install packages if they are not present.
(require 'use-package-ensure)
(setq use-package-always-ensure t)
(use-package use-package-ensure
:ensure nil
;; autocompile files as needed.
:custom
(use-package-always-ensure t)
)
;; Autocompile files as needed.
(use-package auto-compile
:custom
;; Use uncompiled file if it is newer than the compiled one.
(load-prefer-newer t)
:config
(auto-compile-on-load-mode))