diff options
-rw-r--r-- | ChangeLog.adoc | 2 | ||||
-rw-r--r-- | po/cs.po | 7 | ||||
-rw-r--r-- | po/de.po | 13 | ||||
-rw-r--r-- | po/es.po | 7 | ||||
-rw-r--r-- | po/fr.po | 11 | ||||
-rw-r--r-- | po/hu.po | 7 | ||||
-rw-r--r-- | po/it.po | 7 | ||||
-rw-r--r-- | po/ja.po | 7 | ||||
-rw-r--r-- | po/pl.po | 13 | ||||
-rw-r--r-- | po/pt.po | 7 | ||||
-rw-r--r-- | po/pt_BR.po | 7 | ||||
-rw-r--r-- | po/ru.po | 7 | ||||
-rw-r--r-- | po/sr.po | 13 | ||||
-rw-r--r-- | po/tr.po | 13 | ||||
-rw-r--r-- | po/weechat.pot | 7 | ||||
-rw-r--r-- | src/core/weechat.c | 1 | ||||
-rw-r--r-- | src/core/weechat.h | 1 | ||||
-rw-r--r-- | src/plugins/guile/weechat-guile.c | 6 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js.cpp | 6 | ||||
-rw-r--r-- | src/plugins/lua/weechat-lua.c | 6 | ||||
-rw-r--r-- | src/plugins/perl/weechat-perl.c | 6 | ||||
-rw-r--r-- | src/plugins/php/weechat-php.c | 6 | ||||
-rw-r--r-- | src/plugins/plugin-api-info.c | 30 | ||||
-rw-r--r-- | src/plugins/plugin-script.c | 21 | ||||
-rw-r--r-- | src/plugins/plugin-script.h | 1 | ||||
-rw-r--r-- | src/plugins/plugin.c | 30 | ||||
-rw-r--r-- | src/plugins/python/weechat-python.c | 6 | ||||
-rw-r--r-- | src/plugins/ruby/weechat-ruby.c | 6 | ||||
-rw-r--r-- | src/plugins/tcl/weechat-tcl.c | 6 |
29 files changed, 208 insertions, 52 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index d58aad84a..05d1a85d1 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -26,6 +26,7 @@ New features:: * core: don't split on newline characters in printf_date_tags when input_multiline is set (issue #1909) * core: add key @kbd:[l] in cursor mode to quote line, add variable "_chat_focused_line" in function hashtable sent to hook_focus callback (issue #1913, issue #1914) * core: add option `split_return` in command `/input` (issue #1916) + * core: send all command line parameters not beginning with a dash to all plugins * core: add command `/reset` to reset options to their default values * core: add option `rename` in command `/bar` * core: add relative move of read marker with `/buffer set unread [+/-]N` (issue #1895) @@ -38,6 +39,7 @@ New features:: * api: add function config_set_version (issue #1238) * api: don't split on newline by default in functions `command` and `command_options` when `input_multiline` is set to 0 * api: add optional argument with version in info "version_number" + * api: add info "auto_load_scripts" * alias: use lower case for default aliases, rename all aliases to lower case on upgrade (issue #1872) * alias: add `$&` to replace all arguments with double quotes escaped (issue #1140, issue #1190) * alias: add option `missing` in command `/alias` @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -11116,6 +11116,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "znaková sada terminálu" @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-25 22:34+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -13522,6 +13522,17 @@ msgstr "" "1, falls die automatische Verbindung zu Servern aktiviert ist, 0, wenn sie " "vom Benutzer deaktiviert wurde (Option \"-a\" oder \"--no-connect\")" +#, fuzzy +#| msgid "" +#| "1 if automatic connection to servers is enabled, 0 if it has been " +#| "disabled by the user (option \"-a\" or \"--no-connect\")" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" +"1, falls die automatische Verbindung zu Servern aktiviert ist, 0, wenn sie " +"vom Benutzer deaktiviert wurde (Option \"-a\" oder \"--no-connect\")" + msgid "terminal charset" msgstr "Terminal Zeichensatz" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Santiago Forero <santiago@forero.xyz>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -11849,6 +11849,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "set de caracteres de la terminal" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" -"PO-Revision-Date: 2023-05-29 09:40+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" +"PO-Revision-Date: 2023-05-30 20:49+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -13209,6 +13209,13 @@ msgstr "" "1 si la connexion automatique aux serveurs est activée, 0 si elle a été " "désactivée par l'utilisateur (option \"-a\" ou \"--no-connect\")" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" +"1 si la les scripts sont automatiquement charés, 0 si l'auto-chargement a " +"été désactivé par l'utilisateur (option \"-s\" ou \"--no-script\")" + msgid "terminal charset" msgstr "charset du terminal" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -10505,6 +10505,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "pufferek kezelése" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -11572,6 +11572,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "set caratteri terminale" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -12777,6 +12777,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "端末の文字セット" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -13789,6 +13789,17 @@ msgstr "" "1 jeśli automatycznie łączenie z serwerami jest włączone, 0 jeśli zostało " "wyłączone przez użytkownika (opcja \"-a\" lub \"--no-connect\")" +#, fuzzy +#| msgid "" +#| "1 if automatic connection to servers is enabled, 0 if it has been " +#| "disabled by the user (option \"-a\" or \"--no-connect\")" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" +"1 jeśli automatycznie łączenie z serwerami jest włączone, 0 jeśli zostało " +"wyłączone przez użytkownika (opcja \"-a\" lub \"--no-connect\")" + msgid "terminal charset" msgstr "kodowanie terminala" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -12545,6 +12545,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "charset do termianl" diff --git a/po/pt_BR.po b/po/pt_BR.po index f45868386..894e325f4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -11069,6 +11069,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "charset do terminar" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -10543,6 +10543,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + #, fuzzy msgid "terminal charset" msgstr "управление буферами" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-14 15:29+0200\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -12970,6 +12970,17 @@ msgstr "" "1 ако је укључено аутоматско повезивање са серверима, 0 ако је корисник то " "искључио (опцијом „-a” или „--no-connect”)" +#, fuzzy +#| msgid "" +#| "1 if automatic connection to servers is enabled, 0 if it has been " +#| "disabled by the user (option \"-a\" or \"--no-connect\")" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" +"1 ако је укључено аутоматско повезивање са серверима, 0 ако је корисник то " +"искључио (опцијом „-a” или „--no-connect”)" + msgid "terminal charset" msgstr "скуп карактера терминала" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -13333,6 +13333,17 @@ msgstr "" "Sunuculara kendiliğinden bağlantı etkinleştirilmişse 1, kullanıcı ayarı ile " "devre dışı bırakılmışsa 0 (\"-a\" veya \"--no-connect\" seçeneği)" +#, fuzzy +#| msgid "" +#| "1 if automatic connection to servers is enabled, 0 if it has been " +#| "disabled by the user (option \"-a\" or \"--no-connect\")" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" +"Sunuculara kendiliğinden bağlantı etkinleştirilmişse 1, kullanıcı ayarı ile " +"devre dışı bırakılmışsa 0 (\"-a\" veya \"--no-connect\" seçeneği)" + msgid "terminal charset" msgstr "uçbirim karakter seti" diff --git a/po/weechat.pot b/po/weechat.pot index 62b8d3dc2..b75c8cf60 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"POT-Creation-Date: 2023-05-30 16:39+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -9494,6 +9494,11 @@ msgid "" "by the user (option \"-a\" or \"--no-connect\")" msgstr "" +msgid "" +"1 if scripts are automatically loaded, 0 if the auto-load has been disabled " +"by the user (option \"-s\" or \"--no-script\")" +msgstr "" + msgid "terminal charset" msgstr "" diff --git a/src/core/weechat.c b/src/core/weechat.c index eb24822c0..d91a3300a 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -132,6 +132,7 @@ int weechat_no_gcrypt = 0; /* remove init/deinit of gcrypt */ struct t_weelist *weechat_startup_commands = NULL; /* startup commands */ /* (option -r) */ int weechat_auto_connect = 1; /* auto-connect to servers */ +int weechat_auto_load_scripts = 1; /* auto-load scripts */ /* diff --git a/src/core/weechat.h b/src/core/weechat.h index 900662499..47d395c89 100644 --- a/src/core/weechat.h +++ b/src/core/weechat.h @@ -126,6 +126,7 @@ extern int weechat_no_gnutls; extern int weechat_no_gcrypt; extern struct t_weelist *weechat_startup_commands; extern int weechat_auto_connect; +extern int weechat_auto_load_scripts; extern void weechat_term_check (); extern void weechat_shutdown (int return_code, int crash); diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index 48d9d3c67..3be050095 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -1239,6 +1239,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { char str_version[128]; + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_guile_plugin = plugin; /* set interpreter name and version */ @@ -1296,7 +1300,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) guile_data.unload_all = &weechat_guile_unload_all; guile_quiet = 1; - plugin_script_init (weechat_guile_plugin, argc, argv, &guile_data); + plugin_script_init (weechat_guile_plugin, &guile_data); guile_quiet = 0; plugin_script_display_short_list (weechat_guile_plugin, diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp index cda9f5aad..a33b2d1be 100644 --- a/src/plugins/javascript/weechat-js.cpp +++ b/src/plugins/javascript/weechat-js.cpp @@ -924,6 +924,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { char str_interpreter[64]; + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_js_plugin = plugin; /* set interpreter name and version */ @@ -950,7 +954,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) js_data.unload_all = &weechat_js_unload_all; js_quiet = 1; - plugin_script_init (plugin, argc, argv, &js_data); + plugin_script_init (plugin, &js_data); js_quiet = 0; plugin_script_display_short_list (weechat_js_plugin, js_scripts); diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index 1a247bfab..f9338120c 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -1237,6 +1237,10 @@ weechat_lua_signal_script_action_cb (const void *pointer, void *data, int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_lua_plugin = plugin; /* set interpreter name and version */ @@ -1271,7 +1275,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) lua_data.unload_all = &weechat_lua_unload_all; lua_quiet = 1; - plugin_script_init (weechat_lua_plugin, argc, argv, &lua_data); + plugin_script_init (weechat_lua_plugin, &lua_data); lua_quiet = 0; plugin_script_display_short_list (weechat_lua_plugin, diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c index 063fe75bd..1759a4810 100644 --- a/src/plugins/perl/weechat-perl.c +++ b/src/plugins/perl/weechat-perl.c @@ -1253,6 +1253,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) PERL_SYS_INIT3 (&a, (char ***)&perl_args_local, (char ***)&perl_env); #endif /* PERL_SYS_INIT3 */ + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_perl_plugin = plugin; /* set interpreter name and version */ @@ -1304,7 +1308,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) perl_data.unload_all = &weechat_perl_unload_all; perl_quiet = 1; - plugin_script_init (weechat_perl_plugin, argc, argv, &perl_data); + plugin_script_init (weechat_perl_plugin, &perl_data); perl_quiet = 0; plugin_script_display_short_list (weechat_perl_plugin, diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c index 07f3da4a1..747768b51 100644 --- a/src/plugins/php/weechat-php.c +++ b/src/plugins/php/weechat-php.c @@ -1302,6 +1302,10 @@ php_weechat_log_message (char *message) int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_php_plugin = plugin; /* set interpreter name and version */ @@ -1341,7 +1345,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) PG(report_zend_debug) = 0; /* Turn off --enable-debug output */ php_quiet = 1; - plugin_script_init (weechat_php_plugin, argc, argv, &php_data); + plugin_script_init (weechat_php_plugin, &php_data); php_quiet = 0; plugin_script_display_short_list (weechat_php_plugin, diff --git a/src/plugins/plugin-api-info.c b/src/plugins/plugin-api-info.c index 3546491f8..cde37b597 100644 --- a/src/plugins/plugin-api-info.c +++ b/src/plugins/plugin-api-info.c @@ -449,6 +449,27 @@ plugin_api_info_auto_connect_cb (const void *pointer, void *data, } /* + * Returns WeeChat info "auto_load_scripts". + */ + +char * +plugin_api_info_auto_load_scripts_cb (const void *pointer, void *data, + const char *info_name, + const char *arguments) +{ + char value[32]; + + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) info_name; + (void) arguments; + + snprintf (value, sizeof (value), "%d", weechat_auto_load_scripts); + return strdup (value); +} + +/* * Returns WeeChat info "charset_terminal". */ @@ -1964,9 +1985,14 @@ plugin_api_info_init () NULL, &plugin_api_info_weechat_daemon_cb, NULL, NULL); hook_info (NULL, "auto_connect", N_("1 if automatic connection to servers is enabled, " - "0 if it has been disabled by the user (option \"-a\" or " - "\"--no-connect\")"), + "0 if it has been disabled by the user " + "(option \"-a\" or \"--no-connect\")"), NULL, &plugin_api_info_auto_connect_cb, NULL, NULL); + hook_info (NULL, "auto_load_scripts", + N_("1 if scripts are automatically loaded, " + "0 if the auto-load has been disabled by the user " + "(option \"-s\" or \"--no-script\")"), + NULL, &plugin_api_info_auto_load_scripts_cb, NULL, NULL); hook_info (NULL, "charset_terminal", N_("terminal charset"), NULL, &plugin_api_info_charset_terminal_cb, NULL, NULL); diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c index 533483d03..14404d1c9 100644 --- a/src/plugins/plugin-script.c +++ b/src/plugins/plugin-script.c @@ -158,16 +158,14 @@ plugin_script_create_dirs (struct t_weechat_plugin *weechat_plugin) * - hooks config * - creates directories in WeeChat home * - hooks command, completion, hdata, infolist, signals - * - parses arguments * - auto-loads scripts. */ void plugin_script_init (struct t_weechat_plugin *weechat_plugin, - int argc, char *argv[], struct t_plugin_script_data *plugin_data) { - char string[512], *completion; + char string[512], *completion, *info_auto_load_scripts; char *action_signals[] = { "install", "remove", "autoload", NULL }; int i, auto_load_scripts; @@ -273,16 +271,13 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin, &plugin_script_info_version_cb, weechat_plugin, NULL); - /* parse arguments */ - auto_load_scripts = 1; - for (i = 0; i < argc; i++) - { - if ((strcmp (argv[i], "-s") == 0) - || (strcmp (argv[i], "--no-script") == 0)) - { - auto_load_scripts = 0; - } - } + /* check if auto-load of scripts is enabled */ + info_auto_load_scripts = weechat_info_get ("auto_load_scripts", NULL); + auto_load_scripts = (info_auto_load_scripts + && (strcmp (info_auto_load_scripts, "1") == 0)) ? + 1 : 0; + if (info_auto_load_scripts) + free (info_auto_load_scripts); /* autoload scripts */ if (auto_load_scripts) diff --git a/src/plugins/plugin-script.h b/src/plugins/plugin-script.h index d54751299..e4b3081c0 100644 --- a/src/plugins/plugin-script.h +++ b/src/plugins/plugin-script.h @@ -116,7 +116,6 @@ struct t_plugin_script_data extern void plugin_script_display_interpreter (struct t_weechat_plugin *plugin, int indent); extern void plugin_script_init (struct t_weechat_plugin *weechat_plugin, - int argc, char *argv[], struct t_plugin_script_data *plugin_data); extern int plugin_script_valid (struct t_plugin_script *scripts, struct t_plugin_script *script); diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index f816ecd6e..ea4b9fb5a 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -274,20 +274,18 @@ plugin_check_autoload (const char *filename) */ void -plugin_get_args (struct t_weechat_plugin *plugin, - int argc, char **argv, +plugin_get_args (int argc, char **argv, int *plugin_argc, char ***plugin_argv, - int *no_connect) + int *no_connect, int *no_script) { - int i, temp_argc, length_plugin_name; + int i, temp_argc; char **temp_argv; temp_argc = 0; temp_argv = NULL; *no_connect = 0; - - length_plugin_name = strlen (plugin->name); + *no_script = 0; if (argc > 0) { @@ -302,10 +300,11 @@ plugin_get_args (struct t_weechat_plugin *plugin, *no_connect = 1; } else if ((strcmp (argv[i], "-s") == 0) - || (strcmp (argv[i], "--no-script") == 0) - || ((strncmp (argv[i], plugin->name, - length_plugin_name) == 0) - && (argv[i][length_plugin_name] == ':'))) + || (strcmp (argv[i], "--no-script") == 0)) + { + *no_script = 1; + } + else if (argv[i][0] != '-') { temp_argv[temp_argc++] = argv[i]; } @@ -336,7 +335,8 @@ int plugin_call_init (struct t_weechat_plugin *plugin, int argc, char **argv) { t_weechat_init_func *init_func; - int plugin_argc, no_connect, rc, old_auto_connect; + int no_connect, rc, old_auto_connect, no_script, old_auto_load_scripts; + int plugin_argc; char **plugin_argv; if (plugin->initialized) @@ -348,12 +348,15 @@ plugin_call_init (struct t_weechat_plugin *plugin, int argc, char **argv) return 0; /* get arguments for the plugin */ - plugin_get_args (plugin, argc, argv, - &plugin_argc, &plugin_argv, &no_connect); + plugin_get_args (argc, argv, + &plugin_argc, &plugin_argv, &no_connect, &no_script); old_auto_connect = weechat_auto_connect; weechat_auto_connect = (no_connect) ? 0 : 1; + old_auto_load_scripts = weechat_auto_load_scripts; + weechat_auto_load_scripts = (no_script) ? 0 : 1; + /* init plugin */ if (weechat_debug_core >= 1) { @@ -377,6 +380,7 @@ plugin_call_init (struct t_weechat_plugin *plugin, int argc, char **argv) } weechat_auto_connect = old_auto_connect; + weechat_auto_load_scripts = old_auto_load_scripts; if (plugin_argv) free (plugin_argv); diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index c06b4eb43..8a5883327 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -1465,6 +1465,10 @@ weechat_python_signal_script_action_cb (const void *pointer, void *data, int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_python_plugin = plugin; /* set interpreter name and version */ @@ -1532,7 +1536,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) python_data.unload_all = &weechat_python_unload_all; python_quiet = 1; - plugin_script_init (weechat_python_plugin, argc, argv, &python_data); + plugin_script_init (weechat_python_plugin, &python_data); python_quiet = 0; plugin_script_display_short_list (weechat_python_plugin, diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c index 09be2f202..fde6d95a5 100644 --- a/src/plugins/ruby/weechat-ruby.c +++ b/src/plugins/ruby/weechat-ruby.c @@ -1340,6 +1340,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "end\n" }; + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_ruby_plugin = plugin; /* set interpreter name and version */ @@ -1413,7 +1417,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) ruby_data.unload_all = &weechat_ruby_unload_all; ruby_quiet = 1; - plugin_script_init (weechat_ruby_plugin, argc, argv, &ruby_data); + plugin_script_init (weechat_ruby_plugin, &ruby_data); ruby_quiet = 0; plugin_script_display_short_list (weechat_ruby_plugin, diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c index bc22e7127..1e53932c5 100644 --- a/src/plugins/tcl/weechat-tcl.c +++ b/src/plugins/tcl/weechat-tcl.c @@ -922,6 +922,10 @@ weechat_tcl_signal_script_action_cb (const void *pointer, void *data, int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { + /* make C compiler happy */ + (void) argc; + (void) argv; + weechat_tcl_plugin = plugin; /* set interpreter name and version */ @@ -951,7 +955,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) tcl_data.unload_all = &weechat_tcl_unload_all; tcl_quiet = 1; - plugin_script_init (weechat_tcl_plugin, argc, argv, &tcl_data); + plugin_script_init (weechat_tcl_plugin, &tcl_data); tcl_quiet = 0; plugin_script_display_short_list (weechat_tcl_plugin, |