Is there a way to make a spell check of comments in C++ codes using emacs?
The lisp-snippet below in .emacs got it to work for me on Ubuntu Linux
(add-hook 'c-mode-common-hook 'flyspell-prog-mode)
There exist alternative setups. But I think you can find them by googling flyspell-prog-mode.
To spell check comments already in the file:
M-x ispell-comments-and-strings
To spell check comments as you type:
M-x flyspell-prog-mode
and the .emacs
hooks kindahero suggested.
as mirk said flyspell-prog-mode
is the obvious way.
To share my config,
;;; for prog modes turn on flyspell-prog-mode (checks spell only in comments)
(dolist (hook '(lisp-mode-hook
emacs-lisp-mode-hook
ruby-mode-hook
yaml-mode
python-mode-hook
shell-mode-hook
php-mode-hook
css-mode-hook
nxml-mode-hook
crontab-mode-hook
perl-mode-hook
javascript-mode-hook
LaTeX-mode-hook))
(add-hook hook 'flyspell-prog-mode))
Remove those modes you don't use/want.
Edit -> Spelling -> Ispell -> Spell-Check Comments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With