Index: compile_rules.py ================================================================== --- compile_rules.py +++ compile_rules.py @@ -55,10 +55,11 @@ def prepareFunction (s): "convert simple rule syntax to a string of Python code" s = s.replace("__also__", "bCondMemo") s = s.replace("__else__", "not bCondMemo") + s = s.replace("sContext", "_sAppContext") s = re.sub(r"isStart *\(\)", 'before("^ *$|, *$")', s) s = re.sub(r"isRealStart *\(\)", 'before("^ *$")', s) s = re.sub(r"isStart0 *\(\)", 'before0("^ *$|, *$")', s) s = re.sub(r"isRealStart0 *\(\)", 'before0("^ *$")', s) s = re.sub(r"isEnd *\(\)", 'after("^ *$|^,")', s) Index: doc/syntax.txt ================================================================== --- doc/syntax.txt +++ doc/syntax.txt @@ -419,10 +419,14 @@ > Contains the current country locale of the checked paragraph. colour <<- sCountry == "US" ->> color # Use American English spelling. +`sContext` + +> The name of the application running (Python, Writer…) + ## ACTIONS ## There are 5 kinds of actions: Index: gc_lang/fr/rules.grx ================================================================== --- gc_lang/fr/rules.grx +++ gc_lang/fr/rules.grx @@ -817,10 +817,11 @@ __/maj(majuscule_début_paragraphe)__ ^ *([a-zàâéèêîôç](?:[\w-]+[’'`‘]?|[’'`‘])) @@$ <<- after("\\w\\w[.] +\\w+") -1>> =\1.capitalize() # Majuscule en début de phrase, sauf éventuellement lors d’une énumération. +# autre possibilité: avec or (sContext != "Writer" and after("[.] *$")) TEST: {{je}} suis disponible quand tu veux. Mais pas aujourd’hui. TEST: {{j’}}arrive. Prépare-toi. TEST: {{qu’}}il est grand, ce batiment. Faut voir si on pourra la détruire avec si peu de charges.