core: add support of modifiers in evaluation of expressions with "modifier:name,data,string" (issue #60)
This commit is contained in:
parent
1a0ba4a9dc
commit
88aa82d672
@ -22,6 +22,7 @@ New features::
|
||||
|
||||
* core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx"
|
||||
* core: add calculation of expression in evaluation of expressions with "calc:xxx" (issue #997)
|
||||
* core: add support of modifiers in evaluation of expressions with "modifier:name,data,string"
|
||||
* api: add modifier "color_encode_ansi" (issue #528)
|
||||
* api: add modifier "eval_path_home"
|
||||
* irc: add "user" in output of irc_message_parse (issue #136)
|
||||
|
@ -266,67 +266,68 @@ infolists: zeigt Information über die Infolists an
|
||||
/eval [-n|-s] <expression>
|
||||
[-n] -c <expression1> <operator> <expression2>
|
||||
|
||||
-n: gibt das Ergebnis aus, ohne das dieses in den Buffer gesendet wird (debug Modus)
|
||||
-s: teilt Ausdrücke bevor sie evaluiert werden (mehrere Befehle können durch Semikolon getrennt werden)
|
||||
-c: Auswertung als Bedingung: nutzt Operatoren und runde Klammern, Rückgabewert als Boolean-Wert ("0" oder "1")
|
||||
expression: Ausdruck welcher verarbeitet werden soll. Variablen im Format ${variable} werden ersetzt (siehe unten); mehrere Befehle werden durch ein Semikolon voneinander getrennt
|
||||
operator: ein logischer oder vergleichender Operand:
|
||||
- logische Operanden:
|
||||
&& boolean "und"
|
||||
|| boolean "oder"
|
||||
- vergleichende Operanden:
|
||||
== gleich
|
||||
!= ungleich
|
||||
<= kleiner oder gleich
|
||||
< kleiner
|
||||
>= größer oder gleich
|
||||
> größer
|
||||
=~ stimmt mit regulärem POSIX Ausdruck überein
|
||||
!~ stimmt NICHT mit regulärem POSIX Ausdruck überein
|
||||
=* stimmt mit Maske überein (Platzhalter "*" ist erlaubt)
|
||||
!* stimmt mit Maske NICHT überein (Platzhalter "*" ist erlaubt)
|
||||
-n: display result without sending it to buffer (debug mode)
|
||||
-s: split expression before evaluating it (many commands can be separated by semicolons)
|
||||
-c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1")
|
||||
expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons
|
||||
operator: a logical or comparison operator:
|
||||
- logical operators:
|
||||
&& boolean "and"
|
||||
|| boolean "or"
|
||||
- comparison operators:
|
||||
== equal
|
||||
!= not equal
|
||||
<= less or equal
|
||||
< less
|
||||
>= greater or equal
|
||||
> greater
|
||||
=~ is matching POSIX extended regex
|
||||
!~ is NOT matching POSIX extended regex
|
||||
=* is matching mask (wildcard "*" is allowed)
|
||||
!* is NOT matching mask (wildcard "*" is allowed)
|
||||
|
||||
Ein Ausdruck gilt als "wahr" sofern das Ergebnis weder NULL, nicht leer und von "0" abweichend ist.
|
||||
Für einen Vergleich werden Fließkommazahlen genutzt sofern es sich bei beiden Ausdrücken um gültige Nummer handelt, folgende Formate werden unterstützt:
|
||||
- Integer (Beispiele: 5, -7)
|
||||
- Fließkommazahl (Beispiele: 5.2, -7.5, 2.83e-2)
|
||||
- hexadezimale Zahl (Beispiele: 0xA3, -0xA3)
|
||||
Um einen Vergleich zwischen zwei Zeichenketten zu erzwingen, müssen die Ausdrücke in Anführungszeichen gesetzt werden, zum Beispiel:
|
||||
An expression is considered as "true" if it is not NULL, not empty, and different from "0".
|
||||
The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats:
|
||||
- integer (examples: 5, -7)
|
||||
- floating point number (examples: 5.2, -7.5, 2.83e-2)
|
||||
- hexadecimal number (examples: 0xA3, -0xA3)
|
||||
To force a string comparison, you can add double quotes around each expression, for example:
|
||||
50 > 100 ==> 0
|
||||
"50" > "100" ==> 1
|
||||
|
||||
Einige Variablen werden im Ausdruck, mittels der Formatierung ${variable}, ersetzt. Mögliche Variablen sind, nach Reihenfolge ihrer Priorität:
|
||||
1. eine evaluierte Teilzeichenkette (Format: "eval:xxx")
|
||||
2. eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx")
|
||||
3. Zeichen welche in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette")
|
||||
4. eine Zeichenkette mit einer maximalen Anzahl an Zeichen (Format: "cut:+Max,Suffix,Zeichenkette")
|
||||
oder maximale Anzahl an Zeichen die auf dem Bildschirm angezeigt werden sollen (Format: "cutscr:Max,Suffix,Zeichenkette oder "cutscr:+Max,Suffix,Zeichenkette")
|
||||
5. Ende einer Zeichenkette nutzen (Format: "rev:xxx")
|
||||
6. Wiederholung einer Zeichenkette (Format: "repeat:Anzahl,Zeichenkette")
|
||||
7. Länge einer Zeichenkette (Format: "length:xxx" oder "lengthscr:xxx")
|
||||
8. eine Farbe (Format: "color:xxx", siehe "Anleitung für API Erweiterung", Funktion "color")
|
||||
9. eine Info (Format: "info:Name,Argumente", Argumente sind optional)
|
||||
10. aktuelles Datum/Uhrzeit (Format: "date" oder "date:format")
|
||||
11. eine Umgebungsvariable (Format: "env:XXX")
|
||||
12. ein Dreifachoperand (Format: "if:Bedingung?Wert_falls_wahr:Wert_falls_unwahr")
|
||||
13. Ergebnis eines Ausdrucks mit Klammern und Operatoren + - * / // % ** (Format: "calc:xxx")
|
||||
14. eine Option (Format: "file.section.option")
|
||||
15. der Name einer lokalen Variablen eines Buffer
|
||||
16. ein hdata Name/Variable (der Wert wird automatisch in eine Zeichenkette konvertiert), standardmäßig wird für "window" und "buffer" das aktuelle Fenster/Buffer verwendet.
|
||||
Das Format für hdata kann wie folgt aufgebaut sein:
|
||||
hdata.var1.var2...: startet mit hdata (der Pointer muss bekannt sein) und fragt eine Variable nach der anderen ab (weitere hdata können folgen)
|
||||
hdata[list].var1.var2...: startet hdata mittels einer Liste, zum Beispiel:
|
||||
${buffer[gui_buffers].full_name}: der vollständige Name des ersten Buffers, in der verknüpften Liste aller Buffer
|
||||
${plugin[weechat_plugins].name}: Name der ersten Erweiterung, in der verknüpften Liste aller Erweiterungen
|
||||
hdata[pointer].var1.var2...: startet hdata mittels einem Pointer, zum Beispiel:
|
||||
${buffer[0x1234abcd].full_name}: vollständiger Name eines Buffers und des dazugehörigen Pointers (kann in triggern benutzt werden)
|
||||
Die vorhandenen Namen für hdata und Variablen sind in der "Anleitung für API Erweiterung", Bereich "weechat_hdata_get". beschrieben
|
||||
Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
|
||||
1. an evaluated sub-string (format: "eval:xxx")
|
||||
2. a string with escaped chars (format: "esc:xxx" or "\xxx")
|
||||
3. a string with chars to hide (format: "hide:char,string")
|
||||
4. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
|
||||
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
|
||||
5. a reversed string (format: "rev:xxx")
|
||||
6. a repeated string (format: "repeat:count,string")
|
||||
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
9. a modifier (format: "modifier:name,data,string")
|
||||
10. an info (format: "info:name,arguments", arguments are optional)
|
||||
11. current date/time (format: "date" or "date:format")
|
||||
12. an environment variable (format: "env:XXX")
|
||||
13. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
14. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
15. an option (format: "file.section.option")
|
||||
16. a local variable in buffer
|
||||
17. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
Format for hdata can be one of following:
|
||||
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
|
||||
hdata[list].var1.var2...: start with a hdata using a list, for example:
|
||||
${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers
|
||||
${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins
|
||||
hdata[pointer].var1.var2...: start with a hdata using a pointer, for example:
|
||||
${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
|
||||
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
|
||||
|
||||
Beispiele (einfache Zeichenketten):
|
||||
Examples (simple strings):
|
||||
/eval -n ${info:version} ==> 0.4.3
|
||||
/eval -n ${env:HOME} ==> /home/user
|
||||
/eval -n ${weechat.look.scroll_amount} ==> 3
|
||||
/eval -n ${sec.data.freenode_password} ==> geheim
|
||||
/eval -n ${sec.data.freenode_password} ==> secret
|
||||
/eval -n ${window} ==> 0x2549aa0
|
||||
/eval -n ${window.buffer} ==> 0x2549320
|
||||
/eval -n ${window.buffer.full_name} ==> core.weechat
|
||||
@ -342,16 +343,16 @@ Beispiele (einfache Zeichenketten):
|
||||
/eval -n ${length:test} ==> 4
|
||||
/eval -n ${calc:(5+2)*3} ==> 21
|
||||
|
||||
Beispiele (Bedingungen):
|
||||
/eval -n -c ${window.buffer.number} > 2 ==> 0
|
||||
/eval -n -c ${window.win_width} > 100 ==> 1
|
||||
/eval -n -c (8 > 12) || (5 > 2) ==> 1
|
||||
/eval -n -c (8 > 12) && (5 > 2) ==> 0
|
||||
/eval -n -c abcd =~ ^ABC ==> 1
|
||||
/eval -n -c abcd =~ (?-i)^ABC ==> 0
|
||||
/eval -n -c abcd =~ (?-i)^abc ==> 1
|
||||
/eval -n -c abcd !~ abc ==> 0
|
||||
/eval -n -c abcd =* a*d ==> 1
|
||||
Examples (conditions):
|
||||
/eval -n -c ${window.buffer.number} > 2 ==> 0
|
||||
/eval -n -c ${window.win_width} > 100 ==> 1
|
||||
/eval -n -c (8 > 12) || (5 > 2) ==> 1
|
||||
/eval -n -c (8 > 12) && (5 > 2) ==> 0
|
||||
/eval -n -c abcd =~ ^ABC ==> 1
|
||||
/eval -n -c abcd =~ (?-i)^ABC ==> 0
|
||||
/eval -n -c abcd =~ (?-i)^abc ==> 1
|
||||
/eval -n -c abcd !~ abc ==> 0
|
||||
/eval -n -c abcd =* a*d ==> 1
|
||||
----
|
||||
|
||||
[[command_weechat_filter]]
|
||||
|
@ -305,14 +305,15 @@ Some variables are replaced in expression, using the format ${variable}, variabl
|
||||
6. a repeated string (format: "repeat:count,string")
|
||||
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
9. an info (format: "info:name,arguments", arguments are optional)
|
||||
10. current date/time (format: "date" or "date:format")
|
||||
11. an environment variable (format: "env:XXX")
|
||||
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
13. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
14. an option (format: "file.section.option")
|
||||
15. a local variable in buffer
|
||||
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
9. a modifier (format: "modifier:name,data,string")
|
||||
10. an info (format: "info:name,arguments", arguments are optional)
|
||||
11. current date/time (format: "date" or "date:format")
|
||||
12. an environment variable (format: "env:XXX")
|
||||
13. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
14. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
15. an option (format: "file.section.option")
|
||||
16. a local variable in buffer
|
||||
17. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
Format for hdata can be one of following:
|
||||
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
|
||||
hdata[list].var1.var2...: start with a hdata using a list, for example:
|
||||
|
@ -2515,6 +2515,15 @@ expanded to last):
|
||||
`+red text+` (in red) +
|
||||
`+bold orange text+` (in bold orange)
|
||||
|
||||
| `+${modifier:name,data,string}+` +
|
||||
(_WeeChat ≥ 2.7_) |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,,%h/python}+` |
|
||||
`+/home/xxx+` +
|
||||
`+/home/xxx/.weechat/python+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` +
|
||||
(_WeeChat ≥ 0.4.3_) |
|
||||
|
@ -305,14 +305,15 @@ Des variables sont remplacées dans l'expression, en utilisant le format ${varia
|
||||
6. une chaîne répétée (format : "repeat:nombre,chaîne")
|
||||
7. longueur d'une chaîne (format : "length:xxx" ou "lengthscr:xxx")
|
||||
8. une couleur (format : "color:xxx", voir la "Référence API extension", fonction "color")
|
||||
9. une info (format : "info:nom,paramètres", les paramètres sont optionnels)
|
||||
10. la date/heure courante (format : "date" ou "date:format")
|
||||
11. une variable d'environnement (format : "env:XXX")
|
||||
12. un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
|
||||
13. le résultat d'une expression avec parenthèses et les opérateurs + - * / // % ** (format: "calc:xxx")
|
||||
14. une option (format : "fichier.section.option")
|
||||
15. une variable locale du tampon
|
||||
16. un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants.
|
||||
9. un modificateur (format : "modifier:nom,données,chaîne")
|
||||
10. une info (format : "info:nom,paramètres", les paramètres sont optionnels)
|
||||
11. la date/heure courante (format : "date" ou "date:format")
|
||||
12. une variable d'environnement (format : "env:XXX")
|
||||
13. un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
|
||||
14. le résultat d'une expression avec parenthèses et les opérateurs + - * / // % ** (format: "calc:xxx")
|
||||
15. une option (format : "fichier.section.option")
|
||||
16. une variable locale du tampon
|
||||
17. un hdata/variable (la valeur est automatiquement convertie en chaîne), par défaut "window" et "buffer" pointent vers la fenêtre et le tampon courants.
|
||||
Le format du hdata peut être le suivant :
|
||||
hdata.var1.var2... : démarrer avec un hdata (le pointeur doit être connu), et demander les variables l'une après l'autre (d'autres hdata peuvent être suivis)
|
||||
hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste, par exemple :
|
||||
|
@ -2563,6 +2563,15 @@ première étendue à la dernière) :
|
||||
`+texte rouge+` (en rouge) +
|
||||
`+texte orange gras+` (en orange gras)
|
||||
|
||||
| `+${modifier:name,data,string}+` +
|
||||
(_WeeChat ≥ 2.7_) |
|
||||
Résultat d'un modificateur, voir la fonction
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,,%h/python}+` |
|
||||
`+/home/xxx+` +
|
||||
`+/home/xxx/.weechat/python+`
|
||||
|
||||
| `+${info:nom}+` +
|
||||
`+${info:nom,paramètres}+` +
|
||||
(_WeeChat ≥ 0.4.3_) |
|
||||
|
@ -305,14 +305,15 @@ Some variables are replaced in expression, using the format ${variable}, variabl
|
||||
6. a repeated string (format: "repeat:count,string")
|
||||
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
9. an info (format: "info:name,arguments", arguments are optional)
|
||||
10. current date/time (format: "date" or "date:format")
|
||||
11. an environment variable (format: "env:XXX")
|
||||
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
13. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
14. an option (format: "file.section.option")
|
||||
15. a local variable in buffer
|
||||
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
9. a modifier (format: "modifier:name,data,string")
|
||||
10. an info (format: "info:name,arguments", arguments are optional)
|
||||
11. current date/time (format: "date" or "date:format")
|
||||
12. an environment variable (format: "env:XXX")
|
||||
13. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
14. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
15. an option (format: "file.section.option")
|
||||
16. a local variable in buffer
|
||||
17. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
Format for hdata can be one of following:
|
||||
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
|
||||
hdata[list].var1.var2...: start with a hdata using a list, for example:
|
||||
|
@ -2623,6 +2623,15 @@ expanded to last):
|
||||
`+red text+` (in red) +
|
||||
`+bold orange text+` (in bold orange)
|
||||
|
||||
| `+${modifier:name,data,string}+` +
|
||||
(_WeeChat ≥ 2.7_) |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,,%h/python}+` |
|
||||
`+/home/xxx+` +
|
||||
`+/home/xxx/.weechat/python+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` +
|
||||
(_WeeChat ≥ 0.4.3_) |
|
||||
|
@ -305,14 +305,15 @@ Some variables are replaced in expression, using the format ${variable}, variabl
|
||||
6. a repeated string (format: "repeat:count,string")
|
||||
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
9. an info (format: "info:name,arguments", arguments are optional)
|
||||
10. current date/time (format: "date" or "date:format")
|
||||
11. an environment variable (format: "env:XXX")
|
||||
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
13. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
14. an option (format: "file.section.option")
|
||||
15. a local variable in buffer
|
||||
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
9. a modifier (format: "modifier:name,data,string")
|
||||
10. an info (format: "info:name,arguments", arguments are optional)
|
||||
11. current date/time (format: "date" or "date:format")
|
||||
12. an environment variable (format: "env:XXX")
|
||||
13. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
14. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
15. an option (format: "file.section.option")
|
||||
16. a local variable in buffer
|
||||
17. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
Format for hdata can be one of following:
|
||||
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
|
||||
hdata[list].var1.var2...: start with a hdata using a list, for example:
|
||||
|
@ -2528,6 +2528,16 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
`+red text+` (赤色で) +
|
||||
`+bold orange text+` (太字オレンジ色で)
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${modifier:name,data,string}+` +
|
||||
(_WeeChat バージョン 2.7 以上で利用可_) |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,,%h/python}+` |
|
||||
`+/home/xxx+` +
|
||||
`+/home/xxx/.weechat/python+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` +
|
||||
(_WeeChat バージョン 0.4.3 以上で利用可_) |
|
||||
|
@ -305,14 +305,15 @@ Some variables are replaced in expression, using the format ${variable}, variabl
|
||||
6. a repeated string (format: "repeat:count,string")
|
||||
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
|
||||
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
|
||||
9. an info (format: "info:name,arguments", arguments are optional)
|
||||
10. current date/time (format: "date" or "date:format")
|
||||
11. an environment variable (format: "env:XXX")
|
||||
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
13. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
14. an option (format: "file.section.option")
|
||||
15. a local variable in buffer
|
||||
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
9. a modifier (format: "modifier:name,data,string")
|
||||
10. an info (format: "info:name,arguments", arguments are optional)
|
||||
11. current date/time (format: "date" or "date:format")
|
||||
12. an environment variable (format: "env:XXX")
|
||||
13. a ternary operator (format: "if:condition?value_if_true:value_if_false")
|
||||
14. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
|
||||
15. an option (format: "file.section.option")
|
||||
16. a local variable in buffer
|
||||
17. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
|
||||
Format for hdata can be one of following:
|
||||
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
|
||||
hdata[list].var1.var2...: start with a hdata using a list, for example:
|
||||
|
19
po/cs.po
19
po/cs.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
|
||||
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1575,16 +1575,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
20
po/de.po
20
po/de.po
@ -24,7 +24,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-10-03 15:25+0200\n"
|
||||
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
|
||||
"Language-Team: German <kde-i18n-de@kde.org>\n"
|
||||
@ -1661,6 +1661,7 @@ msgstr "evaluierter Ausdruck"
|
||||
msgid "[-n|-s] <expression> || [-n] -c <expression1> <operator> <expression2>"
|
||||
msgstr "[-n|-s] <expression> || [-n] -c <expression1> <operator> <expression2>"
|
||||
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
" -n: display result without sending it to buffer (debug mode)\n"
|
||||
" -s: split expression before evaluating it (many commands can be "
|
||||
@ -1711,16 +1712,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/es.po
19
po/es.po
@ -22,7 +22,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
|
||||
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1606,16 +1606,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
38
po/fr.po
38
po/fr.po
@ -21,8 +21,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"PO-Revision-Date: 2019-10-05 18:02+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-10-06 08:59+0200\n"
|
||||
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: fr\n"
|
||||
@ -1680,16 +1680,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
@ -1793,17 +1794,18 @@ msgstr ""
|
||||
" 7. longueur d'une chaîne (format : \"length:xxx\" ou \"lengthscr:xxx\")\n"
|
||||
" 8. une couleur (format : \"color:xxx\", voir la \"Référence API extension"
|
||||
"\", fonction \"color\")\n"
|
||||
" 9. une info (format : \"info:nom,paramètres\", les paramètres sont "
|
||||
" 9. un modificateur (format : \"modifier:nom,données,chaîne\")\n"
|
||||
" 10. une info (format : \"info:nom,paramètres\", les paramètres sont "
|
||||
"optionnels)\n"
|
||||
" 10. la date/heure courante (format : \"date\" ou \"date:format\")\n"
|
||||
" 11. une variable d'environnement (format : \"env:XXX\")\n"
|
||||
" 12. un opérateur ternaire (format : \"if:condition?valeur_si_vrai:"
|
||||
" 11. la date/heure courante (format : \"date\" ou \"date:format\")\n"
|
||||
" 12. une variable d'environnement (format : \"env:XXX\")\n"
|
||||
" 13. un opérateur ternaire (format : \"if:condition?valeur_si_vrai:"
|
||||
"valeur_si_faux\")\n"
|
||||
" 13. le résultat d'une expression avec parenthèses et les opérateurs + - "
|
||||
" 14. le résultat d'une expression avec parenthèses et les opérateurs + - "
|
||||
"* / // % ** (format: \"calc:xxx\")\n"
|
||||
" 14. une option (format : \"fichier.section.option\")\n"
|
||||
" 15. une variable locale du tampon\n"
|
||||
" 16. un hdata/variable (la valeur est automatiquement convertie en chaîne), "
|
||||
" 15. une option (format : \"fichier.section.option\")\n"
|
||||
" 16. une variable locale du tampon\n"
|
||||
" 17. un hdata/variable (la valeur est automatiquement convertie en chaîne), "
|
||||
"par défaut \"window\" et \"buffer\" pointent vers la fenêtre et le tampon "
|
||||
"courants.\n"
|
||||
"Le format du hdata peut être le suivant :\n"
|
||||
|
19
po/hu.po
19
po/hu.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
|
||||
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1494,16 +1494,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/it.po
19
po/it.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
|
||||
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1589,16 +1589,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/ja.po
19
po/ja.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-09-22 18:54+0200\n"
|
||||
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
|
||||
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
|
||||
@ -1643,16 +1643,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/pl.po
19
po/pl.po
@ -22,7 +22,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-09-22 18:54+0200\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
|
||||
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
|
||||
@ -1678,16 +1678,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/pt.po
19
po/pt.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-09-22 18:54+0200\n"
|
||||
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
|
||||
"Language-Team: Portuguese <>\n"
|
||||
@ -1647,16 +1647,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/pt_BR.po
19
po/pt_BR.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
|
||||
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1651,16 +1651,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/ru.po
19
po/ru.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
|
||||
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1516,16 +1516,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
19
po/tr.po
19
po/tr.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
|
||||
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1347,16 +1347,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-10-05 18:01+0200\n"
|
||||
"POT-Creation-Date: 2019-10-06 08:58+0200\n"
|
||||
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
|
||||
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1349,16 +1349,17 @@ msgid ""
|
||||
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
|
||||
"\"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are optional)\n"
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
|
||||
"\")\n"
|
||||
" 13. result of an expression with parentheses and operators + - * / // % ** "
|
||||
" 14. result of an expression with parentheses and operators + - * / // % ** "
|
||||
"(format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted to "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted to "
|
||||
"string), by default \"window\" and \"buffer\" point to current window/"
|
||||
"buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
@ -7359,17 +7359,18 @@ command_init ()
|
||||
"\"lengthscr:xxx\")\n"
|
||||
" 8. a color (format: \"color:xxx\", see \"Plugin API "
|
||||
"reference\", function \"color\")\n"
|
||||
" 9. an info (format: \"info:name,arguments\", arguments are "
|
||||
" 9. a modifier (format: \"modifier:name,data,string\")\n"
|
||||
" 10. an info (format: \"info:name,arguments\", arguments are "
|
||||
"optional)\n"
|
||||
" 10. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 11. an environment variable (format: \"env:XXX\")\n"
|
||||
" 12. a ternary operator (format: "
|
||||
" 11. current date/time (format: \"date\" or \"date:format\")\n"
|
||||
" 12. an environment variable (format: \"env:XXX\")\n"
|
||||
" 13. a ternary operator (format: "
|
||||
"\"if:condition?value_if_true:value_if_false\")\n"
|
||||
" 13. result of an expression with parentheses and operators "
|
||||
" 14. result of an expression with parentheses and operators "
|
||||
"+ - * / // % ** (format: \"calc:xxx\")\n"
|
||||
" 14. an option (format: \"file.section.option\")\n"
|
||||
" 15. a local variable in buffer\n"
|
||||
" 16. a hdata name/variable (the value is automatically converted "
|
||||
" 15. an option (format: \"file.section.option\")\n"
|
||||
" 16. a local variable in buffer\n"
|
||||
" 17. a hdata name/variable (the value is automatically converted "
|
||||
"to string), by default \"window\" and \"buffer\" point to current "
|
||||
"window/buffer.\n"
|
||||
"Format for hdata can be one of following:\n"
|
||||
|
@ -301,14 +301,15 @@ end:
|
||||
* (format: lengthscr:xxx); color codes are ignored
|
||||
* 9. a regex group captured (format: re:N (0.99) or re:+)
|
||||
* 10. a color (format: color:xxx)
|
||||
* 11. an info (format: info:name,arguments)
|
||||
* 12. current date/time (format: date or date:xxx)
|
||||
* 13. an environment variable (format: env:XXX)
|
||||
* 14. a ternary operator (format: if:condition?value_if_true:value_if_false)
|
||||
* 15. calculate result of an expression (format: calc:xxx)
|
||||
* 16. an option (format: file.section.option)
|
||||
* 17. a buffer local variable
|
||||
* 18. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
|
||||
* 11. a modifier (format: modifier:name,data,xxx)
|
||||
* 12. an info (format: info:name,arguments)
|
||||
* 13. current date/time (format: date or date:xxx)
|
||||
* 14. an environment variable (format: env:XXX)
|
||||
* 15. a ternary operator (format: if:condition?value_if_true:value_if_false)
|
||||
* 16. calculate result of an expression (format: calc:xxx)
|
||||
* 17. an option (format: file.section.option)
|
||||
* 18. a buffer local variable
|
||||
* 19. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
|
||||
* or hdata[ptr].var1.var2)
|
||||
*
|
||||
* See /help in WeeChat for examples.
|
||||
@ -324,7 +325,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
char str_value[512], *value, *pos, *pos1, *pos2, *hdata_name, *list_name;
|
||||
char *tmp, *tmp2, *info_name, *hide_char, *hidden_string, *error;
|
||||
char *condition;
|
||||
char *condition, *modifier_name, *modifier_data;
|
||||
const char *ptr_value, *ptr_arguments, *ptr_string;
|
||||
struct t_hdata *hdata;
|
||||
void *pointer;
|
||||
@ -540,7 +541,31 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return strdup ((ptr_value) ? ptr_value : "");
|
||||
}
|
||||
|
||||
/* 11. info */
|
||||
/* 11. modifier */
|
||||
if (strncmp (text, "modifier:", 9) == 0)
|
||||
{
|
||||
value = NULL;
|
||||
ptr_arguments = strchr (text + 9, ',');
|
||||
if (!ptr_arguments)
|
||||
return strdup ("");
|
||||
ptr_arguments++;
|
||||
ptr_string = strchr (ptr_arguments, ',');
|
||||
if (!ptr_string)
|
||||
return strdup ("");
|
||||
ptr_string++;
|
||||
modifier_name = string_strndup (text + 9, ptr_arguments - 1 - text - 9);
|
||||
modifier_data = string_strndup (ptr_arguments,
|
||||
ptr_string - 1 - ptr_arguments);
|
||||
value = hook_modifier_exec (NULL, modifier_name, modifier_data,
|
||||
ptr_string);
|
||||
if (modifier_name)
|
||||
free (modifier_name);
|
||||
if (modifier_data)
|
||||
free (modifier_data);
|
||||
return (value) ? value : strdup ("");
|
||||
}
|
||||
|
||||
/* 12. info */
|
||||
if (strncmp (text, "info:", 5) == 0)
|
||||
{
|
||||
value = NULL;
|
||||
@ -560,7 +585,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return (value) ? value : strdup ("");
|
||||
}
|
||||
|
||||
/* 12. current date/time */
|
||||
/* 13. current date/time */
|
||||
if ((strncmp (text, "date", 4) == 0) && (!text[4] || (text[4] == ':')))
|
||||
{
|
||||
date = time (NULL);
|
||||
@ -573,7 +598,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return strdup ((rc > 0) ? str_value : "");
|
||||
}
|
||||
|
||||
/* 13. environment variable */
|
||||
/* 14. environment variable */
|
||||
if (strncmp (text, "env:", 4) == 0)
|
||||
{
|
||||
ptr_value = getenv (text + 4);
|
||||
@ -581,7 +606,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return strdup (ptr_value);
|
||||
}
|
||||
|
||||
/* 14: ternary operator: if:condition?value_if_true:value_if_false */
|
||||
/* 15: ternary operator: if:condition?value_if_true:value_if_false */
|
||||
if (strncmp (text, "if:", 3) == 0)
|
||||
{
|
||||
value = NULL;
|
||||
@ -649,7 +674,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
}
|
||||
|
||||
/*
|
||||
* 15. calculate the result of an expression
|
||||
* 16. calculate the result of an expression
|
||||
* (with number, operators and parentheses)
|
||||
*/
|
||||
if (strncmp (text, "calc:", 5) == 0)
|
||||
@ -657,7 +682,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return calc_expression (text + 5);
|
||||
}
|
||||
|
||||
/* 16. option: if found, return this value */
|
||||
/* 17. option: if found, return this value */
|
||||
if (strncmp (text, "sec.data.", 9) == 0)
|
||||
{
|
||||
ptr_value = hashtable_get (secure_hashtable_data, text + 9);
|
||||
@ -690,7 +715,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
}
|
||||
}
|
||||
|
||||
/* 17. local variable in buffer */
|
||||
/* 18. local variable in buffer */
|
||||
ptr_buffer = hashtable_get (eval_context->pointers, "buffer");
|
||||
if (ptr_buffer)
|
||||
{
|
||||
@ -699,7 +724,7 @@ eval_replace_vars_cb (void *data, const char *text)
|
||||
return strdup (ptr_value);
|
||||
}
|
||||
|
||||
/* 18. hdata */
|
||||
/* 19. hdata */
|
||||
value = NULL;
|
||||
hdata_name = NULL;
|
||||
list_name = NULL;
|
||||
|
@ -392,6 +392,20 @@ TEST(CoreEval, EvalExpression)
|
||||
WEE_CHECK_EVAL(str_value, "${color:irc.color.message_join}-test-");
|
||||
WEE_CHECK_EVAL("test", "${option.not.found}test");
|
||||
|
||||
/* test modifier */
|
||||
WEE_CHECK_EVAL("test_string", "test_${modifier:xxx,data,string}");
|
||||
WEE_CHECK_EVAL("test_no_color",
|
||||
"${modifier:color_decode_ansi,0,test_\x1B[92mno_color}");
|
||||
snprintf (str_value, sizeof (str_value),
|
||||
"test_%slightgreen",
|
||||
gui_color_get_custom ("lightgreen"));
|
||||
WEE_CHECK_EVAL(str_value,
|
||||
"${modifier:color_decode_ansi,1,test_\x1B[92mlightgreen}");
|
||||
snprintf (str_value, sizeof (str_value),
|
||||
"${modifier:color_encode_ansi,,test_%slightgreen}",
|
||||
gui_color_get_custom ("lightgreen"));
|
||||
WEE_CHECK_EVAL("test_\x1B[92mlightgreen", str_value);
|
||||
|
||||
/* test info */
|
||||
WEE_CHECK_EVAL(version_get_version (), "${info:version}");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user