diff options
| author | Kรฉvin Le Gouguec <kevin.legouguec@gmail.com> | 2024-03-17 13:10:19 +0100 |
|---|---|---|
| committer | Kรฉvin Le Gouguec <kevin.legouguec@gmail.com> | 2024-03-17 13:10:19 +0100 |
| commit | b072daf63f65d59580b7bc96ff128677bec79ee5 (patch) | |
| tree | 888c45876950aad79ca4b64bd70c01fb93ec9ec1 | |
| parent | d0b273a546019ca3efd9ce487ce0cc270d8d8a55 (diff) | |
| download | dotfiles-b072daf63f65d59580b7bc96ff128677bec79ee5.tar.xz | |
Double-down on macros to reduce customization boilerplate
| -rw-r--r-- | .emacs | 35 |
1 files changed, 13 insertions, 22 deletions
@@ -31,10 +31,9 @@ ;; to the default list, unless I cautiously audit every release. ;; ;; Examples: erc-modules, git-commit-setup-hook, package-archives. -(defun my/list-update (l to-add &optional to-remove) - (declare (indent 1)) - (thread-first - l (seq-union to-add) (seq-difference to-remove))) +(defmacro my/setopt-update-list (l to-add &optional to-remove) + `(my/setopt ,l (thread-first + ,l (seq-union ,to-add) (seq-difference ,to-remove)))) (load-theme 'eighters t) @@ -725,9 +724,8 @@ UPSTREAMS is a list of fetch URLs." (when (<= emacs-major-version 29) '(eglot use-package)))) :config - (my/setopt package-archives - (my/list-update package-archives - '(("melpa" . "https://melpa.org/packages/"))))) + (my/setopt-update-list + package-archives '(("melpa" . "https://melpa.org/packages/")))) (use-package calendar :custom @@ -806,11 +804,8 @@ UPSTREAMS is a list of fetch URLs." (erc-insert-timestamp-function 'erc-insert-timestamp-left) (erc-timestamp-format "[%F %H:%M] ") :config - (my/setopt - erc-modules - (my/list-update erc-modules '(log notifications stamp track) '(fill)) - erc-track-exclude-types - (my/list-update erc-track-exclude-types '("JOIN" "PART" "QUIT")))) + (my/setopt-update-list erc-modules '(log notifications stamp track) '(fill)) + (my/setopt-update-list erc-track-exclude-types '("JOIN" "PART" "QUIT"))) (use-package generic-x :demand t @@ -828,10 +823,9 @@ UPSTREAMS is a list of fetch URLs." (use-package git-commit :config - (my/setopt git-commit-setup-hook - (my/list-update git-commit-setup-hook - '(git-commit-turn-on-flyspell - my/git-commit-maybe-set-fill-column)))) + (my/setopt-update-list + git-commit-setup-hook '(git-commit-turn-on-flyspell + my/git-commit-maybe-set-fill-column))) (use-package isearch :delight "๐" @@ -957,13 +951,10 @@ UPSTREAMS is a list of fetch URLs." (use-package whitespace :config - (my/setopt - whitespace-style - (my/list-update whitespace-style - nil '(lines missing-newline-at-eof))) + (my/setopt-update-list whitespace-style nil '(lines missing-newline-at-eof)) :delight - ;; FIXME: without :demand t, enabling whitespace-mode in a diff - ;; buffer first causes diff-mode's settings to be applied globally. + ;; FIXME: without :demand t, enabling whitespace-mode in a diff + ;; buffer first causes diff-mode's settings to be applied globally. :demand t) ;;; TODO: |
