1

I want to launch a command when I start emacs with a .tex file. The command is:

M-x flyspell-mode

Is it possible and how?

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
Romain Picot
  • 255
  • 1
  • 13

1 Answers1

3

Perhaps you can add hook to the latex-mode. You can add the following line into your .emacs file.

(add-hook 'latex-mode-hook 'flyspell-mode)

I didn't test this, however, I think it should work. This will enable flyspell-mode whenever you enter the latex-mode.

ntalbs
  • 28,700
  • 8
  • 66
  • 83
  • And if you want to enable `flyspell-mode` for all text buffer, you can use the "meta hook" called `text-mode-hook` (as opposed to `prog-mode-hook` which is for buffer in a mode for development). – Daimrod Apr 22 '14 at 11:17
  • It's exactly what I want. Thank you – Romain Picot Apr 22 '14 at 11:44