summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--doc/de/autogen/plugin_api/completions.txt2
-rw-r--r--doc/en/autogen/plugin_api/completions.txt2
-rw-r--r--doc/fr/autogen/plugin_api/completions.txt2
-rw-r--r--doc/it/autogen/plugin_api/completions.txt2
-rw-r--r--doc/ja/autogen/plugin_api/completions.txt2
-rw-r--r--doc/pl/autogen/plugin_api/completions.txt2
-rw-r--r--po/cs.po6
-rw-r--r--po/de.po6
-rw-r--r--po/es.po6
-rw-r--r--po/fr.po7
-rw-r--r--po/hu.po6
-rw-r--r--po/it.po6
-rw-r--r--po/ja.po6
-rw-r--r--po/pl.po6
-rw-r--r--po/pt_BR.po6
-rw-r--r--po/ru.po6
-rw-r--r--po/tr.po6
-rw-r--r--po/weechat.pot5
-rw-r--r--src/core/wee-command.c2
-rw-r--r--src/core/wee-completion.c90
21 files changed, 163 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 8569fe7c4..b29ae1b27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/po/cs.po b/po/cs.po
index 89b6b7df3..b3ce57200 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -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"
diff --git a/po/de.po b/po/de.po
index 0cd6498f8..30d9d17c9 100644
--- a/po/de.po
+++ b/po/de.po
@@ -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"
diff --git a/po/es.po b/po/es.po
index 4d0969d51..5a6ee3a9b 100644
--- a/po/es.po
+++ b/po/es.po
@@ -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"
diff --git a/po/fr.po b/po/fr.po
index 6b990b099..2948c26e9 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -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"
diff --git a/po/hu.po b/po/hu.po
index 01d450c2f..87dfce084 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -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"
diff --git a/po/it.po b/po/it.po
index 92cceb1c1..4b1b1f26a 100644
--- a/po/it.po
+++ b/po/it.po
@@ -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"
diff --git a/po/ja.po b/po/ja.po
index a118b2c20..7a01b185c 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -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 "プラグインの定義するコマンド"
diff --git a/po/pl.po b/po/pl.po
index 9eef45e11..19afdc1fc 100644
--- a/po/pl.po
+++ b/po/pl.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: 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"
diff --git a/po/ru.po b/po/ru.po
index 6f1fdbc3c..fdb84c8c8 100644
--- a/po/ru.po
+++ b/po/ru.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: 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"
diff --git a/po/tr.po b/po/tr.po
index bb8d7a89a..5bb5e3227 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -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);