In emacs flyspell-prog-mode, comments are spell-checked. However, many of my comments are commented blocks of code, and are highlighted as spelling errors. How can I tell Flyspell to ingore all of the symbols used in the program code?
Asked
Active
Viewed 130 times
1 Answers
1
Short answer: You can't.
Long answer: You have to program it yourself. An entry point is the variable flyspell-generic-check-word-predicate
where you can supply a function that returns nil if it shouldn't be checked and non-nil if it should, (point)
is here after the word you want to analyze.
If you have this requirement only for certain modes you can set the flyspell-mode-predicate
for the mode. E.g. for python-mode
(put 'python-mode 'flyspell-mode-predicate 'your-python-predicate-function)

Michael Markert
- 3,986
- 2
- 19
- 19
-
And what if I want to generalize this to all prog-modes? – PythonNut Oct 05 '13 at 18:23
-
Right there in the first paragraph: Change `flyspell-generic-check-word-predicate`. But don't use `flyspell-prog-mode` then because it resets it to flyspells own generic one. – Michael Markert Oct 06 '13 at 09:04