Here's a quick trip down the flyspell
source code rabbit hole. (Try C-h l flyspell
to get to it.)
flyspell-prog-mode
uses flyspell-generic-progmode-verify
.
That function uses text properities to decide whether or not to fire
based on whether or not the text property of the previous character
is a member of flyspell-prog-text-faces
.
Now, the flyspell-prog-text-faces
docstring tells me that, by
default:
flyspell-prog-text-faces
is a variable defined in flyspell.el
.
Its value is (font-lock-string-face font-lock-comment-face font-lock-doc-face)
Documentation:
Faces corresponding to text in programming-mode buffers.
So we can just remove font-lock-string-face
from this list:
(setq flyspell-prog-text-faces
(delq 'font-lock-string-face
flyspell-prog-text-faces))
Et voila.