summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-14 09:41:14 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-28 15:13:40 +0100
commitd71c3b0f21bdf68534a0f36543e0fcf3454a30da (patch)
tree8de416bd23f68ce1560cfe5f6cffa95551c003a6 /doc
parentf72435d765634b585f6b7ed62b5f4a3b3dcb6cf2 (diff)
downloadweechat-d71c3b0f21bdf68534a0f36543e0fcf3454a30da.zip
doc/api: add priority in function config_new (issue #1872)
Diffstat (limited to 'doc')
-rw-r--r--doc/de/includes/autogen_api_config_priority.de.adoc36
-rw-r--r--doc/de/includes/autogen_api_hdata.de.adoc1
-rw-r--r--doc/de/includes/autogen_api_plugins_priority.de.adoc48
-rw-r--r--doc/docgen.py45
-rw-r--r--doc/en/includes/autogen_api_config_priority.en.adoc36
-rw-r--r--doc/en/includes/autogen_api_hdata.en.adoc1
-rw-r--r--doc/en/includes/autogen_api_plugins_priority.en.adoc48
-rw-r--r--doc/en/weechat_plugin_api.en.adoc12
-rw-r--r--doc/fr/includes/autogen_api_config_priority.fr.adoc36
-rw-r--r--doc/fr/includes/autogen_api_hdata.fr.adoc1
-rw-r--r--doc/fr/includes/autogen_api_plugins_priority.fr.adoc48
-rw-r--r--doc/fr/weechat_plugin_api.fr.adoc13
-rw-r--r--doc/it/includes/autogen_api_config_priority.it.adoc36
-rw-r--r--doc/it/includes/autogen_api_hdata.it.adoc1
-rw-r--r--doc/it/includes/autogen_api_plugins_priority.it.adoc48
-rw-r--r--doc/it/weechat_plugin_api.it.adoc14
-rw-r--r--doc/ja/includes/autogen_api_config_priority.ja.adoc36
-rw-r--r--doc/ja/includes/autogen_api_hdata.ja.adoc1
-rw-r--r--doc/ja/includes/autogen_api_plugins_priority.ja.adoc48
-rw-r--r--doc/ja/weechat_plugin_api.ja.adoc14
-rw-r--r--doc/pl/includes/autogen_api_config_priority.pl.adoc36
-rw-r--r--doc/pl/includes/autogen_api_hdata.pl.adoc1
-rw-r--r--doc/pl/includes/autogen_api_plugins_priority.pl.adoc48
-rw-r--r--doc/sr/includes/autogen_api_config_priority.sr.adoc36
-rw-r--r--doc/sr/includes/autogen_api_hdata.sr.adoc1
-rw-r--r--doc/sr/includes/autogen_api_plugins_priority.sr.adoc48
-rw-r--r--doc/sr/weechat_plugin_api.sr.adoc14
27 files changed, 540 insertions, 167 deletions
diff --git a/doc/de/includes/autogen_api_config_priority.de.adoc b/doc/de/includes/autogen_api_config_priority.de.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/de/includes/autogen_api_config_priority.de.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/de/includes/autogen_api_hdata.de.adoc b/doc/de/includes/autogen_api_hdata.de.adoc
index 9009a216e..45bf965ff 100644
--- a/doc/de/includes/autogen_api_hdata.de.adoc
+++ b/doc/de/includes/autogen_api_hdata.de.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/de/includes/autogen_api_plugins_priority.de.adoc b/doc/de/includes/autogen_api_plugins_priority.de.adoc
index 472c3d1c0..d68be76df 100644
--- a/doc/de/includes/autogen_api_plugins_priority.de.adoc
+++ b/doc/de/includes/autogen_api_plugins_priority.de.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Erweiterung | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/docgen.py b/doc/docgen.py
index 436d8b90a..8d2eaa648 100644
--- a/doc/docgen.py
+++ b/doc/docgen.py
@@ -29,7 +29,8 @@ Documentation generator for WeeChat: build include files with:
- hdata
- completions
- URL options
-- plugins priority.
+- plugins priority
+- config files priority.
Instructions to build config files yourself in WeeChat directories
(replace "path" with the path to the docgen.py script in WeeChat repository):
@@ -452,6 +453,25 @@ class WeechatDoc(): # pylint: disable=too-few-public-methods
weechat.infolist_free(infolist)
return plugins_priority
+ @staticmethod
+ def _read_api_config_priority():
+ """
+ Get priority of default configuration files as a dictionary.
+ """
+ config_priority = {}
+ ptr_hdata = weechat.hdata_get('config_file')
+ ptr_config = weechat.hdata_get_list(ptr_hdata, 'config_files')
+ while ptr_config:
+ name = weechat.hdata_string(ptr_hdata, ptr_config, 'name')
+ config_name = f'{name}.conf'
+ priority = weechat.hdata_integer(ptr_hdata, ptr_config, 'priority')
+ if priority in config_priority:
+ config_priority[priority].append(config_name)
+ else:
+ config_priority[priority] = [config_name]
+ ptr_config = weechat.hdata_move(ptr_hdata, ptr_config, 1)
+ return config_priority
+
class AutogenDoc():
"""A class to write auto-generated doc files."""
@@ -805,11 +825,30 @@ class AutogenDoc():
"""Write plugins priority."""
self.write()
self.write('// tag::plugins_priority[]')
- for priority in sorted(plugins_priority, reverse=True):
+ self.write('[width="30%",cols="1,3,2",options="header"]')
+ self.write('|===')
+ self.write('| %s | %s | %s',
+ _('Rank'), _('Plugin'), _('Priority'))
+ for i, priority in enumerate(sorted(plugins_priority, reverse=True)):
plugins = ', '.join(sorted(plugins_priority[priority]))
- self.write('. %s (%s)', escape(plugins), priority)
+ self.write('| %d | %s | %d', i + 1, escape(plugins), priority)
+ self.write('|===')
self.write('// end::plugins_priority[]')
+ def _write_api_config_priority(self, config_priority):
+ """Write configuration files priority."""
+ self.write()
+ self.write('// tag::config_priority[]')
+ self.write('[width="30%",cols="1,3,2",options="header"]')
+ self.write('|===')
+ self.write('| %s | %s | %s',
+ _('Rank'), _('File'), _('Priority'))
+ for i, priority in enumerate(sorted(config_priority, reverse=True)):
+ configs = ', '.join(sorted(config_priority[priority]))
+ self.write('| %d | %s | %d', i + 1, escape(configs), priority)
+ self.write('|===')
+ self.write('// end::config_priority[]')
+
def docgen_cmd_cb(data, buf, args):
"""Callback for /docgen command."""
diff --git a/doc/en/includes/autogen_api_config_priority.en.adoc b/doc/en/includes/autogen_api_config_priority.en.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/en/includes/autogen_api_config_priority.en.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/en/includes/autogen_api_hdata.en.adoc b/doc/en/includes/autogen_api_hdata.en.adoc
index 1e2ca8f76..ccfda5f8f 100644
--- a/doc/en/includes/autogen_api_hdata.en.adoc
+++ b/doc/en/includes/autogen_api_hdata.en.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/en/includes/autogen_api_plugins_priority.en.adoc b/doc/en/includes/autogen_api_plugins_priority.en.adoc
index 472c3d1c0..8a24ab563 100644
--- a/doc/en/includes/autogen_api_plugins_priority.en.adoc
+++ b/doc/en/includes/autogen_api_plugins_priority.en.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Plugin | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 95d00a573..d8c23f836 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -6263,7 +6263,7 @@ Functions for configuration files.
==== config_new
-_Updated in 1.5._
+_Updated in 1.5, 3.9._
Create a new configuration file.
@@ -6281,7 +6281,11 @@ struct t_config_file *weechat_config_new (const char *name,
Arguments:
-* _name_: name of configuration file (without path or extension)
+* _name_: name of configuration file (without path or extension); a priority
+ is allowed before the name, with format `nnn|name` where `nnn` is non-negative
+ integer with priority; default priority is 1000; files are sorted by priority
+ from higher to lower when running command `/reload`
+ (see priority of configuration files below)
* _callback_reload_: function called when configuration file is reloaded with
`/reload` (optional, can be NULL, see below), arguments and return value:
** _const void *pointer_: pointer
@@ -6317,6 +6321,10 @@ You should call this function only after adding some sections (with
<<_config_new_section,config_new_section>>) and options (with
<<_config_new_option,config_new_option>>).
+Priority of default configuration files:
+
+include::includes/autogen_api_config_priority.en.adoc[tag=config_priority]
+
C example:
[source,c]
diff --git a/doc/fr/includes/autogen_api_config_priority.fr.adoc b/doc/fr/includes/autogen_api_config_priority.fr.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/fr/includes/autogen_api_config_priority.fr.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/fr/includes/autogen_api_hdata.fr.adoc b/doc/fr/includes/autogen_api_hdata.fr.adoc
index 760fcd44b..2984c6125 100644
--- a/doc/fr/includes/autogen_api_hdata.fr.adoc
+++ b/doc/fr/includes/autogen_api_hdata.fr.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/fr/includes/autogen_api_plugins_priority.fr.adoc b/doc/fr/includes/autogen_api_plugins_priority.fr.adoc
index 472c3d1c0..d9f7a7de8 100644
--- a/doc/fr/includes/autogen_api_plugins_priority.fr.adoc
+++ b/doc/fr/includes/autogen_api_plugins_priority.fr.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Extension | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc
index 1950ce2c9..33feac522 100644
--- a/doc/fr/weechat_plugin_api.fr.adoc
+++ b/doc/fr/weechat_plugin_api.fr.adoc
@@ -6360,7 +6360,7 @@ Fonctions pour les fichiers de configuration.
==== config_new
-_Mis à jour dans la 1.5._
+_Mis à jour dans la 1.5, 3.9._
Créer un nouveau fichier de configuration.
@@ -6378,7 +6378,12 @@ struct t_config_file *weechat_config_new (const char *name,
Paramètres :
-* _name_ : nom du nouveau fichier de configuration (sans chemin ou extension)
+* _name_ : nom du nouveau fichier de configuration (sans chemin ou extension) ;
+ une priorité est autorisée avant le nom, avec le format `nnn|nom` où `nnn` est
+ un entier positif avec la priorité ; la priorité par défaut est 1000 ; les
+ fichiers de configuration sont triés par priorité de la plus haute à la plus
+ basse lorsque la commande `/reload` est exécutée
+ (voir la priorité des fichiers de configuration ci-dessous)
* _callback_reload_ : fonction appelée quand le fichier de configuration est
rechargé avec `/reload` (optionnel, peut être NULL, voir ci-dessous),
paramètres et valeur de retour :
@@ -6419,6 +6424,10 @@ Vous ne devriez appeler cette fonction qu'après avoir créé les sections (avec
<<_config_new_section,config_new_section>>) et les options (avec
<<_config_new_option,config_new_option>>).
+Priorité des fichiers de configuration par défaut :
+
+include::includes/autogen_api_config_priority.fr.adoc[tag=config_priority]
+
Exemple en C :
[source,c]
diff --git a/doc/it/includes/autogen_api_config_priority.it.adoc b/doc/it/includes/autogen_api_config_priority.it.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/it/includes/autogen_api_config_priority.it.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/it/includes/autogen_api_hdata.it.adoc b/doc/it/includes/autogen_api_hdata.it.adoc
index db60be209..9ce568074 100644
--- a/doc/it/includes/autogen_api_hdata.it.adoc
+++ b/doc/it/includes/autogen_api_hdata.it.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/it/includes/autogen_api_plugins_priority.it.adoc b/doc/it/includes/autogen_api_plugins_priority.it.adoc
index 472c3d1c0..8a24ab563 100644
--- a/doc/it/includes/autogen_api_plugins_priority.it.adoc
+++ b/doc/it/includes/autogen_api_plugins_priority.it.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Plugin | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc
index 1a85e1efc..ae329ed0b 100644
--- a/doc/it/weechat_plugin_api.it.adoc
+++ b/doc/it/weechat_plugin_api.it.adoc
@@ -6531,7 +6531,7 @@ Funzioni per i file di configurazione.
==== config_new
// TRANSLATION MISSING
-_Updated in 1.5._
+_Updated in 1.5, 3.9._
Crea un nuovo file di configurazione.
@@ -6549,7 +6549,12 @@ struct t_config_file *weechat_config_new (const char *name,
Argomenti:
-* _name_: nome del file di configurazione (senza percorso o estensione)
+// TRANSLATION MISSING
+* _name_: nome del file di configurazione (senza percorso o estensione); a priority
+ is allowed before the name, with format `nnn|name` where `nnn` is non-negative
+ integer with priority; default priority is 1000; files are sorted by priority
+ from higher to lower when running command `/reload`
+ (see priority of configuration files below)
// TRANSLATION MISSING
* _callback_reload_: funzione chiamata quando il file di configurazione viene
ricaricato con `/reload` (opzionale, può essere NULL, see below), argomenti e valore
@@ -6590,6 +6595,11 @@ Si dovrebbe chiamare questa funzione solo dopo aver aggiunto alcune sezioni
(con <<_config_new_section,config_new_section>>) e le
opzioni (con <<_config_new_option,config_new_option>>).
+// TRANSLATION MISSING
+Priority of default configuration files:
+
+include::includes/autogen_api_config_priority.it.adoc[tag=config_priority]
+
Esempio in C:
[source,c]
diff --git a/doc/ja/includes/autogen_api_config_priority.ja.adoc b/doc/ja/includes/autogen_api_config_priority.ja.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/ja/includes/autogen_api_config_priority.ja.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/ja/includes/autogen_api_hdata.ja.adoc b/doc/ja/includes/autogen_api_hdata.ja.adoc
index 366ff051a..36888d1f5 100644
--- a/doc/ja/includes/autogen_api_hdata.ja.adoc
+++ b/doc/ja/includes/autogen_api_hdata.ja.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/ja/includes/autogen_api_plugins_priority.ja.adoc b/doc/ja/includes/autogen_api_plugins_priority.ja.adoc
index 472c3d1c0..405f5fa99 100644
--- a/doc/ja/includes/autogen_api_plugins_priority.ja.adoc
+++ b/doc/ja/includes/autogen_api_plugins_priority.ja.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | プラグイン | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc
index 393cad643..ae170ce8b 100644
--- a/doc/ja/weechat_plugin_api.ja.adoc
+++ b/doc/ja/weechat_plugin_api.ja.adoc
@@ -6343,7 +6343,7 @@ weechat_hashtable_free (hashtable);
==== config_new
-_WeeChat バージョン 1.5 で更新。_
+_WeeChat バージョン 1.5, 3.9 で更新。_
新しい設定ファイルを作成。
@@ -6361,7 +6361,12 @@ struct t_config_file *weechat_config_new (const char *name,
引数:
-* _name_: 設定ファイルの名前 (パスと拡張子は不要)
+// TRANSLATION MISSING
+* _name_: 設定ファイルの名前 (パスと拡張子は不要); a priority
+ is allowed before the name, with format `nnn|name` where `nnn` is non-negative
+ integer with priority; default priority is 1000; files are sorted by priority
+ from higher to lower when running command `/reload`
+ (see priority of configuration files below)
* _callback_reload_: `/reload` で設定ファイルをリロードする際に呼び出すコールバック関数
(任意、NULL でも可、下の説明を参照)、引数と戻り値:
** _const void *pointer_: ポインタ
@@ -6397,6 +6402,11 @@ struct t_config_file *weechat_config_new (const char *name,
(<<_config_new_section,config_new_section>> を使って) セクションもしくは
(<<_config_new_option,config_new_option>> を使って) オプションを追加した後だけです。
+// TRANSLATION MISSING
+Priority of default configuration files:
+
+include::includes/autogen_api_config_priority.ja.adoc[tag=config_priority]
+
C 言語での使用例:
[source,c]
diff --git a/doc/pl/includes/autogen_api_config_priority.pl.adoc b/doc/pl/includes/autogen_api_config_priority.pl.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/pl/includes/autogen_api_config_priority.pl.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/pl/includes/autogen_api_hdata.pl.adoc b/doc/pl/includes/autogen_api_hdata.pl.adoc
index afc730840..89eb28fb1 100644
--- a/doc/pl/includes/autogen_api_hdata.pl.adoc
+++ b/doc/pl/includes/autogen_api_hdata.pl.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/pl/includes/autogen_api_plugins_priority.pl.adoc b/doc/pl/includes/autogen_api_plugins_priority.pl.adoc
index 472c3d1c0..e5c00466a 100644
--- a/doc/pl/includes/autogen_api_plugins_priority.pl.adoc
+++ b/doc/pl/includes/autogen_api_plugins_priority.pl.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Wtyczka | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/sr/includes/autogen_api_config_priority.sr.adoc b/doc/sr/includes/autogen_api_config_priority.sr.adoc
new file mode 100644
index 000000000..e46bb99f5
--- /dev/null
+++ b/doc/sr/includes/autogen_api_config_priority.sr.adoc
@@ -0,0 +1,36 @@
+//
+// This file is auto-generated by script docgen.py.
+// DO NOT EDIT BY HAND!
+//
+
+// tag::config_priority[]
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | File | Priority
+| 1 | sec.conf | 120000
+| 2 | weechat.conf | 110000
+| 3 | plugins.conf | 100000
+| 4 | charset.conf | 16000
+| 5 | logger.conf | 15000
+| 6 | exec.conf | 14000
+| 7 | trigger.conf | 13000
+| 8 | spell.conf | 12000
+| 9 | alias.conf | 11000
+| 10 | buflist.conf | 10000
+| 11 | fifo.conf | 9000
+| 12 | typing.conf | 8000
+| 13 | xfer.conf | 7000
+| 14 | irc.conf | 6000
+| 15 | relay.conf | 5000
+| 16 | guile.conf | 4070
+| 17 | javascript.conf | 4060
+| 18 | lua.conf | 4050
+| 19 | perl.conf | 4040
+| 20 | php.conf | 4030
+| 21 | python.conf | 4020
+| 22 | ruby.conf | 4010
+| 23 | tcl.conf | 4000
+| 24 | script.conf | 3000
+| 25 | fset.conf | 2000
+|===
+// end::config_priority[]
diff --git a/doc/sr/includes/autogen_api_hdata.sr.adoc b/doc/sr/includes/autogen_api_hdata.sr.adoc
index 3c3e6312c..0947aee51 100644
--- a/doc/sr/includes/autogen_api_hdata.sr.adoc
+++ b/doc/sr/includes/autogen_api_hdata.sr.adoc
@@ -707,6 +707,7 @@ _count_   (integer) +
_last_config_file_ +
| _plugin_   (pointer, hdata: "plugin") +
+_priority_   (integer) +
_name_   (string) +
_filename_   (string) +
_file_   (pointer) +
diff --git a/doc/sr/includes/autogen_api_plugins_priority.sr.adoc b/doc/sr/includes/autogen_api_plugins_priority.sr.adoc
index 472c3d1c0..b87365301 100644
--- a/doc/sr/includes/autogen_api_plugins_priority.sr.adoc
+++ b/doc/sr/includes/autogen_api_plugins_priority.sr.adoc
@@ -4,26 +4,30 @@
//
// tag::plugins_priority[]
-. charset (16000)
-. logger (15000)
-. exec (14000)
-. trigger (13000)
-. spell (12000)
-. alias (11000)
-. buflist (10000)
-. fifo (9000)
-. typing (8000)
-. xfer (7000)
-. irc (6000)
-. relay (5000)
-. guile (4070)
-. javascript (4060)
-. lua (4050)
-. perl (4040)
-. php (4030)
-. python (4020)
-. ruby (4010)
-. tcl (4000)
-. script (3000)
-. fset (2000)
+[width="30%",cols="1,3,2",options="header"]
+|===
+| Rank | Додатак | Priority
+| 1 | charset | 16000
+| 2 | logger | 15000
+| 3 | exec | 14000
+| 4 | trigger | 13000
+| 5 | spell | 12000
+| 6 | alias | 11000
+| 7 | buflist | 10000
+| 8 | fifo | 9000
+| 9 | typing | 8000
+| 10 | xfer | 7000
+| 11 | irc | 6000
+| 12 | relay | 5000
+| 13 | guile | 4070
+| 14 | javascript | 4060
+| 15 | lua | 4050
+| 16 | perl | 4040
+| 17 | php | 4030
+| 18 | python | 4020
+| 19 | ruby | 4010
+| 20 | tcl | 4000
+| 21 | script | 3000
+| 22 | fset | 2000
+|===
// end::plugins_priority[]
diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc
index 14fc72ab4..312302003 100644
--- a/doc/sr/weechat_plugin_api.sr.adoc
+++ b/doc/sr/weechat_plugin_api.sr.adoc
@@ -6153,7 +6153,7 @@ weechat_hashtable_free (hashtable);
==== config_new
-_Ажурирано у верзији 1.5._
+_Ажурирано у верзији 1.5, 3.9._
Креира нови конфигурациони фајл.
@@ -6171,7 +6171,12 @@ struct t_config_file *weechat_config_new (const char *name,
Аргументи:
-* _name_: име конфигурационог фајла (без путање или екстензије)
+// TRANSLATION MISSING
+* _name_: име конфигурационог фајла (без путање или екстензије); a priority
+ is allowed before the name, with format `nnn|name` where `nnn` is non-negative
+ integer with priority; default priority is 1000; files are sorted by priority
+ from higher to lower when running command `/reload`
+ (see priority of configuration files below)
* _callback_reload_: функција која се позива када се командом `/reload` поново учита конфигурациони фајл (није обавезна, може да буде NULL, погледајте испод), аргументи и повратна вредност су:
** _const void *pointer_: показивач
** _void *data_: показивач
@@ -6196,6 +6201,11 @@ struct t_config_file *weechat_config_new (const char *name,
[NOTE]
Ова функција НЕ креира фајл на диску. Фајл ће се креирати позивом функције <<_config_write,config_write>>. Ово функцију би требало да позовете само након додавања неких одељака (са <<_config_new_section,config_new_section>>) и опција (са <<_config_new_option,config_new_option>>).
+// TRANSLATION MISSING
+Priority of default configuration files:
+
+include::includes/autogen_api_config_priority.sr.adoc[tag=config_priority]
+
C пример:
[source,c]