diff options
author | David Morgan <djm_uk@protonmail.com> | 2023-06-08 07:51:04 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2023-06-08 07:51:04 +0100 |
commit | 3e6443a15d7431f00aca8a39800e25d3cfc5e59b (patch) | |
tree | d165f095a8c57dfb4f22b3fb9c90070ac361ba70 | |
parent | 164695304ecaa81f54ec33af9c7a243576252d3d (diff) | |
download | dotfiles-3e6443a15d7431f00aca8a39800e25d3cfc5e59b.tar.gz |
Use :hook list syntax
-rw-r--r-- | .emacs.d/lisp/init-navigation.el | 26 | ||||
-rw-r--r-- | .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 |