diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/pl/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | po/cs.po | 6 | ||||
-rw-r--r-- | po/de.po | 6 | ||||
-rw-r--r-- | po/es.po | 6 | ||||
-rw-r--r-- | po/fr.po | 7 | ||||
-rw-r--r-- | po/hu.po | 6 | ||||
-rw-r--r-- | po/it.po | 6 | ||||
-rw-r--r-- | po/ja.po | 6 | ||||
-rw-r--r-- | po/pl.po | 6 | ||||
-rw-r--r-- | po/pt_BR.po | 6 | ||||
-rw-r--r-- | po/ru.po | 6 | ||||
-rw-r--r-- | po/tr.po | 6 | ||||
-rw-r--r-- | po/weechat.pot | 5 | ||||
-rw-r--r-- | src/core/wee-command.c | 2 | ||||
-rw-r--r-- | src/core/wee-completion.c | 90 |
21 files changed, 163 insertions, 14 deletions
@@ -11,6 +11,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 0.4.3 (under dev) +* core: add completion "plugins_installed" * core: fix crash in /eval when config option has a NULL value * core: fix crash with hdata_update on shared strings, add hdata type "shared_string" (bug #41104) diff --git a/doc/de/autogen/plugin_api/completions.txt b/doc/de/autogen/plugin_api/completions.txt index 86844baba..6ab458f1e 100644 --- a/doc/de/autogen/plugin_api/completions.txt +++ b/doc/de/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | Befehle, definiert durch Erweiterungen +| weechat | plugins_installed | names of plugins installed + | weechat | plugins_names | Liste der Erweiterungen | weechat | proxies_names | Namen aller Proxys diff --git a/doc/en/autogen/plugin_api/completions.txt b/doc/en/autogen/plugin_api/completions.txt index 9a91bcb8c..88ca39815 100644 --- a/doc/en/autogen/plugin_api/completions.txt +++ b/doc/en/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | commands defined by plugins +| weechat | plugins_installed | names of plugins installed + | weechat | plugins_names | names of plugins | weechat | proxies_names | names of proxies diff --git a/doc/fr/autogen/plugin_api/completions.txt b/doc/fr/autogen/plugin_api/completions.txt index cd5b602d0..c7bee98fa 100644 --- a/doc/fr/autogen/plugin_api/completions.txt +++ b/doc/fr/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | commandes définies par les extensions +| weechat | plugins_installed | noms des extensions installées + | weechat | plugins_names | noms des extensions | weechat | proxies_names | noms des proxies diff --git a/doc/it/autogen/plugin_api/completions.txt b/doc/it/autogen/plugin_api/completions.txt index 59314031e..6fee632fd 100644 --- a/doc/it/autogen/plugin_api/completions.txt +++ b/doc/it/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | comandi definiti dai plugin +| weechat | plugins_installed | names of plugins installed + | weechat | plugins_names | nomi dei plugin | weechat | proxies_names | nomi dei proxy diff --git a/doc/ja/autogen/plugin_api/completions.txt b/doc/ja/autogen/plugin_api/completions.txt index 733d766ed..d0c7a745c 100644 --- a/doc/ja/autogen/plugin_api/completions.txt +++ b/doc/ja/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | プラグインの定義するコマンド +| weechat | plugins_installed | names of plugins installed + | weechat | plugins_names | プラグイン名 | weechat | proxies_names | プロキシの名前 diff --git a/doc/pl/autogen/plugin_api/completions.txt b/doc/pl/autogen/plugin_api/completions.txt index fde2d6740..b5b101f15 100644 --- a/doc/pl/autogen/plugin_api/completions.txt +++ b/doc/pl/autogen/plugin_api/completions.txt @@ -116,6 +116,8 @@ | weechat | plugins_commands | komendy zdefiniowane przez wtyczki +| weechat | plugins_installed | names of plugins installed + | weechat | plugins_names | nazwy wtyczek | weechat | proxies_names | nazwy proxy @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2414,6 +2414,10 @@ msgstr "konfigurační nastavení" msgid "names of plugins" msgstr "jména pluginů" +#, fuzzy +msgid "names of plugins installed" +msgstr "jména pluginů" + msgid "commands defined by plugins" msgstr "příkazy definované pluginy" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.3-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -2760,6 +2760,10 @@ msgstr "Konfigurationsoptionen" msgid "names of plugins" msgstr "Liste der Erweiterungen" +#, fuzzy +msgid "names of plugins installed" +msgstr "Liste der Erweiterungen" + msgid "commands defined by plugins" msgstr "Befehle, definiert durch Erweiterungen" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2547,6 +2547,10 @@ msgstr "opciones de configuración" msgid "names of plugins" msgstr "nombres de plugins" +#, fuzzy +msgid "names of plugins installed" +msgstr "nombres de plugins" + msgid "commands defined by plugins" msgstr "comandos definidos por plugins" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" -"PO-Revision-Date: 2014-01-13 15:41+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" +"PO-Revision-Date: 2014-01-14 13:17+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -2686,6 +2686,9 @@ msgstr "options de configuration" msgid "names of plugins" msgstr "noms des extensions" +msgid "names of plugins installed" +msgstr "noms des extensions installées" + msgid "commands defined by plugins" msgstr "commandes définies par les extensions" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2090,6 +2090,10 @@ msgid "names of plugins" msgstr "konfigurációs paraméterek beállítása" #, fuzzy +msgid "names of plugins installed" +msgstr "konfigurációs paraméterek beállítása" + +#, fuzzy msgid "commands defined by plugins" msgstr " (nem található bővítőmodul)\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:16+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2629,6 +2629,10 @@ msgstr "opzioni di configurazione" msgid "names of plugins" msgstr "nomi dei plugin" +#, fuzzy +msgid "names of plugins installed" +msgstr "nomi dei plugin" + msgid "commands defined by plugins" msgstr "comandi definiti dai plugin" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-13 10:55+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/WeeChat>\n" @@ -2618,6 +2618,10 @@ msgstr "設定オプション" msgid "names of plugins" msgstr "プラグイン名" +#, fuzzy +msgid "names of plugins installed" +msgstr "プラグイン名" + msgid "commands defined by plugins" msgstr "プラグインの定義するコマンド" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2673,6 +2673,10 @@ msgstr "opcje konfiguracyjne" msgid "names of plugins" msgstr "nazwy wtyczek" +#, fuzzy +msgid "names of plugins installed" +msgstr "nazwy wtyczek" + msgid "commands defined by plugins" msgstr "komendy zdefiniowane przez wtyczki" diff --git a/po/pt_BR.po b/po/pt_BR.po index 8400807da..60a0329ac 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: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2498,6 +2498,10 @@ msgstr "opções de configuração" msgid "names of plugins" msgstr "nomes de plugins" +#, fuzzy +msgid "names of plugins installed" +msgstr "nomes de plugins" + msgid "commands defined by plugins" msgstr "comandos definidos por plugins" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2113,6 +2113,10 @@ msgid "names of plugins" msgstr "настроить параметры конфигурации" #, fuzzy +msgid "names of plugins installed" +msgstr "настроить параметры конфигурации" + +#, fuzzy msgid "commands defined by plugins" msgstr " (нет pluginа)\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2014-01-06 10:17+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1870,6 +1870,10 @@ msgstr "yapılandırma seçenekleri" msgid "names of plugins" msgstr "eklentilerin isimleri" +#, fuzzy +msgid "names of plugins installed" +msgstr "eklentilerin isimleri" + msgid "commands defined by plugins" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index e7b1d068d..c81fb84d0 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-01-13 15:40+0100\n" +"POT-Creation-Date: 2014-01-14 13:17+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1873,6 +1873,9 @@ msgstr "" msgid "names of plugins" msgstr "" +msgid "names of plugins installed" +msgstr "" + msgid "commands defined by plugins" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 97453b877..6d963c42b 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -6921,7 +6921,7 @@ command_init () "Without argument, this command lists loaded plugins."), "list %(plugins_names)" " || listfull %(plugins_names)" - " || load %(filename)" + " || load %(plugins_installed)" " || autoload" " || reload %(plugins_names)" " || unload %(plugins_names)", diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c index d394e633e..6e3066fee 100644 --- a/src/core/wee-completion.c +++ b/src/core/wee-completion.c @@ -41,6 +41,7 @@ #include "wee-proxy.h" #include "wee-secure.h" #include "wee-string.h" +#include "wee-util.h" #include "../gui/gui-completion.h" #include "../gui/gui-bar.h" #include "../gui/gui-bar-window.h" @@ -731,6 +732,92 @@ completion_list_add_plugins_cb (void *data, } /* + * Adds a plugin installed to completion list. + */ + +void +completion_list_add_plugins_installed_exec_cb (void *data, const char *filename) +{ + struct t_gui_completion *completion; + const char *pos, *pos2; + char *name; + + completion = (struct t_gui_completion *)data; + + /* start after last '/' (or '\') in path */ + pos = strrchr (filename, DIR_SEPARATOR_CHAR); + if (pos) + pos++; + else + pos = filename; + + /* truncate after the last '.' in name */ + pos2 = strrchr (pos, '.'); + if (pos2) + name = string_strndup (pos, pos2 - pos); + else + name = strdup (pos); + + if (name) + { + gui_completion_list_add (completion, name, 0, WEECHAT_LIST_POS_SORT); + free (name); + } +} + +/* + * Adds plugins installed to completion list. + */ + +int +completion_list_add_plugins_installed_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + char *plugin_path, *plugin_path2, *dir_name; + int length; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + /* plugins in WeeChat home dir */ + if (CONFIG_STRING(config_plugin_path) + && CONFIG_STRING(config_plugin_path)[0]) + { + plugin_path = string_expand_home (CONFIG_STRING(config_plugin_path)); + plugin_path2 = string_replace ((plugin_path) ? + plugin_path : CONFIG_STRING(config_plugin_path), + "%h", weechat_home); + util_exec_on_files ((plugin_path2) ? + plugin_path2 : ((plugin_path) ? + plugin_path : CONFIG_STRING(config_plugin_path)), + 0, + completion, + &completion_list_add_plugins_installed_exec_cb); + if (plugin_path) + free (plugin_path); + if (plugin_path2) + free (plugin_path2); + } + + /* plugins in WeeChat global lib dir */ + length = strlen (WEECHAT_LIBDIR) + 16 + 1; + dir_name = malloc (length); + if (dir_name) + { + snprintf (dir_name, length, "%s/plugins", WEECHAT_LIBDIR); + util_exec_on_files (dir_name, 0, completion, + &completion_list_add_plugins_installed_exec_cb); + free (dir_name); + } + + return WEECHAT_RC_OK; +} + +/* * Adds plugin commands to completion list. * * The plugin name is read in previous argument. @@ -1416,6 +1503,9 @@ completion_init () hook_completion (NULL, "plugins_names", /* formerly "%p" */ N_("names of plugins"), &completion_list_add_plugins_cb, NULL); + hook_completion (NULL, "plugins_installed", + N_("names of plugins installed"), + &completion_list_add_plugins_installed_cb, NULL); hook_completion (NULL, "plugins_commands", /* formerly "%P" */ N_("commands defined by plugins"), &completion_list_add_plugins_commands_cb, NULL); |