latex fix: enable spell checking correctly

The varible `TeX-mode-local-vars-hook` is not called correctly as AucTeX
reports that the major mode in a LaTeX file is `latex-mode`. Instead,
let's use `latex-mode-local-vars-hook` to enable flyspell.

This change enables disabling the feature of flyspell of immediately
spellchecking a document with:

`(setq-hook! 'TeX-mode-hook +spellcheck-immediately nil)`
This commit is contained in:
UndeadKernel 2019-01-02 10:47:19 +01:00
parent 46499ec70f
commit de2e41774f

View file

@ -66,7 +66,7 @@ If no viewers are found, `latex-preview-pane' is used.")
;; Enable rainbow mode after applying styles to the buffer ;; Enable rainbow mode after applying styles to the buffer
(add-hook 'TeX-update-style-hook #'rainbow-delimiters-mode) (add-hook 'TeX-update-style-hook #'rainbow-delimiters-mode)
(when (featurep! :feature spellcheck) (when (featurep! :feature spellcheck)
(add-hook 'TeX-mode-local-vars-hook #'flyspell-mode)) (add-hook 'latex-mode-local-vars-hook #'flyspell-mode))
;; All these excess pairs dramatically slow down typing in latex buffers, so ;; All these excess pairs dramatically slow down typing in latex buffers, so
;; we remove them. Let snippets do their job. ;; we remove them. Let snippets do their job.
(after! smartparens-latex (after! smartparens-latex