refactor(corfu): use hook symbols in add-hook! calls

A common challenge for beginners is distinguishing packages, modes, and
hooks, and since Doom's source code is meant to second as another layer
of documentation, I prefer to be explicit with hook symbols in
`add-hook!` calls (at least, for internal/module use).
This commit is contained in:
Henrik Lissner 2024-04-05 11:57:25 -04:00 committed by Yann Esposito (Yogsototh)
parent f91d6beaa1
commit a4fc16d36f
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -102,10 +102,10 @@ use the minibuffer such as `query-replace'.")
(use-package! cape
:defer t
:init
(add-hook! prog-mode
(add-hook! 'prog-mode-hook
(defun +corfu-add-cape-file-h ()
(add-hook 'completion-at-point-functions #'cape-file -10 t)))
(add-hook! (org-mode markdown-mode)
(add-hook! '(org-mode-hook markdown-mode-hook)
(defun +corfu-add-cape-elisp-block-h ()
(add-hook 'completion-at-point-functions #'cape-elisp-block 0 t)))
;; Enable Dabbrev completion basically everywhere as a fallback.
@ -114,8 +114,12 @@ use the minibuffer such as `query-replace'.")
;; Set up `cape-dabbrev' options.
(defun +dabbrev-friend-buffer-p (other-buffer)
(< (buffer-size other-buffer) +corfu-buffer-scanning-size-limit))
(add-hook! (prog-mode text-mode conf-mode comint-mode minibuffer-setup
eshell-mode)
(add-hook! '(prog-mode-hook
text-mode-hook
conf-mode-hook
comint-mode-hook
minibuffer-setup-hook
eshell-mode-hook)
(defun +corfu-add-cape-dabbrev-h ()
(add-hook 'completion-at-point-functions #'cape-dabbrev 20 t)))
(after! dabbrev