1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

core: add completion "plugins_installed"

This commit is contained in:
Sebastien Helleu
2014-01-14 13:27:43 +01:00
parent 5a292b28c0
commit 70ffe0a14f
21 changed files with 163 additions and 14 deletions
+1
View File
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -116,6 +116,8 @@
| weechat | plugins_commands | プラグインの定義するコマンド
| weechat | plugins_installed | names of plugins installed
| weechat | plugins_names | プラグイン名
| weechat | proxies_names | プロキシの名前
@@ -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
+5 -1
View File
@@ -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"
+5 -1
View File
@@ -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"
+5 -1
View File
@@ -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"
+5 -2
View File
@@ -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"
+5 -1
View File
@@ -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"
@@ -2089,6 +2089,10 @@ msgstr "Nem található az opció\n"
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"
+5 -1
View File
@@ -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"
+5 -1
View File
@@ -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 "プラグインの定義するコマンド"
+5 -1
View File
@@ -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"
+5 -1
View File
@@ -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"
+5 -1
View File
@@ -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"
@@ -2112,6 +2112,10 @@ msgstr "Не найден параметр\n"
msgid "names of plugins"
msgstr "настроить параметры конфигурации"
#, fuzzy
msgid "names of plugins installed"
msgstr "настроить параметры конфигурации"
#, fuzzy
msgid "commands defined by plugins"
msgstr " (нет pluginа)\n"
+5 -1
View File
@@ -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 ""
+4 -1
View File
@@ -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 ""
+1 -1
View File
@@ -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)",
+90
View File
@@ -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"
@@ -730,6 +731,92 @@ completion_list_add_plugins_cb (void *data,
return WEECHAT_RC_OK;
}
/*
* 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.
*
@@ -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);