summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--doc/en/weechat_plugin_api.en.adoc7
-rw-r--r--doc/fr/weechat_plugin_api.fr.adoc8
-rw-r--r--doc/it/weechat_plugin_api.it.adoc8
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc8
-rw-r--r--src/plugins/plugin-api.c21
6 files changed, 53 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 3d9e38de1..17ad53b4e 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 679638b3e..4f2b34e08 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 b92aa678f..9f9618f60 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 450a3b44e..205295ada 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 f46da312d..04b403f96 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 770a3b7bb..12d681565 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -394,6 +394,25 @@ plugin_api_modifier_color_encode_ansi_cb (const void *pointer, void *data,
}
/*
+ * 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.
*
* Returns:
@@ -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 ();