I want to load flyspell-mode
and execute flyspell-buffer
automatically after emacs loaded a tex file. I tried the following which loads flyspell-mode
but doesn't seem to execute flyspell-buffer
. What would be the proper way to to this? How do I have to change it if I want it on every file not just on LaTeX-files?
(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "de_DE")
(setq ispell-local-dictionary-alist
'(("de_DE" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)
("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)
))
(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)
(add-hook 'LaTeX-mode-hook 'flyspell-buffer)
flyspell
checks for errors but asynchronously (it does not immediately flag errors but only if I scroll to a nearby location).Maybe you can try one from the following to see if it helps:
find-file-hooks
,after-save-hook
,before-save-hook
, andauto-save-hook
?I have the following but it is often very slow:
– Swarnendu Biswas Feb 10 '16 at 17:36(add-hook 'before-save-hook #'flyspell-buffer)
.#
mean in this context? – student Feb 10 '16 at 17:47