diff --git a/init.d/basics/package-management.el b/init.d/basics/package-management.el index 20b84a7..8b3d893 100644 --- a/init.d/basics/package-management.el +++ b/init.d/basics/package-management.el @@ -1,12 +1,14 @@ ;;; package-management.el --- Initialize package management. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-02-26T23:29:23+0100> +;; Time-stamp: <2020-02-27T02:50:57+0100> ;;; Commentary: -;; * Sets up package sources and their priorities. -;; * Sets up use-package. +;; * Set up package sources and their priorities. +;; * Set up use-package. ;; * Compile elisp files. +;; * Update keyring. ;; * Update packages. +;; * Set up quelpa. ;;; Code: @@ -15,14 +17,13 @@ '("melpa-stable" . "https://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -(setq package-archive-priorities '( - ("melpa-stable" . 30) +(setq package-archive-priorities '(("melpa-stable" . 30) ("gnu" . 20) - ("melpa" . 10) - )) + ("melpa" . 10))) ;; Workaround for 26.2 . -(defvar gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") +(when (< emacs-major-version 27) + (defvar gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) (when (< emacs-major-version 27) (package-initialize)) @@ -34,7 +35,6 @@ (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) - (eval-when-compile (require 'use-package)) @@ -42,21 +42,14 @@ (require 'basics/global-variables) ;; Always install packages if they are not present. -(use-package use-package-ensure - :ensure nil - - :custom - (use-package-always-ensure t) +(use-package use-package + :custom (use-package-always-ensure t) ) -;; Autocompile files as needed. +;; Autocompile files on load. (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)) + :custom (load-prefer-newer t) ; Use uncompiled file if it is newer. + :config (auto-compile-on-load-mode)) ;; Tool for updating the GNU ELPA keyring. (use-package gnu-elpa-keyring-update @@ -74,12 +67,11 @@ ;; Update packages if at least 7 days have passed. (use-package auto-package-update - :custom - (auto-package-update-delete-old-versions t) - (auto-package-update-interval 7) - (auto-package-update-hide-results nil) - :config - (auto-package-update-maybe)) + :custom ((auto-package-update-delete-old-versions t) + (auto-package-update-interval 7) + (auto-package-update-hide-results nil)) + :config (auto-package-update-maybe) + ) ;; Install Emacs packages directly from source. (use-package quelpa