From 3e6443a15d7431f00aca8a39800e25d3cfc5e59b Mon Sep 17 00:00:00 2001 From: David Morgan Date: Thu, 8 Jun 2023 07:51:04 +0100 Subject: [PATCH] Use :hook list syntax --- .emacs.d/lisp/init-navigation.el | 26 +++++++++++--------------- .emacs.d/lisp/init-ui.el | 10 +++------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el index 0107201..fc190d2 100644 --- a/.emacs.d/lisp/init-navigation.el +++ b/.emacs.d/lisp/init-navigation.el @@ -40,22 +40,18 @@ :custom (smartscan-symbol-selector "symbol") :config (unbind-key "M-'" smartscan-map) - (defvar-local smartscan-exclude-modes '(cider-repl-mode - ielm-mode - vterm-mode - term-mode - ansi-term-mode - eshell-mode - shell-mode - sql-interactive-mode - magit-status-mode - compilation-mode - deadgrep-mode)) - (defun turn-off-smartscan-mode () - (smartscan-mode -1)) - (dolist (mode smartscan-exclude-modes) - (add-hook (intern (concat (symbol-name mode) "-hook")) #'turn-off-smartscan-mode)) :hook + ((cider-repl-mode + ielm-mode + vterm-mode + term-mode + ansi-term-mode + eshell-mode + shell-mode + sql-interactive-mode + magit-status-mode + compilation-mode + deadgrep-mode) . (lambda () (smartscan-mode -1))) (elpaca-after-init . global-smartscan-mode) :bind (:map smartscan-map ("C-M-'" . smartscan-symbol-replace))) diff --git a/.emacs.d/lisp/init-ui.el b/.emacs.d/lisp/init-ui.el index b52c169..55796b5 100644 --- a/.emacs.d/lisp/init-ui.el +++ b/.emacs.d/lisp/init-ui.el @@ -85,8 +85,7 @@ (dolist (mode whitespace-disabled-modes) (add-hook (intern (concat (symbol-name mode) "-hook")) #'turn-off-whitespace-mode)) :hook - (text-mode . (lambda () (whitespace-mode +1))) - (prog-mode . (lambda () (whitespace-mode +1)))) + ((text-mode prog-mode) . (lambda () (whitespace-mode +1)))) (use-package goggles :diminish @@ -111,15 +110,12 @@ (use-package rainbow-delimiters :hook - (text-mode . (lambda () (rainbow-delimiters-mode +1))) - (prog-mode . (lambda () (rainbow-delimiters-mode +1))) - (ielm-mode . (lambda () (rainbow-delimiters-mode +1)))) + ((text-mode prog-mode ielm-mode) . (lambda () (rainbow-delimiters-mode +1)))) (use-package rainbow-mode :diminish :hook - (emacs-lisp-mode . rainbow-mode) - (css-mode . rainbow-mode)) + ((emacs-lisp-mode css-mode) . rainbow-mode)) (use-feature repeat :defer 5