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.
This commit is contained in:
parent
52b48c8d13
commit
24255d15e2
7
init.el
7
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
|
||||
|
|
Loading…
Reference in New Issue