LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   enable 2 flyspell modes in .emacs (https://www.linuxquestions.org/questions/linux-newbie-8/enable-2-flyspell-modes-in-emacs-867070/)

xeon123 03-07-2011 05:20 PM

enable 2 flyspell modes in .emacs
 
Hi,

emacs has these 2 mode for spell checking.

M-x flyspell-mode
Enable Flyspell mode, which highlights all misspelled words.
M-x flyspell-prog-mode
Enable Flyspell mode for comments and strings only.

I would like to, when I'm using java files, the flyspell-prog-mode is enabled. When I'm using latex files the flyspell-mode is enabled.

How can I do that in .emacs files?

ntubski 03-07-2011 06:35 PM

Something like
Code:

(add-hook 'latex-mode-hook
          (lambda () (flyspell-mode +1)))
(add-hook 'java-mode-hook
          (lambda () (flyspell-prog-mode +1)))



All times are GMT -5. The time now is 05:00 PM.