[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 251/352: Clarify the use of regexp-start, -body and -end
From: |
Stefan Monnier |
Subject: |
[elpa] 251/352: Clarify the use of regexp-start, -body and -end |
Date: |
Mon, 07 Jul 2014 14:04:40 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit 14ee2fcf4bbe45bba0ead86220fc09af373192b6
Author: Teemu Likonen <address@hidden>
Date: Fri Jun 24 14:39:15 2011 +0300
Clarify the use of regexp-start, -body and -end
---
wcheck-mode.el | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index 1e5f50f..99db3f6 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -316,20 +316,29 @@ regexp-end
This is how they are used in practice: `wcheck-mode' scans
buffer's content and looks for strings that match the
- construct `regexp-start + regexp-body + regexp-end'. Strings
- that match regexp-body (but not `regexp-discard', see below)
- are sent to the text checker program or function to analyze.
+ following regular expression
- Strings returned from the program or function are marked in
- Emacs buffer using the following construction: `regexp-start
- + (regexp-quote STRING) + regexp-end'. The middle part is
- marked with `face' (see above) .
+ REGEXP-START\\(REGEXP-BODY\\)REGEXP-END
- Do not use grouping constructs `\\( ... \\)' in the regular
- expressions because the back reference `\\1' is used for
+ The regular expression back reference \\1 is used to extract
+ `regexp-body' part from the matched string. That string is
+ then matched against `regexp-discard' (see below) and if it
+ doesn't match the string is sent to the text checker program
+ or function to analyze.
+
+ Strings returned from the program or function are quoted for
+ regular expression special characters (with `regexp-quote'
+ function) and marked in Emacs buffer using the following
+ construction: `regexp-start + STRING + regexp-end'. The
+ STRING part is marked with `face' (see above) .
+
+ You can't use grouping constructs `\\( ... \\)' in
+ `regexp-start' because the back reference `\\1' is used for
separating the body string from the start and end match. You
can use \"shy\" groups `\\(?: ... \\)' which do not record
- the matched substring.
+ the matched substring. Grouping constructs `\\( ... \\)' are
+ allowed in `regexp-body' and `regexp-end'. Just note that the
+ first group and back reference \\1 is already taken.
The default values for the regular expressions are
@@ -347,7 +356,7 @@ regexp-discard
the value of this option. If this regular expression matches,
then the string is discarded and won't be sent to the
text-checker program or function to analyze. You can use this
- to define exceptions to the regexp-body match. The default
+ to define exceptions to the `regexp-body' match. The default
value is
\\`'+\\'
- [elpa] 225/352: Käsitellään hyppytoiminnossa myös puskurin alku ja loppu, (continued)
- [elpa] 225/352: Käsitellään hyppytoiminnossa myös puskurin alku ja loppu, Stefan Monnier, 2014/07/07
- [elpa] 231/352: Versio 2011.01.09, Stefan Monnier, 2014/07/07
- [elpa] 237/352: Makron wcheck-with-language-data muuttujille paremmat nimet, Stefan Monnier, 2014/07/07
- [elpa] 236/352: Lisätään makroihin sisennysasetukset: (declare (indent ...)), Stefan Monnier, 2014/07/07
- [elpa] 238/352: Poistetaan turha #' lambda-rakenteiden edestä, Stefan Monnier, 2014/07/07
- [elpa] 245/352: Correction in wcheck-language-data doc: "variable" -> "value", Stefan Monnier, 2014/07/07
- [elpa] 240/352: Mainostetaan funktiota wcheck-marked-text-at julkiseen käyttöön, Stefan Monnier, 2014/07/07
- [elpa] 246/352: Fix type in doc: "wcheck-parse-" "wcheck-parser-", Stefan Monnier, 2014/07/07
- [elpa] 235/352: Wcheck-versionumero: 2011.02.20, Stefan Monnier, 2014/07/07
- [elpa] 233/352: Uusi ominaisuus: tarkistusohjelman tulosteen jäsennysfunktio, Stefan Monnier, 2014/07/07
- [elpa] 251/352: Clarify the use of regexp-start, -body and -end,
Stefan Monnier <=
- [elpa] 241/352: Korjataan wcheck-jump-backward -bugi, Stefan Monnier, 2014/07/07
- [elpa] 239/352: Tyylillistä hienosäätöä funktioon wcheck-make-overlay, Stefan Monnier, 2014/07/07
- [elpa] 243/352: Add README file, Stefan Monnier, 2014/07/07
- [elpa] 250/352: Improve wcheck-language-data doc, Stefan Monnier, 2014/07/07
- [elpa] 244/352: Copy Emacs wiki page's content to new README file, Stefan Monnier, 2014/07/07
- [elpa] 249/352: Fix a typo in wcheck-language-data doc string, Stefan Monnier, 2014/07/07
- [elpa] 253/352: Add \< and \> to regexps in "email" language example, Stefan Monnier, 2014/07/07
- [elpa] 252/352: Rephrase grouping construct \(\) description in doc string, Stefan Monnier, 2014/07/07
- [elpa] 247/352: Escape \\< with \\=\\< in wcheck-language-data doc string, Stefan Monnier, 2014/07/07
- [elpa] 248/352: Clearer reference to the license text, Stefan Monnier, 2014/07/07