- For general purpose spell-checking, there are quite a few popular alternatives
ispell
and friends: Built into emacs & typically called withispell-buffer
. Checks spelling only on demand.flyspell-mode
: Also built-in and provides on-the-fly spell checking and highlights mistakes.speck-mode
: Available from MELPA, it checks the spelling of the word once you pause after typing. Also has a few distinguishing features from flyspell mode like able to use multiple dictionaries in the same buffer. (Disclaimer : I only used this mode briefly a long time back)
Note that all the above require dedicated spell-checking programs such as aspell
or hunspell
and appropriate dictionaries. The modes only provide a convenient emacs interface to the command line programs.
For selective spell checking, you can customize
flyspell-mode
with the variableflyspell-generic-check-word-predicate
by wiring a function that selects which words must be checked. Your listed example is easy though -- Just useflyspell-prog-mode
which only checks comments in code buffers.Heuristic spell checking: I am not aware of any dedicated grammar parsers for emacs yet. I will mention
writegood-mode
available in MELPA which highlights weasel words and passive voice in the buffer. It gets you half the way there.Anything else: Correcting language in general is a hard problem. That being said, if there exists any external program/script in this area, it is usually easy to make it interface with emacs.
For selective spell checking, you can customizeflyspell-mode
with the variableflyspell-generic-check-word-predicate
by wiring a function that selects which words must be checked. Your listed example is easy though -- Just useflyspell-prog-mode
which only checks comments in code buffers.