From 2ab396a5fea5d643fe870d22d640af12e38e81be Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 15 Oct 2023 05:29:20 +0200 Subject: [PATCH] Move package manager configuration to a new place --- configuration.org | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/configuration.org b/configuration.org index c4acbd3..b85416f 100644 --- a/configuration.org +++ b/configuration.org @@ -26,11 +26,13 @@ I prefer using freedesktop’s desktop specification everywhere. (load "xdg-paths") #+end_src -* Emacs configuration +* Set up the package manager + +I’m a ~package.el~ user. Don’t package-shame me! ** Set up the package archives -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (require 'package) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) @@ -41,42 +43,48 @@ I prefer using freedesktop’s desktop specification everywhere. (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) -#+END_SRC +#+end_src -** Configure ~use-package~ and preload ~bind-key~ +** Set up ~use-package~ -#+BEGIN_SRC emacs-lisp +It is built-in since 29.1, and let’s hope I never get back using older versions, but let’s stay on the safe side for now. + +#+begin_src emacs-lisp (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) -(customize-set-variable 'use-package-always-ensure t) -(customize-set-variable 'use-package-verbose nil) +(use-package use-package + :custom + (use-package-always-ensure t) + (use-package-verbose nil)) (use-package bind-key) -#+END_SRC +#+end_src -** Install and configure Quelpa +*** Install Quelpa so we can add packages not present in MELPA yet -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (unless (package-installed-p 'quelpa) (with-temp-buffer (url-insert-file-contents "https://raw.githubusercontent.com/quelpa/quelpa/master/quelpa.el") (eval-buffer) (quelpa-self-upgrade))) -#+END_SRC +#+end_src -*** And quelpa-use-package, too! +*** Finally, combine the powers of use-package and quelpa -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (quelpa '(quelpa-use-package :fetcher git :url "https://github.com/quelpa/quelpa-use-package.git")) (require 'quelpa-use-package) -#+END_SRC +#+end_src + +* Emacs configuration ** Set up the really basic things