17

I'm using flyspell mode, but unfortunatly I have to M-x flyspell-mode in each AUCTeX buffer.

Somehow (add-hook 'LaTeX-mode-hook 'flyspell-mode) doesn't work for me.

What is the correct flyspell-hook in AUCTeX?

  • There is an emacs StackExchange site, shouldn't this question be there? – Jorge E. Cardona Jul 24 at 10:12
13

Try (add-hook 'LaTeX-mode-hook '(flyspell-mode t))

This will force flyspell-mode to turn on, instead of toggling it.

| improve this answer | |
  • thanks. That worked. removing the hook worked as well. The hook might have been sourced somehow otherwise (from text-mode?). – Dima Jul 30 '10 at 14:55
  • This does not work the way you think it works. You probably enabled the flyspell-mode before in your text-mode-hook. The above code does not work and so does not disable the flyspell-mode. – ppareit Dec 10 '18 at 9:08
  • This does not work. I am getting the same error as in stackoverflow.com/questions/42335854/…. The answer below does work for me. – Boris Bukh Jan 29 '19 at 15:05
10
(add-hook 'LaTeX-mode-hook '(flyspell-mode t))

I would be surprised if the above worked.

The following works (using emacs 24):

(add-hook 'LaTeX-mode-hook #'turn-on-flyspell)
| improve this answer | |
  • This worked for me. The above didn't. – NWMT Sep 21 '18 at 13:20
  • indeed, this one works instead of the above. Emacs 26.3. – Boson Bear Jun 28 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.