From 24255d15e2228e9ce540a09ee7f173d7612046f2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 17 Aug 2021 08:47:57 -0500 Subject: Finesse `text-mode-hook' vis-a-vis `typo-mode' Add a predicate to check whether to enable `text-mode' in a given buffer. E.g., don't enable `text-mode' in COMMIT_EDITMSG buffers. --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index 31fc0be..1a85a20 100644 --- a/init.el +++ b/init.el @@ -1404,7 +1404,12 @@ successive invocations." (add-hook 'ssh-config-mode-hook #'turn-on-font-lock)) (setup (:straight typo) - (:hook-into text-mode)) + (add-hook 'text-mode-hook + (defun text-mode@typo-unless () + "Start `typo-mode' UNLESS the buffer matches a predicate." + (unless (or ; predicates here + (string-match-p "COMMIT_EDITMSG" buffer-file-name)) + (typo-mode +1))))) (setup (:straight undo-fu) (:global "C-/" undo-fu-only-undo -- cgit 1.4.1-21-gabe81