LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 03-07-2011, 05:20 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 364

Rep: Reputation: 16
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?
 
Old 03-07-2011, 06:35 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,444

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


Reply

Tags
emacs


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 03:14 AM.

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