all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode
       [not found] <1856494893.5680179.1531433161731.ref@mail.yahoo.com>
@ 2018-07-12 22:06 ` R. Diez
  2020-08-27 20:08   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: R. Diez @ 2018-07-12 22:06 UTC (permalink / raw)
  To: 32136



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.

I mentioned it on the help-gnu-emacs mailing list here:


https://lists.gnu.org/archive/html/help-gnu-emacs/2018-07/msg00100.html

This is an excerpt from that discussion:

> it checks 
> literal strings too, even the filenames inside C's #include <blah/blah-h> 
> preprocessor directives, littering too much source code with error marks.

They are strings, aren't they?  How should Flyspell know that some
string is a file name?

> Trying to limit spell checking to just source-code comments is hard. I found 
> this page that explains how to do it:
> 
> http://blog.binchen.org/posts/effective-spell-check-in-emacs.html
> 
> But I haven't quite understood it yet (I am no Lisp expert). How about adding 
> a simple customizable variable to turn literal string checking on and off?





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode
  2018-07-12 22:06 ` bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode R. Diez
@ 2020-08-27 20:08   ` Stefan Kangas
  2020-09-09 18:11     ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2020-08-27 20:08 UTC (permalink / raw)
  To: R. Diez; +Cc: 32136

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

tags 32136 + patch
thanks

"R. Diez" <rdiezmail-emacs@yahoo.de> 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

[-- Attachment #2: 0001-Make-flyspell-prog-text-faces-into-defcustom.patch --]
[-- Type: text/x-diff, Size: 1383 bytes --]

From 39f5fea217735ebea5d370ae8be25b8ebd331245 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode
  2020-08-27 20:08   ` Stefan Kangas
@ 2020-09-09 18:11     ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2020-09-09 18:11 UTC (permalink / raw)
  To: R. Diez; +Cc: 32136

close 32136 28.1
thanks

Stefan Kangas <stefan@marxist.se> 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

No further comments within 2 weeks.

Pushed to master as commit fab443827a, and I'm closing this bug report.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-09 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1856494893.5680179.1531433161731.ref@mail.yahoo.com>
2018-07-12 22:06 ` bug#32136: 26.1; Provide a customize variable to turn off spell-checking literal strings in flyspell-prog-mode R. Diez
2020-08-27 20:08   ` Stefan Kangas
2020-09-09 18:11     ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.