api: add support of pointer names in function string_eval_expression (direct and in hdata)

These two formats are now supported, if "pointer_name" is present in the
"pointers" hashtable:

* "${pointer_name}": value of pointer (example: "0x1234abcd")
* ${buffer[pointer_name].full_name}: use of a pointer name instead of pointer
  value or list name
This commit is contained in:
Sébastien Helleu 2021-03-17 21:56:07 +01:00
parent c54cadace5
commit 8ee7d46605
27 changed files with 345 additions and 224 deletions

View File

@ -22,6 +22,7 @@ New features::
* core: add options to customize commands executed on system signals received (SIGHUP, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2) (issue #1595) * core: add options to customize commands executed on system signals received (SIGHUP, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2) (issue #1595)
* core: quit WeeChat by default when signal SIGHUP is received in normal run, reload configuration in weechat-headless (issue #1595) * core: quit WeeChat by default when signal SIGHUP is received in normal run, reload configuration in weechat-headless (issue #1595)
* api: add support of pointer names in function string_eval_expression (direct and in hdata)
* api: add info "weechat_daemon" * api: add info "weechat_daemon"
Bug fixes:: Bug fixes::

View File

@ -1304,80 +1304,81 @@ infolists: zeigt Information über die Infolists an
/eval [-n|-s] [-d] <expression> /eval [-n|-s] [-d] <expression>
[-n] [-d [-d]] -c <expression1> <operator> <expression2> [-n] [-d [-d]] -c <expression1> <operator> <expression2>
-n: gibt das Ergebnis aus, ohne dass dieses in den Buffer gesendet wird (debug Modus) -n: display result without sending it to buffer (debug mode)
-s: teilt Ausdrücke, bevor sie evaluiert werden (mehrere Befehle können durch Semikolon getrennt werden) -s: split expression before evaluating it (many commands can be separated by semicolons)
-d: eine Debug-Ausgabe nach Auswertung anzeigen (Nutzung von zwei -d: ausführliche Debug-Ausgabe) -d: display debug output after evaluation (with two -d: more verbose debug)
-c: Auswertung als Bedingung: nutzt Operatoren und runde Klammern, Rückgabewert als Boolean-Wert ("0" oder "1") -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1")
expression: Ausdruck welcher verarbeitet werden soll. Variablen im Format ${variable} werden ersetzt (siehe unten); mehrere Befehle werden durch ein Semikolon voneinander getrennt expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons
operator: ein logischer oder vergleichender Operand: operator: a logical or comparison operator:
- logische Operanden: - logical operators:
&& boolean "und" && boolean "and"
|| boolean "oder" || boolean "or"
- vergleichende Operanden: - comparison operators:
== gleich == equal
!= ungleich != not equal
<= kleiner oder gleich <= less or equal
< kleiner < less
>= größer oder gleich >= greater or equal
> größer > greater
=~ stimmt mit regulärem POSIX Ausdruck überein =~ is matching POSIX extended regex
!~ stimmt NICHT mit regulärem POSIX Ausdruck überein !~ is NOT matching POSIX extended regex
==* stimmt mit Maske überein (Platzhalter "*" ist erlaubt) ==* is matching mask, case sensitive (wildcard "*" is allowed)
!!* stimmt mit Maske NICHT überein (Platzhalter "*" ist erlaubt) !!* is NOT matching mask, case sensitive (wildcard "*" is allowed)
=* stimmt mit Maske überein, Groß- und Kleinschreibung wird nicht beachtet (Platzhalter "*" ist erlaubt) =* is matching mask, case insensitive (wildcard "*" is allowed)
!* stimmt mit Maske NICHT überein, Groß- und Kleinschreibung wird nicht beachtet (Platzhalter "*" ist erlaubt) !* is NOT matching mask, case insensitive (wildcard "*" is allowed)
==- ist enthalten, Groß- und Kleinschreibung wird beachtet ==- is included, case sensitive
!!- ist NICHT enthalten, Groß- und Kleinschreibung wird beachtet !!- is NOT included, case sensitive
=- ist enthalten, Groß- und Kleinschreibung wird nicht beachtet =- is included, case insensitive
!- ist NICHT enthalten, Groß- und Kleinschreibung wird nicht beachtet !- is NOT included, case insensitive
Ein Ausdruck gilt als "wahr" sofern das Ergebnis weder NULL, nicht leer und von "0" abweichend ist. An expression is considered as "true" if it is not NULL, not empty, and different from "0".
Für einen Vergleich werden Fließkommazahlen genutzt, insofern es sich bei beiden Ausdrücken um gültige Zahlen handelt, folgende Formate werden unterstützt: The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats:
- Integer (Beispiele: 5, -7) - integer (examples: 5, -7)
- Fließkommazahl (Beispiele: 5.2, -7.5, 2.83e-2) - floating point number (examples: 5.2, -7.5, 2.83e-2)
- hexadezimale Zahl (Beispiele: 0xA3, -0xA3) - hexadecimal number (examples: 0xA3, -0xA3)
Um einen Vergleich zwischen zwei Zeichenketten zu erzwingen, müssen die Ausdrücke in Anführungszeichen gesetzt werden, zum Beispiel: To force a string comparison, you can add double quotes around each expression, for example:
50 > 100 ==> 0 50 > 100 ==> 0
"50" > "100" ==> 1 "50" > "100" ==> 1
Einige Variablen werden im Ausdruck mittels der Formatierung ${variable} ersetzt. Mögliche Variablen sind, nach Reihenfolge ihrer Priorität: Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
1. die Zeichenfolge selbst ohne Auswertung (Format: "raw:xxx")\n 1. the string itself without evaluation (format: "raw:xxx")
2. eine evaluierte Teilzeichenkette (Format: "eval:xxx") 2. an evaluated sub-string (format: "eval:xxx")
3. eine evaluierte Bedingung (Format: "eval_cond:xxx") 3. an evaluated condition (format: "eval_cond:xxx")
4. eine Zeichenkette mit Escapesequenzen (Format: "esc:xxx" oder "\xxx") 4. a string with escaped chars (format: "esc:xxx" or "\xxx")
5. Zeichen, die in einer Zeichenkette nicht dargestellt werden sollen (Format: "hide:Zeichen,Zeichenkette") 5. a string with chars to hide (format: "hide:char,string")
6. eine Zeichenkette mit einer maximalen Anzahl an Zeichen (Format: "cut:+Max,Suffix,Zeichenkette") 6. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
oder maximale Anzahl an Zeichen die auf dem Bildschirm angezeigt werden sollen (Format: "cutscr:Max,Suffix,Zeichenkette oder "cutscr:+Max,Suffix,Zeichenkette") or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
7. eine Zeichenkette umkehren (Format: "rev:xxx" oder "revscr:xxx") 7. a reversed string (format: "rev:xxx" or "revscr:xxx")
8. eine Zeichenkette wiederholen (Format: "repeat:Anzahl,Zeichenkette") 8. a repeated string (format: "repeat:count,string")
9. Länge einer Zeichenkette (Format: "length:xxx" oder "lengthscr:xxx") 9. length of a string (format: "length:xxx" or "lengthscr:xxx")
10. eine Farbe (Format: "color:xxx", siehe "Anleitung für API Erweiterung", Funktion "color") 10. a color (format: "color:xxx", see "Plugin API reference", function "color")
11. ein Modifizierer (Format: "info:Name,Argumente", Argumente sind optional) 11. a modifier (format: "modifier:name,data,string")
12. eine Info (Format: "Info:Name,Argumente", Argumente sind optional) 12. an info (format: "info:name,arguments", arguments are optional)
13. eine Basis 16/32/64 kodierte / dekodierte Zeichenfolge (Format: "base_encode:base,xxx" oder "base_decode:base,xxx") 13. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
14. aktuelles Datum/Uhrzeit (Format: "date" oder "date:format") 14. current date/time (format: "date" or "date:format")
15. eine Umgebungsvariable (Format: "env:XXX") 15. an environment variable (format: "env:XXX")
16. ein Dreifachoperand (Format: "if:Bedingung?Wert_falls_wahr:Wert_falls_unwahr") 16. a ternary operator (format: "if:condition?value_if_true:value_if_false")
17. Ergebnis eines Ausdrucks mit Klammern und Operatoren + - * / // % ** (Format: "calc:xxx") 17. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
18. eine Option (Format: "file.section.option") 18. an option (format: "file.section.option")
19. eine lokale Variable eines Buffers 19. a local variable in buffer
20. ein(e) hdata - Name/Variable (der Wert wird automatisch in eine Zeichenkette konvertiert), standardmäßig wird für "window" und "buffer" das aktuelle Fenster/Buffer verwendet. 20. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Das Format für hdata kann wie folgt aufgebaut sein: Format for hdata can be one of following:
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.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...: startet hdata mittels einer Liste, zum Beispiel: hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example:
${buffer[gui_buffers].full_name}: der vollständige Name des ersten Buffers, in der verknüpften Liste aller Buffer ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers
${plugin[weechat_plugins].name}: Name der ersten Erweiterung, in der verknüpften Liste aller Erweiterungen ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins
hdata[pointer].var1.var2...: startet hdata mittels einem Pointer, zum Beispiel: hdata[pointer].var1.var2...: start with a hdata using a pointer, for example:
${buffer[0x1234abcd].full_name}: vollständiger Name eines Buffers und des dazugehörigen Pointers (kann in triggern benutzt werden) ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
Die vorhandenen Namen für hdata und Variablen sind in der "Anleitung für API Erweiterung", Bereich "weechat_hdata_get". beschrieben ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (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 ${raw:${info:version}} ==> ${info:version} /eval -n ${raw:${info:version}} ==> ${info:version}
/eval -n ${eval_cond:${window.win_width}>100} ==> 1 /eval -n ${eval_cond:${window.win_width}>100} ==> 1
/eval -n ${info:version} ==> 0.4.3 /eval -n ${info:version} ==> 0.4.3
/eval -n ${env:HOME} ==> /home/user /eval -n ${env:HOME} ==> /home/user
/eval -n ${weechat.look.scroll_amount} ==> 3 /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} ==> 0x2549aa0
/eval -n ${window.buffer} ==> 0x2549320 /eval -n ${window.buffer} ==> 0x2549320
/eval -n ${window.buffer.full_name} ==> core.weechat /eval -n ${window.buffer.full_name} ==> core.weechat
@ -1395,7 +1396,7 @@ Beispiele (einfache Zeichenketten):
/eval -n ${base_encode:64,test} ==> dGVzdA== /eval -n ${base_encode:64,test} ==> dGVzdA==
/eval -n ${base_decode:64,dGVzdA==} ==> test /eval -n ${base_decode:64,dGVzdA==} ==> test
Beispiele (Bedingungen): Examples (conditions):
/eval -n -c ${window.buffer.number} > 2 ==> 0 /eval -n -c ${window.buffer.number} > 2 ==> 0
/eval -n -c ${window.win_width} > 100 ==> 1 /eval -n -c ${window.win_width} > 100 ==> 1
/eval -n -c (8 > 12) || (5 > 2) ==> 1 /eval -n -c (8 > 12) || (5 > 2) ==> 1

View File

@ -1364,11 +1364,12 @@ Some variables are replaced in expression, using the format ${variable}, variabl
20. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. 20. 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: 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.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: hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example:
${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers ${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 ${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: 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) ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers)
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
Examples (simple strings): Examples (simple strings):

View File

@ -2209,7 +2209,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression ==== string_eval_expression
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, _WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9 and 3.1._ 2.2, 2.3, 2.7, 2.9, 3.1 and 3.2._
Evaluate an expression and return result as a string. Evaluate an expression and return result as a string.
Special variables with format `+${variable}+` are expanded (see table below). Special variables with format `+${variable}+` are expanded (see table below).
@ -2755,11 +2755,18 @@ expanded to last):
`+${nick}+` | `+${nick}+` |
`+FlashCode+` `+FlashCode+`
| `+${pointer}+` |
Variable `pointer` from hashtable _pointers_. |
`+${my_pointer}+` |
`+0x1234abcd+`
| `+${hdata.var1.var2...}+` + | `+${hdata.var1.var2...}+` +
`+${hdata[list].var1.var2...}+` | `+${hdata[list].var1.var2...}+` |
Hdata value (pointers `window` and `buffer` are set by default with current Hdata value (pointers `window` and `buffer` are set by default with current
window/buffer). | window/buffer), `list` can be a list name (example: "gui_buffers"), a pointer
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
`+${buffer[gui_buffers].full_name}+` + `+${buffer[gui_buffers].full_name}+` +
`+${buffer[my_buffer_pointer].full_name}+` +
`+${window.buffer.number}+` | `+${window.buffer.number}+` |
`+core.weechat+` + `+core.weechat+` +
`+1+` `+1+`

View File

@ -1364,11 +1364,12 @@ Des variables sont remplacées dans l'expression, en utilisant le format ${varia
20. 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. 20. 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 : 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.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 : hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste/pointeur/nom de pointeur, par exemple :
${buffer[gui_buffers].full_name} : nom complet du premier tampon dans la liste chaînée des tampons ${buffer[gui_buffers].full_name} : nom complet du premier tampon dans la liste chaînée des tampons
${plugin[weechat_plugins].name} : nom de la première extension dans la liste chaînée des extensions ${plugin[weechat_plugins].name} : nom de la première extension dans la liste chaînée des extensions
hdata[pointeur].var1.var2... : démarrer avec un hdata en utilisant un pointeur, par exemple : hdata[pointeur].var1.var2... : démarrer avec un hdata en utilisant un pointeur, par exemple :
${buffer[0x1234abcd].full_name} : nom complet du tampon avec ce pointeur (peut être utilisé dans les triggers) ${buffer[0x1234abcd].full_name} : nom complet du tampon avec ce pointeur (peut être utilisé dans les triggers)
${buffer[my_pointer].full_name} : nom complet du tampon avec ce nom de pointeur (peut être utilisé dans les triggers)
Pour le nom du hdata et des variables, voir la "Référence API extension", fonction "weechat_hdata_get". Pour le nom du hdata et des variables, voir la "Référence API extension", fonction "weechat_hdata_get".
Exemples (chaînes simples) : Exemples (chaînes simples) :

View File

@ -2246,7 +2246,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression ==== string_eval_expression
_WeeChat ≥ 0.4.0, mis à jour dans la 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, _WeeChat ≥ 0.4.0, mis à jour dans la 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8,
2.0, 2.2, 2.3, 2.7, 2.9 et 3.1._ 2.0, 2.2, 2.3, 2.7, 2.9, 3.1 et 3.2._
Évaluer l'expression et retourner le résultat sous forme de chaîne. Évaluer l'expression et retourner le résultat sous forme de chaîne.
Les variables spéciales avec le format `+${variable}+` sont étendues (voir le Les variables spéciales avec le format `+${variable}+` sont étendues (voir le
@ -2800,11 +2800,19 @@ première étendue à la dernière) :
`+${nick}+` | `+${nick}+` |
`+FlashCode+` `+FlashCode+`
| `+${pointeur}+` |
Variable `pointeur` de la table de hachage _pointers_. |
`+${mon_pointeur}+` |
`+0x1234abcd+`
| `+${hdata.var1.var2...}+` + | `+${hdata.var1.var2...}+` +
`+${hdata[list].var1.var2...}+` | `+${hdata[list].var1.var2...}+` |
Valeur d'un hdata (les pointeurs `window` et `buffer` sont définis par défaut Valeur d'un hdata (les pointeurs `window` et `buffer` sont définis par défaut
avec la fenêtre et tampon courants). | avec la fenêtre et tampon courants), `list` peut être le nom d'une liste
(exemple : "gui_buffers"), un pointeur (exemple : "0x1234abcd") ou un nom
de pointeur (exemple : "mon_pointeur"). |
`+${buffer[gui_buffers].full_name}+` + `+${buffer[gui_buffers].full_name}+` +
`+${buffer[mon_pointeur_buffer].full_name}+` +
`+${window.buffer.number}+` | `+${window.buffer.number}+` |
`+core.weechat+` + `+core.weechat+` +
`+1+` `+1+`

View File

@ -1364,11 +1364,12 @@ Some variables are replaced in expression, using the format ${variable}, variabl
20. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. 20. 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: 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.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: hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example:
${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers ${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 ${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: 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) ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers)
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
Examples (simple strings): Examples (simple strings):

View File

@ -2306,7 +2306,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
// TRANSLATION MISSING // TRANSLATION MISSING
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, _WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9 and 3.1._ 2.2, 2.3, 2.7, 2.9, 3.1 and 3.2._
// TRANSLATION MISSING // TRANSLATION MISSING
Evaluate an expression and return result as a string. Evaluate an expression and return result as a string.
@ -2869,11 +2869,18 @@ expanded to last):
`+${nick}+` | `+${nick}+` |
`+FlashCode+` `+FlashCode+`
| `+${pointer}+` |
Variable `pointer` from hashtable _pointers_. |
`+${my_pointer}+` |
`+0x1234abcd+`
| `+${hdata.var1.var2...}+` + | `+${hdata.var1.var2...}+` +
`+${hdata[list].var1.var2...}+` | `+${hdata[list].var1.var2...}+` |
Hdata value (pointers `window` and `buffer` are set by default with current Hdata value (pointers `window` and `buffer` are set by default with current
window/buffer). | window/buffer), `list` can be a list name (example: "gui_buffers"), a pointer
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
`+${buffer[gui_buffers].full_name}+` + `+${buffer[gui_buffers].full_name}+` +
`+${buffer[my_buffer_pointer].full_name}+` +
`+${window.buffer.number}+` | `+${window.buffer.number}+` |
`+core.weechat+` + `+core.weechat+` +
`+1+` `+1+`

View File

@ -1364,11 +1364,12 @@ Some variables are replaced in expression, using the format ${variable}, variabl
20. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer. 20. 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: 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.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: hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example:
${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers ${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 ${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: 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) ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers)
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get". For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
Examples (simple strings): Examples (simple strings):

View File

@ -2226,7 +2226,7 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
// TRANSLATION MISSING // TRANSLATION MISSING
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, _WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9 and 3.1._ 2.2, 2.3, 2.7, 2.9, 3.1 and 3.2._
式を評価して文字列として返す。`+${variable}+` 式を評価して文字列として返す。`+${variable}+`
という書式で書かれた特殊変数は展開されます (以下の表を参照)。 という書式で書かれた特殊変数は展開されます (以下の表を参照)。
@ -2789,11 +2789,20 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
`+${nick}+` | `+${nick}+` |
`+FlashCode+` `+FlashCode+`
| `+${pointer}+` |
_pointers_ の変数 `pointer` の値に展開 |
`+${my_pointer}+` |
`+0x1234abcd+`
// TRANSLATION MISSING
| `+${hdata.var1.var2...}+` + | `+${hdata.var1.var2...}+` +
`+${hdata[list].var1.var2...}+` | `+${hdata[list].var1.var2...}+` |
hdata の値 (`window` と `buffer` hdata の値 (`window` と `buffer`
ポインタはデフォルトで現在のウィンドウ/バッファに設定されます) | ポインタはデフォルトで現在のウィンドウ/バッファに設定されます),
`list` can be a list name (example: "gui_buffers"), a pointer
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
`+${buffer[gui_buffers].full_name}+` + `+${buffer[gui_buffers].full_name}+` +
`+${buffer[my_buffer_pointer].full_name}+` +
`+${window.buffer.number}+` | `+${window.buffer.number}+` |
`+core.weechat+` + `+core.weechat+` +
`+1+` `+1+`

View File

@ -1303,74 +1303,75 @@ infolists: wyświetla informacje o infolistach
/eval [-n|-s] [-d] <wyrażenie> /eval [-n|-s] [-d] <wyrażenie>
[-n] [-d [-d]] -c <wyrażenie1> <operator> <wyrażenie2> [-n] [-d [-d]] -c <wyrażenie1> <operator> <wyrażenie2>
-n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania) -n: display result without sending it to buffer (debug mode)
-s: podziel wyrażenie przed przetworzeniem go (wiele komend może być oddzielonych średnikami) -s: split expression before evaluating it (many commands can be separated by semicolons)
-d: wyświetl wyjście debugowe po ewaluacji -d: display debug output after evaluation (with two -d: more verbose debug)
-c: przetwarza jako warunek: użyj operatorów i nawiasów, zwraca wartość logiczną ("0" lub "1") -c: evaluate as condition: use operators and parentheses, return a boolean value ("0" or "1")
wyrażenie: wyrażenie do przetworzenia, zmienne o formacie ${zmienna} są zastępowane (zobacz niżej); wiele komend można oddzielić średnikami expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons
operator: operator logiczny lub porównania: operator: a logical or comparison operator:
- operatory logiczne: - logical operators:
&& logiczne „i” && boolean "and"
|| logiczne „lub” || boolean "or"
- operatory porównania: - comparison operators:
== równy == equal
!= różny != not equal
<= mniejszy lub równy <= less or equal
< mniejszy < less
>= większy lub równy >= greater or equal
> większy > greater
=~ pasuje do rozszerzonego wyrażenia regularnego POSIX =~ is matching POSIX extended regex
!~ NIE pasuje do rozszerzonego wyrażenia regularnego POSIX !~ is NOT matching POSIX extended regex
==* pasuje do maski, rozróżnia wielkość znaków (dzika karta „*” dozwolona) ==* is matching mask, case sensitive (wildcard "*" is allowed)
!!* NIE pasuje do maski, rozróżnia wielkość znaków (dzika karta „*” dozwolona) !!* is NOT matching mask, case sensitive (wildcard "*" is allowed)
=* pasuje do maski, nie rozróżnia wielkość znaków (dzika karta „*” dozwolona) =* is matching mask, case insensitive (wildcard "*" is allowed)
!* NIE pasuje do maski, nie rozróżnia wielkość znaków (dzika karta „*” dozwolona) !* is NOT matching mask, case insensitive (wildcard "*" is allowed)
==- jest zawarte, rozróżnia wielkość znaków ==- is included, case sensitive
!!- NIE jest zawarte,rozróżnia wielkość znaków !!- is NOT included, case sensitive
=- jest zawarte, nie rozróżnia wielkość znaków =- is included, case insensitive
!- NIE jest zawarte, nie rozróżnia wielkość znaków !- is NOT included, case insensitive
Wyrażenie jest uznawane za „prawdziwe” jeśli nie jest NULL, nie jest puste, oraz różni się od „0”. An expression is considered as "true" if it is not NULL, not empty, and different from "0".
Porównania dokonuje się z użyciem liczb całkowitych jeśli oba wyrażenia są liczbami całkowitymi, w jednym z następujących formatów: The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats:
- liczby całkowite (przykłady: 5, -7) - integer (examples: 5, -7)
- liczby zmiennoprzecinkowe (przykłady: 5.2, -7.5, 2.83e-2) - floating point number (examples: 5.2, -7.5, 2.83e-2)
- liczby szesnastkowe (przykłady: 0xA3, -0xA3) - hexadecimal number (examples: 0xA3, -0xA3)
W celu wymuszenia porównywania ciągów, należy umieścić każde wyrażenie w cudzysłowie, na przykład: To force a string comparison, you can add double quotes around each expression, for example:
50 > 100 ==> 0 50 > 100 ==> 0
"50" > "100" ==> 1 "50" > "100" ==> 1
Niektóre zmienne w wyrażeniach są zamieniane, poprzez zastosowanie formatu ${zmienna}, według priorytetu zmienną może być: Some variables are replaced in expression, using the format ${variable}, variable can be, by order of priority:
1. nieprzetworzony ciąg (format: "raw:xxx") 1. the string itself without evaluation (format: "raw:xxx")
2. przetworzony ciąg (format: "eval:xxx") 2. an evaluated sub-string (format: "eval:xxx")
3. przetworzony warunek (format: "eval_cond:xxx") 3. an evaluated condition (format: "eval_cond:xxx")
4. ciąg z wyescapowanymi znakami (format: "esc:xxx" lub "\xxx") 4. a string with escaped chars (format: "esc:xxx" or "\xxx")
5. ciąg ze znakami do ukrycia (format: "hide:char,string") 5. a string with chars to hide (format: "hide:char,string")
6. ciąg o maksymalnej długości (format: "cut:max,suffix,string" lub "cut:+max,suffix,string") 6. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
lub maksymalna ilość znaków wyświetlanych na ekranie (format: "cutscr:max,suffix,string" lub "cutscr:+max,suffix,string") or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
7. odwrócony ciąg (format: "rev:xxx") 7. a reversed string (format: "rev:xxx" or "revscr:xxx")
8. powtórzony ciąg (format: "repeat:ilość,ciąg") 8. a repeated string (format: "repeat:count,string")
9. długość ciągu (format: "length:xxx" or "lengthscr:xxx") 9. length of a string (format: "length:xxx" or "lengthscr:xxx")
10. kolor (format "color:xxx", zobacz „Opis API wtyczek”, funkcja "color") 10. a color (format: "color:xxx", see "Plugin API reference", function "color")
11. modyfikator (format: "modifier:name,data,string") 11. a modifier (format: "modifier:name,data,string")
12. informacja (format: "info:nazwa,argumenty", argumenty są opcjonalne) 12. an info (format: "info:name,arguments", arguments are optional)
13. ciąg zakodowany/zdekodowany z base 16/32/64 (format: "base_encode:base,xxx" lub "base_decode:base,xxx") 13. a base 16/32/64 encoded/decoded string (format: "base_encode:base,xxx" or "base_decode:base,xxx")
14. obecna data/czas (format: "date" lub "date:format") 14. current date/time (format: "date" or "date:format")
15. zmienna środowiskowa (format: "env:XXX") 15. an environment variable (format: "env:XXX")
16. wyrażenie warunkowe (format: "if:condition?value_if_true:value_if_false") 16. a ternary operator (format: "if:condition?value_if_true:value_if_false")
17. wynik wyrażenia z nawiasami i operatorami + - * / // % ** (format: "calc:xxx") 17. result of an expression with parentheses and operators + - * / // % ** (format: "calc:xxx")
18. opcja (format: plik.sekcja.opcja) 18. an option (format: "file.section.option")
19. zmienna lokalna w buforze 19. a local variable in buffer
20. nazwa hdatay/zmiennej (wartość jest automatycznie konwertowana na ciąg znaków), domyślnie „window” i „buffer” wskazują na aktualne okno/bufor. 20. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format dla hdata może być jednym z poniższych: Format for hdata can be one of following:
hdata.zmienna1.zmienna2...: inicjuje hdata (wskaźnik musi być znany), następnie wypytuje zmienne jedna po drugiej (inne hdata mogą być następne) hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].zmienna1.zmienna2...: inicjuje hdata z wykorzystaniem listy, na przykład: hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer name, for example:
${buffer[gui_buffers].full_name}: pełna nazwa buforu w połączonej liście buforów ${buffer[gui_buffers].full_name}: full name of first buffer in linked list of buffers
${plugin[weechat_plugins].name}: nazwa pierwszej wtyczki w połączonej liście wtyczek ${plugin[weechat_plugins].name}: name of first plugin in linked list of plugins
hdata[wskaźnik].zmienna1.zmienna2...: zacznij z hdata używając wskaźnika, na przykład: hdata[pointer].var1.var2...: start with a hdata using a pointer, for example:
${buffer[0x1234abcd].full_name}: pełna nazwa buforu z tym wskaźnikiem (może zostać użyte w triggerach) ${buffer[0x1234abcd].full_name}: full name of the buffer with this pointer (can be used in triggers)
Nazwy hdata i zmiennych, można znaleźć w „Opisie API wtyczek”, funkcja "weechat_hdata_get". ${buffer[my_pointer].full_name}: full name of the buffer with this pointer name (can be used in triggers)
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
Przykłady (proste ciągi): Examples (simple strings):
/eval -n ${raw:${info:version}} ==> ${info:version} /eval -n ${raw:${info:version}} ==> ${info:version}
/eval -n ${eval_cond:${window.win_width}>100} ==> 1 /eval -n ${eval_cond:${window.win_width}>100} ==> 1
/eval -n ${info:version} ==> 0.4.3 /eval -n ${info:version} ==> 0.4.3
@ -1394,7 +1395,7 @@ Przykłady (proste ciągi):
/eval -n ${base_encode:64,test} ==> dGVzdA== /eval -n ${base_encode:64,test} ==> dGVzdA==
/eval -n ${base_decode:64,dGVzdA==} ==> test /eval -n ${base_decode:64,dGVzdA==} ==> test
Przykłady (warunki): Examples (conditions):
/eval -n -c ${window.buffer.number} > 2 ==> 0 /eval -n -c ${window.buffer.number} > 2 ==> 0
/eval -n -c ${window.win_width} > 100 ==> 1 /eval -n -c ${window.win_width} > 100 ==> 1
/eval -n -c (8 > 12) || (5 > 2) ==> 1 /eval -n -c (8 > 12) || (5 > 2) ==> 1

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1636,7 +1636,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1645,6 +1646,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -24,7 +24,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:56+0100\n"
"PO-Revision-Date: 2021-03-17 14:14+0100\n" "PO-Revision-Date: 2021-03-17 14:14+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n" "Language-Team: German <kde-i18n-de@kde.org>\n"
@ -1698,6 +1698,7 @@ msgstr ""
"[-n|-s] [-d] <expression> || [-n] [-d [-d]] -c <expression1> <operator> " "[-n|-s] [-d] <expression> || [-n] [-d [-d]] -c <expression1> <operator> "
"<expression2>" "<expression2>"
#, fuzzy
msgid "" msgid ""
" -n: display result without sending it to buffer (debug mode)\n" " -n: display result without sending it to buffer (debug mode)\n"
" -s: split expression before evaluating it (many commands can be " " -s: split expression before evaluating it (many commands can be "
@ -1780,7 +1781,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1789,6 +1791,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1666,7 +1666,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1675,6 +1676,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-03-16 18:32+0100\n" "PO-Revision-Date: 2021-03-17 21:47+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n" "Language: fr\n"
@ -1754,7 +1754,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1763,6 +1764,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"
@ -1889,8 +1892,8 @@ msgstr ""
" hdata.var1.var2... : démarrer avec un hdata (le pointeur doit être connu), " " 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 " "et demander les variables l'une après l'autre (d'autres hdata peuvent être "
"suivis)\n" "suivis)\n"
" hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste, " " hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste/"
"par exemple :\n" "pointeur/nom de pointeur, par exemple :\n"
" ${buffer[gui_buffers].full_name} : nom complet du premier tampon dans la " " ${buffer[gui_buffers].full_name} : nom complet du premier tampon dans la "
"liste chaînée des tampons\n" "liste chaînée des tampons\n"
" ${plugin[weechat_plugins].name} : nom de la première extension dans la " " ${plugin[weechat_plugins].name} : nom de la première extension dans la "
@ -1899,6 +1902,8 @@ msgstr ""
"pointeur, par exemple :\n" "pointeur, par exemple :\n"
" ${buffer[0x1234abcd].full_name} : nom complet du tampon avec ce pointeur " " ${buffer[0x1234abcd].full_name} : nom complet du tampon avec ce pointeur "
"(peut être utilisé dans les triggers)\n" "(peut être utilisé dans les triggers)\n"
" ${buffer[my_pointer].full_name} : nom complet du tampon avec ce nom de "
"pointeur (peut être utilisé dans les triggers)\n"
"Pour le nom du hdata et des variables, voir la \"Référence API extension\", " "Pour le nom du hdata et des variables, voir la \"Référence API extension\", "
"fonction \"weechat_hdata_get\".\n" "fonction \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1554,7 +1554,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1563,6 +1564,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1649,7 +1649,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1658,6 +1659,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@ -1706,7 +1706,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1715,6 +1716,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-03-14 13:37+0100\n" "PO-Revision-Date: 2021-03-14 13:37+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@ -1665,6 +1665,7 @@ msgstr ""
"[-n|-s] [-d] <wyrażenie> || [-n] [-d [-d]] -c <wyrażenie1> <operator> " "[-n|-s] [-d] <wyrażenie> || [-n] [-d [-d]] -c <wyrażenie1> <operator> "
"<wyrażenie2>" "<wyrażenie2>"
#, fuzzy
msgid "" msgid ""
" -n: display result without sending it to buffer (debug mode)\n" " -n: display result without sending it to buffer (debug mode)\n"
" -s: split expression before evaluating it (many commands can be " " -s: split expression before evaluating it (many commands can be "
@ -1747,7 +1748,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1756,6 +1758,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n" "Language-Team: Portuguese <>\n"
@ -1708,7 +1708,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1717,6 +1718,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-03-05 20:43+0100\n" "PO-Revision-Date: 2021-03-05 20:43+0100\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1712,7 +1712,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1721,6 +1722,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1576,7 +1576,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1585,6 +1586,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2021-02-06 15:55+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1407,7 +1407,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1416,6 +1417,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat\n" "Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-03-16 18:31+0100\n" "POT-Creation-Date: 2021-03-17 21:46+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1409,7 +1409,8 @@ msgid ""
"Format for hdata can be one of following:\n" "Format for hdata can be one of following:\n"
" hdata.var1.var2...: start with a hdata (pointer must be known), and ask " " hdata.var1.var2...: start with a hdata (pointer must be known), and ask "
"variables one after one (other hdata can be followed)\n" "variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a list, for example:\n" " hdata[list].var1.var2...: start with a hdata using a list/pointer/pointer "
"name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer in linked " " ${buffer[gui_buffers].full_name}: full name of first buffer in linked "
"list of buffers\n" "list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in linked list of " " ${plugin[weechat_plugins].name}: name of first plugin in linked list of "
@ -1418,6 +1419,8 @@ msgid ""
"example:\n" "example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer with this " " ${buffer[0x1234abcd].full_name}: full name of the buffer with this "
"pointer (can be used in triggers)\n" "pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer with this "
"pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API reference\", " "For name of hdata and variables, please look at \"Plugin API reference\", "
"function \"weechat_hdata_get\".\n" "function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -7579,7 +7579,7 @@ command_init ()
" hdata.var1.var2...: start with a hdata (pointer must be known), " " hdata.var1.var2...: start with a hdata (pointer must be known), "
"and ask variables one after one (other hdata can be followed)\n" "and ask variables one after one (other hdata can be followed)\n"
" hdata[list].var1.var2...: start with a hdata using a " " hdata[list].var1.var2...: start with a hdata using a "
"list, for example:\n" "list/pointer/pointer name, for example:\n"
" ${buffer[gui_buffers].full_name}: full name of first buffer " " ${buffer[gui_buffers].full_name}: full name of first buffer "
"in linked list of buffers\n" "in linked list of buffers\n"
" ${plugin[weechat_plugins].name}: name of first plugin in " " ${plugin[weechat_plugins].name}: name of first plugin in "
@ -7588,6 +7588,8 @@ command_init ()
"pointer, for example:\n" "pointer, for example:\n"
" ${buffer[0x1234abcd].full_name}: full name of the buffer " " ${buffer[0x1234abcd].full_name}: full name of the buffer "
"with this pointer (can be used in triggers)\n" "with this pointer (can be used in triggers)\n"
" ${buffer[my_pointer].full_name}: full name of the buffer "
"with this pointer name (can be used in triggers)\n"
"For name of hdata and variables, please look at \"Plugin API " "For name of hdata and variables, please look at \"Plugin API "
"reference\", function \"weechat_hdata_get\".\n" "reference\", function \"weechat_hdata_get\".\n"
"\n" "\n"

View File

@ -744,7 +744,9 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path,
struct t_hashtable *hashtable; struct t_hashtable *hashtable;
EVAL_DEBUG_MSG(1, "eval_hdata_get_value(\"%s\", 0x%lx, \"%s\")", EVAL_DEBUG_MSG(1, "eval_hdata_get_value(\"%s\", 0x%lx, \"%s\")",
hdata->name, pointer, path); (hdata) ? hdata->name : "(null)",
pointer,
path);
value = NULL; value = NULL;
var_name = NULL; var_name = NULL;
@ -765,6 +767,9 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path,
goto end; goto end;
} }
if (!hdata)
goto end;
/* /*
* look for name of hdata, for example in "window.buffer.full_name", the * look for name of hdata, for example in "window.buffer.full_name", the
* hdata name is "window" * hdata name is "window"
@ -903,8 +908,8 @@ end:
char * char *
eval_string_hdata (const char *text, struct t_eval_context *eval_context) eval_string_hdata (const char *text, struct t_eval_context *eval_context)
{ {
const char *pos, *pos1, *pos2; const char *pos_vars, *pos1, *pos2;
char *value, *hdata_name, *list_name, *tmp; char *value, *hdata_name, *pointer_name, *tmp;
void *pointer; void *pointer;
struct t_hdata *hdata; struct t_hdata *hdata;
int rc; int rc;
@ -912,14 +917,16 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
value = NULL; value = NULL;
hdata_name = NULL; hdata_name = NULL;
list_name = NULL; pointer_name = NULL;
pointer = NULL; pointer = NULL;
pos = strchr (text, '.'); pos_vars = strchr (text, '.');
if (pos > text) if (pos_vars > text)
hdata_name = string_strndup (text, pos - text); hdata_name = string_strndup (text, pos_vars - text);
else else
hdata_name = strdup (text); hdata_name = strdup (text);
if (pos_vars)
pos_vars++;
if (!hdata_name) if (!hdata_name)
goto end; goto end;
@ -928,9 +935,12 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
if (pos1 > hdata_name) if (pos1 > hdata_name)
{ {
pos2 = strchr (pos1 + 1, ']'); pos2 = strchr (pos1 + 1, ']');
if (pos2 > pos1 + 1) if (pos2)
{ {
list_name = string_strndup (pos1 + 1, pos2 - pos1 - 1); if (pos2 > pos1 + 1)
pointer_name = string_strndup (pos1 + 1, pos2 - pos1 - 1);
else
goto end;
} }
tmp = string_strndup (hdata_name, pos1 - hdata_name); tmp = string_strndup (hdata_name, pos1 - hdata_name);
if (tmp) if (tmp)
@ -942,13 +952,20 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
hdata = hook_hdata_get (NULL, hdata_name); hdata = hook_hdata_get (NULL, hdata_name);
if (!hdata) if (!hdata)
{
if (pos_vars || pointer_name)
goto end; goto end;
/* case of a single pointer which is not hdata, eg: ${my_pointer} */
pointer = hashtable_get (eval_context->pointers, hdata_name);
value = eval_hdata_get_value (NULL, pointer, pos_vars, eval_context);
goto end;
}
if (list_name) if (pointer_name)
{ {
if (strncmp (list_name, "0x", 2) == 0) if (strncmp (pointer_name, "0x", 2) == 0)
{ {
rc = sscanf (list_name, "%lx", &ptr); rc = sscanf (pointer_name, "%lx", &ptr);
if ((rc != EOF) && (rc != 0)) if ((rc != EOF) && (rc != 0))
{ {
pointer = (void *)ptr; pointer = (void *)ptr;
@ -959,7 +976,17 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
goto end; goto end;
} }
else else
pointer = hdata_get_list (hdata, list_name); {
pointer = hdata_get_list (hdata, pointer_name);
if (!pointer)
{
pointer = hashtable_get (eval_context->pointers, pointer_name);
if (!pointer)
goto end;
if (!hdata_check_pointer (hdata, NULL, pointer))
goto end;
}
}
} }
if (!pointer) if (!pointer)
@ -967,18 +994,17 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
pointer = hashtable_get (eval_context->pointers, hdata_name); pointer = hashtable_get (eval_context->pointers, hdata_name);
if (!pointer) if (!pointer)
goto end; goto end;
if (!hdata_check_pointer (hdata, NULL, pointer))
goto end;
} }
value = eval_hdata_get_value (hdata, value = eval_hdata_get_value (hdata, pointer, pos_vars, eval_context);
pointer,
(pos) ? pos + 1 : NULL,
eval_context);
end: end:
if (hdata_name) if (hdata_name)
free (hdata_name); free (hdata_name);
if (list_name) if (pointer_name)
free (list_name); free (pointer_name);
return (value) ? value : strdup (""); return (value) ? value : strdup ("");
} }
@ -1012,7 +1038,7 @@ end:
* 20. an option (format: file.section.option) * 20. an option (format: file.section.option)
* 21. a buffer local variable * 21. a buffer local variable
* 22. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2 * 22. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
* or hdata[ptr].var1.var2) * or hdata[ptr].var1.var2 or hdata[ptr_name].var1.var2)
* *
* See /help in WeeChat for examples. * See /help in WeeChat for examples.
* *

