diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-11 10:52:25 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-11 10:52:25 +0200 |
commit | 742773e070faa25cc2d713890745c48fe84928d6 (patch) | |
tree | b112593dbbc05d1d6dc8284efe881e3420f0b867 /doc/en | |
parent | ac646da4fb5b8a5868882ee48282ebc6d392fa5c (diff) | |
download | weechat-742773e070faa25cc2d713890745c48fe84928d6.zip |
doc/api: update chapter on hook priority
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 36379c5b1..5e09a10a4 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -8796,22 +8796,38 @@ beginning of hooks list, so it will be found and executed before other hooks. It's useful for modifiers, because execution order is important. To set a priority, you must use this syntax, for argument where priority is -allowed: "nnn|name" where "nnn" is non-negative integer with priority and "name" +allowed: `nnn|name` where `nnn` is non-negative integer with priority and `name` the name for argument (priority does not appear in name, it is automatically -removed from string). +removed from string). + +Only a single priority per hook is allowed. Default priority is 1000. -C example: +C examples: [source,c] ---- /* hook modifier with priority = 2000 */ weechat_hook_modifier ("2000|input_text_display", &modifier_cb, NULL, NULL); + +/* hook two signals with priority = 3000 */ +weechat_hook_signal ("3000|quit;upgrade", &signal_cb, NULL, NULL); ---- -Following hook types allow priority: command, command_run, signal, hsignal, -config, completion, modifier, info, info_hashtable, infolist, hdata, focus. +Following hook types allow priority: + +* <<_hook_command,command>> +* <<_hook_command_run,command_run>> +* <<_hook_signal,signal>> +* <<_hook_hsignal,hsignal>> +* <<_hook_config,config>> +* <<_hook_completion,completion>> +* <<_hook_modifier,modifier>> +* <<_hook_info,info>> +* <<_hook_info_hashtable,info_hashtable>> +* <<_hook_infolist,infolist>> +* <<_hook_hdata,hdata>> +* <<_hook_focus,focus>> ==== hook_command |