Subject: Re: bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode

From: Stefan Kangas <[email-masked]>
Date: Thu, 27 Aug 2020 13:08:24 -0700

tags 32136 + patch
thanks

"R. Diez" <[email-masked]> writes:

> I wish I could easily turn off spell-checking of literal strings in
> flyspell-prog-mode . Some customize variable would probably be the
> best way.

Makes sense to me.  How about the attached patch?

With it, you can just:

   M-x customize-option RET flyspell-prog-text-faces RET

Best regards,
Stefan Kangas
From 39f5fea217735ebea5d370ae8be25b8ebd331245 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Thu, 27 Aug 2020 21:56:26 +0200
Subject: [PATCH] Make flyspell-prog-text-faces into defcustom

* lisp/textmodes/flyspell.el (flyspell-prog-text-faces):
Make into defcustom.  (Bug#32136)
---
 lisp/textmodes/flyspell.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 9805928721..a1397163ba 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -387,9 +387,12 @@ sgml-mode-flyspell-verify
 ;;*---------------------------------------------------------------------*/
 ;;*    Programming mode                                                 */
 ;;*---------------------------------------------------------------------*/
-(defvar flyspell-prog-text-faces
+(defcustom flyspell-prog-text-faces
   '(font-lock-string-face font-lock-comment-face font-lock-doc-face)
-  "Faces corresponding to text in programming-mode buffers.")
+  "Faces corresponding to text in programming-mode buffers."
+  :type '(set (const font-lock-string-face)
+              (const font-lock-comment-face)
+              (const font-lock-doc-face)))
 
 (defun flyspell-generic-progmode-verify ()
   "Used for `flyspell-generic-check-word-predicate' in programming modes."
-- 
2.28.0