Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-07-2011, 05:20 PM   #1
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
enable 2 flyspell modes in .emacs


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?
Old 03-07-2011, 06:35 PM   #2
Senior Member
Registered: Nov 2005
Distribution: Arch
Posts: 3,093

Rep: Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273Reputation: 1273
Something like
(add-hook 'latex-mode-hook
          (lambda () (flyspell-mode +1)))
(add-hook 'java-mode-hook
          (lambda () (flyspell-prog-mode +1)))



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to enable autoindent in Emacs? cola Linux - Newbie 6 04-21-2010 04:30 AM
pre-build modes for emacs and vi xeon123 Programming 4 09-07-2007 08:20 AM
LXer: Learn the essential modes and editing features of Emacs LXer Syndicated Linux News 0 04-16-2007 03:01 PM
LXer: Chat it up in Emacs with IRC modes LXer Syndicated Linux News 0 01-15-2007 06:54 PM
Are UATA IDE Drivers needed in Linux to enable UDMA Harddrive modes? linux-fan64 Linux - Hardware 1 02-25-2004 04:04 PM

All times are GMT -5. The time now is 10:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration