[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/wcheck-mode 3ba6be4 26/39: Add read-or-skip-faces examp
From: |
Teemu Likonen |
Subject: |
[elpa] externals/wcheck-mode 3ba6be4 26/39: Add read-or-skip-faces example and section headings |
Date: |
Sun, 4 Oct 2020 07:55:22 -0400 (EDT) |
branch: externals/wcheck-mode
commit 3ba6be45cb2aa1eab92245bb32b4445a8f84ef9d
Author: Teemu Likonen <tlikonen@iki.fi>
Commit: Teemu Likonen <tlikonen@iki.fi>
Add read-or-skip-faces example and section headings
---
README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/README.md b/README.md
index 75bc729..b1a3f00 100644
--- a/README.md
+++ b/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
- [elpa] externals/wcheck-mode a2affd8 28/39: Improve the doc string of wcheck--generate-face-predicate function, (continued)
- [elpa] externals/wcheck-mode a2affd8 28/39: Improve the doc string of wcheck--generate-face-predicate function, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 09f0c3a 32/39: Make --generate-face-predicate to take advantage of lexical closures, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 7fb39bc 38/39: README: In install instructions refer to GNU Elpa only, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode d56345a 23/39: Change PGP key's url, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode e459208 31/39: Update copyright year (2019), Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 271198b 36/39: Fix the first line of wcheck-mode.el file, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 18c3118 13/39: Make generated face predicate a lambda form, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode adb9dd9 19/39: Version 2016.1.30, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode e07dd1d 21/39: Different logic for wcheck--program-executable-p, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 57c41b2 22/39: Fix some quoting problems in doc strings, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 3ba6be4 26/39: Add read-or-skip-faces example and section headings,
Teemu Likonen <=
- [elpa] externals/wcheck-mode 4bc8b09 15/39: Reformat comments, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 7bdc250 25/39: Mention GNU Elpa in the README, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 56e5137 27/39: Refer to "OpenPGP key" instead of just "PGP", Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 952733c 29/39: Switch to lexical-binding, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode b41ff61 33/39: Call outline-show-entry function instead of deprecated show-entry, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 4d6efd7 35/39: Reword some error messages, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode c50e1f5 34/39: Version 2019.6.17, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 0c744a4 39/39: Remove -pkg.el, COPYING and Makefile, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode b2549ea 37/39: Use the same copyright and version header as in the GNU Elpa repository, Teemu Likonen, 2020/10/04