View File

@ -443,7 +443,11 @@ TEST(CoreEval, EvalExpression)
char *value, str_value[256]; char *value, str_value[256];
const char *ptr_debug_output; const char *ptr_debug_output;
pointers = NULL; pointers = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
NULL, NULL);
CHECK(pointers);
extra_vars = hashtable_new (32, extra_vars = hashtable_new (32,
WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING,
@ -452,7 +456,11 @@ TEST(CoreEval, EvalExpression)
CHECK(extra_vars); CHECK(extra_vars);
hashtable_set (extra_vars, "test", "value"); hashtable_set (extra_vars, "test", "value");
options = NULL; options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
CHECK(options);
POINTERS_EQUAL(NULL, eval_expression (NULL, NULL, NULL, NULL)); POINTERS_EQUAL(NULL, eval_expression (NULL, NULL, NULL, NULL));
@ -728,6 +736,9 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("weechat", "${name}"); WEE_CHECK_EVAL("weechat", "${name}");
/* test hdata */ /* test hdata */
hashtable_set (pointers, "my_null_pointer", (const void *)0x0);
hashtable_set (pointers, "my_buffer_pointer", gui_buffers);
hashtable_set (pointers, "my_other_pointer", (const void *)0x1234abcd);
WEE_CHECK_EVAL("x", "x${buffer.number"); WEE_CHECK_EVAL("x", "x${buffer.number");
WEE_CHECK_EVAL("x${buffer.number}1", WEE_CHECK_EVAL("x${buffer.number}1",
"x\\${buffer.number}${buffer.number}"); "x\\${buffer.number}${buffer.number}");
@ -735,7 +746,20 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("1", "${window.buffer.number}"); WEE_CHECK_EVAL("1", "${window.buffer.number}");
WEE_CHECK_EVAL("core.weechat", "${buffer.full_name}"); WEE_CHECK_EVAL("core.weechat", "${buffer.full_name}");
WEE_CHECK_EVAL("core.weechat", "${window.buffer.full_name}"); WEE_CHECK_EVAL("core.weechat", "${window.buffer.full_name}");
WEE_CHECK_EVAL("", "${buffer[].full_name}");
WEE_CHECK_EVAL("", "${buffer[0x0].full_name}"); WEE_CHECK_EVAL("", "${buffer[0x0].full_name}");
WEE_CHECK_EVAL("", "${buffer[0x1].full_name}");
WEE_CHECK_EVAL("", "${buffer[unknown_list].full_name}");
WEE_CHECK_EVAL("", "${unknown_pointer}");
WEE_CHECK_EVAL("", "${my_null_pointer}");
snprintf (str_value, sizeof (str_value),
"0x%lx", (long unsigned int)gui_buffers);
WEE_CHECK_EVAL(str_value, "${my_buffer_pointer}");
WEE_CHECK_EVAL("0x1234abcd", "${my_other_pointer}");
WEE_CHECK_EVAL("", "${buffer[unknown_pointer].full_name}");
WEE_CHECK_EVAL("", "${buffer[my_null_pointer].full_name}");
WEE_CHECK_EVAL("core.weechat", "${buffer[my_buffer_pointer].full_name}");
WEE_CHECK_EVAL("", "${buffer[my_other_pointer].full_name}");
WEE_CHECK_EVAL("core.weechat", "${buffer[gui_buffers].full_name}"); WEE_CHECK_EVAL("core.weechat", "${buffer[gui_buffers].full_name}");
snprintf (str_value, sizeof (str_value), snprintf (str_value, sizeof (str_value),
"${buffer[0x%lx].full_name}", (long unsigned int)gui_buffers); "${buffer[0x%lx].full_name}", (long unsigned int)gui_buffers);
@ -754,13 +778,9 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL(str_value, "${window.buffer.local_variables}"); WEE_CHECK_EVAL(str_value, "${window.buffer.local_variables}");
WEE_CHECK_EVAL("core", "${window.buffer.local_variables.plugin}"); WEE_CHECK_EVAL("core", "${window.buffer.local_variables.plugin}");
WEE_CHECK_EVAL("weechat", "${window.buffer.local_variables.name}"); WEE_CHECK_EVAL("weechat", "${window.buffer.local_variables.name}");
hashtable_remove_all (pointers);
/* test with another prefix/suffix */ /* test with another prefix/suffix */
options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
CHECK(options);
hashtable_set (options, "prefix", "<<<"); hashtable_set (options, "prefix", "<<<");
WEE_CHECK_EVAL("${info:version}", "${info:version}"); WEE_CHECK_EVAL("${info:version}", "${info:version}");
WEE_CHECK_EVAL("<info:version}", "<info:version}"); WEE_CHECK_EVAL("<info:version}", "<info:version}");
@ -773,14 +793,9 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("<<info:version>>", "<<info:version>>"); WEE_CHECK_EVAL("<<info:version>>", "<<info:version>>");
WEE_CHECK_EVAL(version_get_version (), "<<<info:version>>>"); WEE_CHECK_EVAL(version_get_version (), "<<<info:version>>>");
WEE_CHECK_EVAL("1", "<<<buffer.number>>>"); WEE_CHECK_EVAL("1", "<<<buffer.number>>>");
hashtable_free (options); hashtable_remove_all (options);
/* test with debug level 1 */ /* test with debug level 1 */
options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
CHECK(options);
hashtable_set (options, "debug", "1"); hashtable_set (options, "debug", "1");
WEE_CHECK_EVAL("fedcba", "${rev:abcdef}"); WEE_CHECK_EVAL("fedcba", "${rev:abcdef}");
ptr_debug_output = (const char *)hashtable_get (options, "debug_output"); ptr_debug_output = (const char *)hashtable_get (options, "debug_output");
@ -791,14 +806,9 @@ TEST(CoreEval, EvalExpression)
" 2:== \"fedcba\"\n" " 2:== \"fedcba\"\n"
"1:== \"fedcba\"", "1:== \"fedcba\"",
ptr_debug_output); ptr_debug_output);
hashtable_free (options); hashtable_remove_all (options);
/* test with debug level 2 */ /* test with debug level 2 */
options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
CHECK(options);
hashtable_set (options, "debug", "2"); hashtable_set (options, "debug", "2");
WEE_CHECK_EVAL("fedcba", "${rev:abcdef}"); WEE_CHECK_EVAL("fedcba", "${rev:abcdef}");
ptr_debug_output = (const char *)hashtable_get (options, "debug_output"); ptr_debug_output = (const char *)hashtable_get (options, "debug_output");
@ -809,9 +819,11 @@ TEST(CoreEval, EvalExpression)
" 2:== \"fedcba\"\n" " 2:== \"fedcba\"\n"
"1:== \"fedcba\"", "1:== \"fedcba\"",
ptr_debug_output); ptr_debug_output);
hashtable_free (options); hashtable_remove_all (options);
hashtable_free (pointers);
hashtable_free (extra_vars); hashtable_free (extra_vars);
hashtable_free (options);
} }
/* /*