emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 082c169: Wcheck-mode: add more examples in README.md file


From: Teemu Likonen
Subject: [elpa] master 082c169: Wcheck-mode: add more examples in README.md file
Date: Sun, 16 Jun 2019 02:37:41 -0400 (EDT)

branch: master
commit 082c169cb71fbb1408afc38949f60d3d66c2b6ec
Author: Teemu Likonen <address@hidden>
Commit: Teemu Likonen <address@hidden>

    Wcheck-mode: add more examples in README.md file
---
 packages/wcheck-mode/README.md | 52 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/packages/wcheck-mode/README.md b/packages/wcheck-mode/README.md
index 7696c79..a2021a9 100644
--- a/packages/wcheck-mode/README.md
+++ b/packages/wcheck-mode/README.md
@@ -145,6 +145,9 @@ querying effective configuration data for any language.
 Examples
 --------
 
+
+### Basic spell-checking
+
 Here are some examples on how you can fill the `wcheck-language-data`
 variable. The value is a list of language configurations:
 
@@ -196,6 +199,52 @@ and sets the syntactic meaning of the ASCII hyphen 
character (-) to a
 word character ("w"). Wcheck mode and its regular expression search will
 use that syntax table when scanning buffers' content in that language.
 
+
+### Choose what to check
+
+On some Emacs major modes there is no need to spell-check everything in
+the buffer. For example, in programming languages modes it is probably
+useful to spell-check only programmer's comments and functions'
+documentation strings. This can be configured with language option
+`read-or-skip-faces`. The following incomplete language configuration
+makes special treatment for emacs-lisp-mode: it checks only text areas
+which have been marked with faces `font-lock-comment-face` and
+`font-lock-doc-face`.
+
+    ("Some language"
+     ;; (program ...)
+     ;; (args ...)
+     (read-or-skip-faces
+      (emacs-lisp-mode read font-lock-comment-face font-lock-string-face)))
+
+Because `read-or-skip-faces` settings is often not a language specific
+option but a general major mode specific setting it can be more useful
+to put `read-or-skip-faces` settings in variable
+`wcheck-language-data-defaults` like this:
+
+    (setq wcheck-language-data-defaults
+          '((read-or-skip-faces
+             ((emacs-lisp-mode lisp-mode)
+              read font-lock-comment-face font-lock-doc-face)
+             (sh-mode
+              read font-lock-comment-face)
+             (message-mode
+              read nil message-header-subject message-cited-text)
+             (latex-mode
+              read nil font-latex-sectioning-1-face
+              font-latex-sectioning-2-face
+              font-latex-sectioning-3-face
+              font-latex-sectioning-4-face font-latex-bold-face
+              font-latex-italic-face font-lock-constant-face)
+             (org-mode
+              read nil org-level-1 org-level-2 org-level-3 org-level-4
+              org-level-5 org-level-6 org-level-7 org-level-8)
+             (git-commit-mode
+              read nil git-commit-summary-face))))
+
+
+### Add words to dictionary
+
 Below is an example on how to add an "Add to dictionary" feature to the
 actions menu, among spelling suggestions. First, there's the language
 configuration. The example below is similar to the "British English"
@@ -249,6 +298,9 @@ Enchant program must be restarted.
             (message "Added word \"%s\" to the %s dictionary"
                      word language)))))
 
+
+### Other than human languages
+
 Spell-checking human languages is not the only application for Wcheck
 mode. The following configuration adds language called "Trailing
 whitespace" which finds and marks all trailing whitespace characters



reply via email to

[Prev in Thread] Current Thread [Next in Thread]