Whenever I run
flyspell-buffer (using hunspell) in a LaTeX-document, my comments marked with % are spell-checked aswell, although I don't want them to be spell-checked. The simplest solution
(setq ispell-check-comments nil) does not do anything. I also tried to let ispell ignore all lines commented out by % with
(defun flyspell-ignore-TeX-comments () "Ignore lines starting with %." (not (string-match "^ *%" (thing-at-point 'line t)))) (put 'text-mode 'flyspell-mode-predicate 'flyspell-ignore-TeX-comments)
This did not do anything either. The comments are recognized as such, though, since they are colored by
font-lock-comment-face. I have explicitly turned off
(add-hook 'prog-mode-hook 'turn-off-flyspell t).
And now for the weirdest part. When I go to
Tools -> Spell-Checking -> Customize, emacs tells me that
ispell Check Comments is toggled off and if I spell-check my document with
Tools -> Spell-Checking -> Spell-Check Buffer, they are ignored as intended, but if I run
M-x flyspell-buffer RET, they are not!
Does anyone have an idea what I did wrong?