Being in front of the computer hasn't helped my spelling because it's so easy to let the computer catch and fix the spelling errors for me. Of course Emacs has spell checking (M-x spell-{buffer,region,string,word}
), but what is really handy is spell-checking as you type.
Enter flyspell
.
flyspell
is a minor-mode, so enabling it only causes spell-checking in that buffer, so it's handy to add the hooks to turn it on for the modes you deem appropriate (mail messages, text files, etc.). But wait, you do most of your work programming, right? Just turn on flyspell-prog-mode
, and only your comments and strings will be checked for spelling errors.
It has the standard installation - only the major entry point is the routine 'flyspell-mode
where the filename is "flyspell.el", so you need to tell Emacs to look for that appropriately. Here's what I use to enable flyspell
and turn it on for a couple of different modes.
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(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 'tcl-mode-hook 'flyspell-prog-mode)
(defun turn-on-flyspell ()
"Force flyspell-mode on using a positive arg. For use in hooks."
(interactive)
(flyspell-mode 1))