diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 3d9e38de1ea..17ad53b4e63 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -23,6 +23,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) * 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) * irc: add options irc.color.message_kick and irc.color.reason_kick (issue #683, issue #684) * logger: add option logger.file.color_lines (issue #528, issue #621) diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 679638b3eef..4f2b34e0803 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -11381,6 +11381,13 @@ List of modifiers defined by WeeChat and plugins that can be used: - | Any string. | String with WeeChat colors converted to ANSI colors. + +| [[hook_modifier_eval_path_home]] eval_path_home + + _(WeeChat ≥ 2.7)_ | + - | + Any string. | + Evaluated path, result of the function + <<_string_eval_path_home,string_eval_path_home>>. |=== C example: diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index b92aa678ff1..9f9618f6095 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -11625,6 +11625,14 @@ utilisés : - | Toute chaîne. | Chaîne avec les couleurs WeeChat converties en couleurs ANSI. + +// TRANSLATION MISSING +| [[hook_modifier_eval_path_home]] eval_path_home + + _(WeeChat ≥ 2.7)_ | + - | + Toute chaîne. | + Chemin évalué, résultat de la fonction + <<_string_eval_path_home,string_eval_path_home>>. |=== Exemple en C : diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 450a3b44e63..205295adaca 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -11842,6 +11842,14 @@ List of modifiers defined by WeeChat and plugins that can be used: - | Any string. | String with WeeChat colors converted to ANSI colors. + +// TRANSLATION MISSING +| [[hook_modifier_eval_path_home]] eval_path_home + + _(WeeChat ≥ 2.7)_ | + - | + Any string. | + Evaluated path, result of the function + <<_string_eval_path_home,string_eval_path_home>>. |=== Esempio in C: diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index f46da312d4e..04b403f9653 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -11354,6 +11354,14 @@ WeeChat とプラグインが定義する修飾子のリスト: - | 任意の文字列 | String with WeeChat colors converted to ANSI colors. + +// TRANSLATION MISSING +| [[hook_modifier_eval_path_home]] eval_path_home + + _(WeeChat バージョン 2.7 以上で利用可)_ | + - | + Any string. | + Evaluated path, result of the function + <<_string_eval_path_home,string_eval_path_home>>. |=== C 言語での使用例: diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 770a3b7bb8f..12d6815655e 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -393,6 +393,25 @@ plugin_api_modifier_color_encode_ansi_cb (const void *pointer, void *data, return gui_color_encode_ansi (string); } +/* + * Modifier callback: evaluates a home path. + */ + +char * +plugin_api_modifier_eval_path_home_cb (const void *pointer, void *data, + const char *modifier, + const char *modifier_data, + const char *string) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) modifier; + (void) modifier_data; + + return string_eval_path_home (string, NULL, NULL, NULL); +} + /* * Moves item pointer to next item in an infolist. * @@ -544,6 +563,8 @@ plugin_api_init () &plugin_api_modifier_color_decode_ansi_cb, NULL, NULL); hook_modifier (NULL, "color_encode_ansi", &plugin_api_modifier_color_encode_ansi_cb, NULL, NULL); + hook_modifier (NULL, "eval_path_home", + &plugin_api_modifier_eval_path_home_cb, NULL, NULL); /* WeeChat core info/infolist hooks */ plugin_api_info_init ();