From 5c916cbb4f2e6b89d9fb36052506ad6d425830f0 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Mon, 26 Dec 2022 23:46:37 +0100 Subject: Port package configuration to use-package Also update package list: - account eglot and use-package being built-in - add a couple of packages for Emacs development (elisp-benchmarks, gnus-mock) - remove paradox (most features now built into vanilla package.el) --- .emacs | 43 ++++++++++++++++++++++++++++++++----------- .emacs-custom.el | 2 -- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.emacs b/.emacs index 0841f43..1604dd5 100644 --- a/.emacs +++ b/.emacs @@ -24,8 +24,14 @@ ;; to the default list, unless I cautiously audit every release. ;; ;; Examples: erc-modules, git-commit-setup-hook, package-archives. -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(defun my/list-update (l to-add &optional to-remove) + (declare (indent 1)) + (thread-first + l (seq-union to-add) (seq-difference to-remove))) +(if (fboundp 'setopt) + (defalias 'my/setopt 'setopt) + (defalias 'my/setopt 'customize-set-variable)) ;;; Key bindings. @@ -630,14 +636,6 @@ ;; Trying out use-package. -(defun my/list-update (l to-add to-remove) - (thread-first - l (seq-union to-add) (seq-difference to-remove))) - -(if (fboundp 'setopt) - (defalias 'my/setopt 'setopt) - (defalias 'my/setopt 'customize-set-variable)) - (use-package emacs :when (>= emacs-major-version 28) :init @@ -658,6 +656,29 @@ :config (load-theme 'modus-vivendi)) +(use-package package + :custom + (package-selected-packages + (append '(auctex + debbugs + delight + diff-hl + elisp-benchmarks + gnus-mock + magit + markdown-mode + page-break-lines + rg + rust-mode + which-key + wgrep) + (when (<= emacs-major-version 29) + '(eglot use-package)))) + :config + (my/setopt package-archives + (my/list-update package-archives + '(("melpa" . "https://melpa.org/packages/"))))) + (use-package ediff :custom (ediff-merge-split-window-function 'split-window-vertically) @@ -683,8 +704,8 @@ (erc-use-auth-source-for-nickserv-password t) (erc-user-full-name 'user-full-name) :config - (my/setopt erc-modules (my/list-update - erc-modules '(log notifications) '(fill)))) + (my/setopt erc-modules (my/list-update erc-modules + '(log notifications) '(fill)))) (use-package icomplete :config diff --git a/.emacs-custom.el b/.emacs-custom.el index 73cfcaa..de57927 100644 --- a/.emacs-custom.el +++ b/.emacs-custom.el @@ -41,8 +41,6 @@ '(lua-indent-level 2) '(menu-bar-mode nil) '(minibuffer-depth-indicate-mode t) - '(package-selected-packages - '(async auctex debbugs delight diff-hl eglot flycheck magit markdown-mode page-break-lines paradox rg rust-mode use-package which-key wgrep)) '(page-break-lines-modes '(fundamental-mode text-mode prog-mode special-mode)) '(paradox-execute-asynchronously t) '(paradox-github-token t) -- cgit v1.2.3