Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using emacs as my text editor for c/c++ code. Is there any tool which spell check comments for me?

Thank you.

share|improve this question
up vote 0 down vote accepted

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

(add-hook 'flyspell-mode-hook 'my/flyspell-buffer-after-activation)
share|improve this answer
Thanks. What if i have existing code, how can I spell check comments with flyspell? – n179911 May 13 '14 at 15:04
You have to run flyspell-buffer. See my edit on how to automate this. – Francesco May 13 '14 at 17:19

Try <META-x> ispell-comments-and-strings. It does what it says.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.