[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting flyspell-mode when entering a file
From: |
Maurizio Vitale |
Subject: |
Re: Setting flyspell-mode when entering a file |
Date: |
Thu, 20 Aug 2009 22:05:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>>>>> "Sarir" == Sarir Khamsi <sarir.khamsi@raytheon.com> writes:
Sarir> I would like to automatically enter flyspell-mode when I open
Sarir> a file and have placed
Sarir> -*- flyspell-mode: t -*-
Sarir> at the top of the file I'm opening. The mode-line says "Fly"
Sarir> in it but flyspell doesn't seem to be working. If I then run
Sarir> the flyspell-mode command interactively (twice since it seems
Sarir> to already be enabled), it works fine. Any ideas what I'm
Sarir> doing wrong? Thanks.
You can set flyspell mode for specific modes. This is what I have:
(add-hook 'message-mode-hook 'turn-on-flyspell)
(add-hook 'text-mode-hook 'turn-on-flyspell)
(add-hook 'c-mode-common-hook 'flyspell-prog-mode)
(add-hook 'emacs-lisp-mode-hook '(lambda ()
(setq flyspell-use-meta-tab nil)
(flyspell-prog-mode)))
(defun turn-on-flyspell ()
(interactive)
(flyspell-mode 1))
OTH,
Maurizio
--