summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-17 08:47:57 -0500
committerCase Duckworth2021-08-17 08:47:57 -0500
commit24255d15e2228e9ce540a09ee7f173d7612046f2 (patch)
tree48722cc26678eb9e9a85f534a2a677db31d4292f
parentComment word-count limit in `acdw-org/count-words-stupidly' (diff)
downloademacs-24255d15e2228e9ce540a09ee7f173d7612046f2.tar.gz
emacs-24255d15e2228e9ce540a09ee7f173d7612046f2.zip
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.
-rw-r--r--init.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/init.el b/init.el index 31fc0be..1a85a20 100644 --- a/init.el +++ b/init.el
@@ -1404,7 +1404,12 @@ successive invocations."
1404 (add-hook 'ssh-config-mode-hook #'turn-on-font-lock)) 1404 (add-hook 'ssh-config-mode-hook #'turn-on-font-lock))
1405 1405
1406(setup (:straight typo) 1406(setup (:straight typo)
1407 (:hook-into text-mode)) 1407 (add-hook 'text-mode-hook
1408 (defun text-mode@typo-unless ()
1409 "Start `typo-mode' UNLESS the buffer matches a predicate."
1410 (unless (or ; predicates here
1411 (string-match-p "COMMIT_EDITMSG" buffer-file-name))
1412 (typo-mode +1)))))
1408 1413
1409(setup (:straight undo-fu) 1414(setup (:straight undo-fu)
1410 (:global "C-/" undo-fu-only-undo 1415 (:global "C-/" undo-fu-only-undo