I am using emacs as my text editor for c/c++ code. Is there any tool which spell check comments for me?
Thank you.
flyspell does in-line spell checking and highlights incorrect words as you type. Just make sure you activate flyspell-prog-mode
to spell-check only the comments (instead of flyspell-mode
, which checks the whole text, and will get lost in your source code).
After you activate flyspell
only newly typed text is spell-checked. You have to run flyspell-buffer
to check existing text. I have the following in my initialization file to automatically do this:
(defun my/flyspell-buffer-after-activation ()
"Run `flyspell-buffer' after `flyspell-mode' is activated."
(when flyspell-mode
(flyspell-buffer)))
(add-hook 'flyspell-mode-hook 'my/flyspell-buffer-after-activation)
flyspell-buffer
. See my edit on how to automate this.
May 13, 2014 at 17:19