bug#81638: 32.0.50; flyspell-prog-text-faces type and semantics
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
>> We could try and clean things up by renaming it, but it seems to me that
>> a simpler solution is to improve the defcustom's `:type` to reflect more
>> faithfully the values it can take (i.e. a list of `face` property
>> values).
> The request was much more general, and in particular he wanted to be
> able to specify nil.
nil *is* a valid `face` property value.
I was thinking of a patch like the one below. It's a bit less
convenient UI-wise and lets you specify "suboptimal" values like
(font-lock-string-face font-lock-string-face font-lock-string-face)
but I expect that there aren't very many users setting this var via
the Custom UI, so it's a small price to pay.
=== Stefan
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 028bba86d2c..e15b9556598 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -397,9 +397,10 @@ sgml-mode-flyspell-verify
(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."
- :type '(set (const font-lock-string-face)
- (const font-lock-comment-face)
- (const font-lock-doc-face))
+ :type '(repeat (choice (const font-lock-string-face)
+ (const font-lock-comment-face)
+ (const font-lock-doc-face)
+ symbol))
:version "28.1")
(defun flyspell-generic-progmode-verify ()