help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turn on flyspell mode permanently in .emacs


From: Kevin Rodgers
Subject: Re: turn on flyspell mode permanently in .emacs
Date: Wed, 23 Aug 2006 08:36:55 -0600
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

kevmitch@gmail.com wrote:
In what buffer?  The *scratch* buffer should have flyspell mode turned
on after your ~/.emacs file is loaded.
It appears that even with (flyspell-mode 1) in the top level of the
.emacs file
flyspell mode is not on in any buffer; not even the scratch buffer.

That is a puzzle.

How do you manually turn on flyspell-mode?  (M-x flyspell-mode in a
buffer where it's already turned on will actually toggle it i.e. turn
it off.  You need to specify a prefix arg: C-u M-x flyspell-mode.)
yeah, I just use M-x flyspell-mode to turn it on which suggests that it
really isn't on  prior to this.

Yes.

I'm surprised it doesn't say "Flyspell mode enabled" somewhere after
"Loading flyspell...done".
This is a good point.

Your best bet is to get rid of (flyspell-mode 1) at the top level of
your ~/.emacs file, because we know it won't do what you asked for, and
to follow Sebastien's advice:

(add-hook 'text-mode-hook
          (lambda () (flyspell-mode 1)))
Ok, I hadn't tried exactly that. You'll have to bear with me. This lisp
stuff is rather obtuse to the beginner. Unfortunately, this doesn't
have the desired behavior either. It does however turn on flyspell in
the scratch buffer if I enter the command "M-x text-mode".

Naturally: the *scratch* buffer is Lisp Interaction mode by default,
not Text mode.

As Sebastien explained, text-mode-hook is also run by *many* other
text-oriented modes (Mail mode, SGML mode, etc.)

I can also
get it to turn on automatically if I open a .m file (which puts emacs
in matlab-mode) if I have the following lines in my .emacs file:

(add-hook 'matlab-mode-hook
          (lambda () (flyspell-mode 1)))

So that's something.

You might want to try (flyspell-prog-mode) there instead.

To keep things simple, I have otherwise been opening the .emacs file,
which puts me in a buffer titled .emacs, but the exact name of the mode
seems to be trickier. I get a pulldown menu titled  Emacs-Lisp, which
might suggest that I'm in Emacs-Lisp-mode. However M-x Emacs-Lisp-mode
returns no match.

,----[ C-h v major-mode RET ]
| major-mode is a variable defined in `C source code'.
| Its value is emacs-lisp-mode
| Local in buffer .emacs; global value is fundamental-mode
| Automatically becomes buffer-local when set in any fashion.
|
| Documentation:
| Symbol for current buffer's major mode.
|
| [back]
`----

I guess this is really beside the issue, because I
don't want to have to worry about what mode I'm in. I just want
flyspell to be on all the time. Is it just wishful thinking that there
might be an any-mode-hook?

Yes, that is wishful thinking.  The closest thing is change-major-mode-hook,
but you reported that my hack that used it didn't actually work.

Thanks for taking the time to think about this.

You're welcome!

--
Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]