summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--doc/en/autogen/user/alias_commands.txt11
-rw-r--r--doc/en/autogen/user/irc_commands.txt18
-rw-r--r--doc/fr/autogen/user/alias_commands.txt11
-rw-r--r--doc/fr/autogen/user/irc_commands.txt18
-rw-r--r--doc/it/autogen/user/alias_commands.txt39
-rw-r--r--doc/it/autogen/user/irc_commands.txt20
-rw-r--r--po/POTFILES.in2
-rw-r--r--po/cs.po87
-rw-r--r--po/de.po31
-rw-r--r--po/es.po87
-rw-r--r--po/fr.po118
-rw-r--r--po/hu.po98
-rw-r--r--po/it.po103
-rw-r--r--po/pl.po87
-rw-r--r--po/ru.po98
-rw-r--r--po/srcfiles.cmake2
-rw-r--r--po/weechat.pot78
-rw-r--r--src/plugins/alias/CMakeLists.txt1
-rw-r--r--src/plugins/alias/Makefile.am2
-rw-r--r--src/plugins/alias/alias-config.c368
-rw-r--r--src/plugins/alias/alias-config.h35
-rw-r--r--src/plugins/alias/alias.c385
-rw-r--r--src/plugins/alias/alias.h9
24 files changed, 1124 insertions, 585 deletions
diff --git a/ChangeLog b/ChangeLog
index 24fd848fa..edee2012c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@ Version 0.3.2 (under dev!)
* api: fix "inactivity" value when no key has been pressed since WeeChat started
(bug #28930)
* api: return absolute path for info_get of "weechat_dir" (bug #27936)
+* alias: add custom completion for aliases (task #9479)
* scripts: allow script commands to reload only one script
* perl: fix crash when callbacks are called during script initialization
(bug #29018)
diff --git a/doc/en/autogen/user/alias_commands.txt b/doc/en/autogen/user/alias_commands.txt
index b4a0f1322..d00395125 100644
--- a/doc/en/autogen/user/alias_commands.txt
+++ b/doc/en/autogen/user/alias_commands.txt
@@ -1,8 +1,9 @@
-• *`/alias`* `[alias_name [command [arguments]]]`::
+• *`/alias`* `[[-completion completion] alias_name [command [arguments]]]`::
........................................
create an alias for a command
+ completion: completion for alias (optional, by default completion is done with target command)
alias_name: name of alias (can start or end with "*" for alias listing)
command: command name (many commands can be separated by semicolons)
arguments: arguments for command
@@ -19,5 +20,13 @@
$nick: current nick
$channel: current channel
$server: current server
+
+ Examples:
+ alias /split to split window horizontally:
+ /alias split /window splith
+ alias /hello to say "hello" on all channels but not on #weechat:
+ /alias hello /allchan -exclude=#weechat msg * hello
+ alias /forcejoin to send IRC command "forcejoin" with completion of /sajoin:
+ /alias -completion %%sajoin /quote forcejoin
........................................
diff --git a/doc/en/autogen/user/irc_commands.txt b/doc/en/autogen/user/irc_commands.txt
index bd86471fb..650f405b5 100644
--- a/doc/en/autogen/user/irc_commands.txt
+++ b/doc/en/autogen/user/irc_commands.txt
@@ -133,6 +133,15 @@
servername: server name to disconnect
........................................
+• *`/forcejoin`* `nickname channel[,channel]`::
+
+........................................
+ forces a user to join channel(s)
+
+ nickname: nickname
+ channel: channel name
+........................................
+
• *`/halfop`* `[nickname [nickname]]`::
........................................
@@ -342,6 +351,15 @@
text: text to send
........................................
+• *`/omode`* `channel mode`::
+
+........................................
+ change mode on channel, without having operator status
+
+ channel: channel name
+ mode: mode for channel
+........................................
+
• *`/op`* `nickname [nickname]`::
........................................
diff --git a/doc/fr/autogen/user/alias_commands.txt b/doc/fr/autogen/user/alias_commands.txt
index 68b22467e..84f7b208f 100644
--- a/doc/fr/autogen/user/alias_commands.txt
+++ b/doc/fr/autogen/user/alias_commands.txt
@@ -1,8 +1,9 @@
-• *`/alias`* `[nom_alias [commande [paramètres]]]`::
+• *`/alias`* `[[-completion complétion] nom_alias [commande [paramètres]]]`::
........................................
créer un alias pour une commande
+ complétion: complétion pour l'alias (optionnel, par défaut la complétion se fait avec la commande cible)
nom_alias: nom de l'alias (peut démarrer ou se terminer par "*" pour une liste d'alias)
commande: nom de la commande (plusieurs commandes peuvent être séparées par des point-virgules)
paramètres: paramètres pour la commande
@@ -19,5 +20,13 @@
$nick: pseudo courant
$channel: canal courant
$server: serveur courant
+
+ Exemples :
+ alias /split pour diviser la fenêtre horizontalement :
+ /alias split /window splith
+ alias /hello pour dire "hello" sur tous les canaux mais pas sur #weechat :
+ /alias hello /allchan -exclude=#weechat msg * hello
+ alias /forcejoin pour envoyer la commande IRC "forcejoin" avec la complétion de /sajoin :
+ /alias -completion %%sajoin /quote forcejoin
........................................
diff --git a/doc/fr/autogen/user/irc_commands.txt b/doc/fr/autogen/user/irc_commands.txt
index df6e5b67c..cbacf0d2c 100644
--- a/doc/fr/autogen/user/irc_commands.txt
+++ b/doc/fr/autogen/user/irc_commands.txt
@@ -133,6 +133,15 @@
nom_serveur: nom du serveur pour se déconnecter
........................................
+• *`/forcejoin`* `pseudo canal[,canal]`::
+
+........................................
+ force un utilisateur à rejoindre un ou plusieurs canaux
+
+ pseudo: pseudo
+ canal: canal
+........................................
+
• *`/halfop`* `[pseudo [pseudo]]`::
........................................
@@ -342,6 +351,15 @@
texte: texte à envoyer
........................................
+• *`/omode`* `mode canal`::
+
+........................................
+ changer le mode du canal, sans avoir le statut opérateur
+
+ canal: nom du canal
+ mode: mode pour le canal
+........................................
+
• *`/op`* `pseudo [pseudo]`::
........................................
diff --git a/doc/it/autogen/user/alias_commands.txt b/doc/it/autogen/user/alias_commands.txt
index 0f38ba089..76e0960f5 100644
--- a/doc/it/autogen/user/alias_commands.txt
+++ b/doc/it/autogen/user/alias_commands.txt
@@ -1,23 +1,32 @@
-• *`/alias`* `[nome_alias [comando [argomenti]]]`::
+• *`/alias`* `[[-completion completion] alias_name [command [arguments]]]`::
........................................
crea un alias per un comando
- nome_alias: nome di un alias (può iniziare o terminare con "*" per un elenco di alias)
- comando: nome comando (più comandi possono essere separati da punto e virgola)
- argomenti: argomenti per un comando
+ completion: completion for alias (optional, by default completion is done with target command)
+ alias_name: name of alias (can start or end with "*" for alias listing)
+ command: command name (many commands can be separated by semicolons)
+ arguments: arguments for command
- Senza argomanto, questo comando elenca tutti gli alias definiti.
+ Without argument, this command lists all defined alias.
- Nota: nel comando, le variabii speciali vengono sostituite:
- $n: argomento 'n' (tra 1 e 9)
- $-m: argomenti da 1 a 'm'
- $n-: argomenti da 'n' alla fine
- $n-m: argomenti da 'n' a 'm'
- $*: tutti gli argomenti
- $~: ultimo argomento
- $nick: nick corrente
- $channel: canale corrente
- $server: server corrente
+ Note: in command, special variables are replaced:
+ $n: argument 'n' (between 1 and 9)
+ $-m: arguments from 1 to 'm'
+ $n-: arguments from 'n' to last
+ $n-m: arguments from 'n' to 'm'
+ $*: all arguments
+ $~: last argument
+ $nick: current nick
+ $channel: current channel
+ $server: current server
+
+ Examples:
+ alias /split to split window horizontally:
+ /alias split /window splith
+ alias /hello to say "hello" on all channels but not on #weechat:
+ /alias hello /allchan -exclude=#weechat msg * hello
+ alias /forcejoin to send IRC command "forcejoin" with completion of /sajoin:
+ /alias -completion %%sajoin /quote forcejoin
........................................
diff --git a/doc/it/autogen/user/irc_commands.txt b/doc/it/autogen/user/irc_commands.txt
index 81b550c7f..6a8cc708c 100644
--- a/doc/it/autogen/user/irc_commands.txt
+++ b/doc/it/autogen/user/irc_commands.txt
@@ -58,7 +58,7 @@
-all: connette a tutti i server
nome_server: nome interno del server a cui connettersi (il server deve essere stato creato con /server add)
-nojoin: non entrare in nessun canale (anche se l'ingresso automatico è attivo sul server)
- nome_host: nome host (oppure IP) del server
+ nome_host: nome host (oppure IP) del server
porta: porta per il server (6667 è la predefinita)
opzione: imposta opzione per il server (per le opzioni bool, il valore può essere omesso)
nooption: imposta il valore bool dell'opzione su off (per esempio: -nossl)
@@ -132,6 +132,15 @@
nome_server: nome del server da cui disconnettersi
........................................
+• *`/forcejoin`* `nick canale[,canale]`::
+
+........................................
+ forza un utente ad entrare su uno o più canali
+
+ nick: nick
+ canale: nome del canale
+........................................
+
• *`/halfop`* `[nick [nick]]`::
........................................
@@ -341,6 +350,15 @@
testo: testo da inviare
........................................
+• *`/omode`* `canale modalità`::
+
+........................................
+ cambia modalità sul canale, senza avere lo status di operatore
+
+ canale: nome del canale
+ modalità: modalità per il canale
+........................................
+
• *`/op`* `nick [nick]`::
........................................
diff --git a/po/POTFILES.in b/po/POTFILES.in
index cfffb1dfd..244ec9498 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -87,6 +87,8 @@
./src/gui/wxwidgets/gui-input.c
./src/plugins/alias/alias.c
./src/plugins/alias/alias.h
+./src/plugins/alias/alias-config.c
+./src/plugins/alias/alias-config.h
./src/plugins/alias/alias-info.c
./src/plugins/alias/alias-info.h
./src/plugins/aspell/weechat-aspell.c
diff --git a/po/cs.po b/po/cs.po
index 09c826910..0e51e4061 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-03-05 10:43+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2435,6 +2435,10 @@ msgstr "%s%s: chyba, cyklický odkaz při volání aliasu \"%s\""
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: chyba vytváření aliasu \"%s\" => \"%s\""
+#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%sChyba: volba nastavení \"%s\" nenalezena"
+
#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Alias \"%s\" => \"%s\" vytvořen"
@@ -2457,13 +2461,21 @@ msgstr "%sAlias \"%s\" nenalezen"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" odebrán"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: chyba při vytváření konfiguračního souboru"
+
msgid "create an alias for a command"
msgstr "vytvoří alias pro příkaz"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[jméno_aliasu [příkaz [argumenty]]]"
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2479,7 +2491,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"jméno_aliasu: jméno aliasu (může začínat i končit \"*\" pro výpis aliasů)\n"
" příkaz: jméno příkazu (více příkazů se rozděluje středníky)\n"
@@ -2648,10 +2669,6 @@ msgstr "%s%s: špatný typ znakové sady (očekáváno decode nebo encode)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: nekorektní znaková sada: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: chyba při vytváření konfiguračního souboru"
-
msgid "change charset for current buffer"
msgstr "změní znakovou sadu aktuálního bufferu"
@@ -3242,6 +3259,19 @@ msgstr ""
" -all: odpojit od všech serverů\n"
"jméno_serveru: jméno serveru pro odpojení"
+msgid "forces a user to join channel(s)"
+msgstr "násilně připojit uživatele ke kanálu/kanálům"
+
+msgid "nickname channel[,channel]"
+msgstr "přezdívka kanál[,kanál]"
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+"přezdívka: přezdívka\n"
+" kanál: jméno kanálu"
+
msgid "give half channel operator status to nickname(s)"
msgstr "dát přezdívce (přezdívkám) status polovičního operátora kanálu"
@@ -3540,6 +3570,21 @@ msgstr ""
"přezdívka: uživatel, kterému poslat notifikaci\n"
" text: text, který poslat"
+msgid "change mode on channel, without having operator status"
+msgstr "změnit mód kanálu, bez nutnosti mít operátorské oprávnění"
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr "kanál mód"
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"kanál: jméno kanálu\n"
+" mód: mód pro kanál"
+
msgid "give channel operator status to nickname(s)"
msgstr "dát status operátora kanálu přezdívce (přezdívkám)"
@@ -3644,34 +3689,6 @@ msgstr "volba: extra volba pro některé servery"
msgid "tell the server to restart itself"
msgstr "říct serveru, aby se restartoval"
-msgid "forces a user to join channel(s)"
-msgstr "násilně připojit uživatele ke kanálu/kanálům"
-
-msgid "nickname channel[,channel]"
-msgstr "přezdívka kanál[,kanál]"
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-"přezdívka: přezdívka\n"
-" kanál: jméno kanálu"
-
-msgid "change mode on channel, without having operator status"
-msgstr "změnit mód kanálu, bez nutnosti mít operátorské oprávnění"
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr "kanál mód"
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"kanál: jméno kanálu\n"
-" mód: mód pro kanál"
-
msgid "forces a user to use another nick"
msgstr "násilně přinutit uživatele používat jinou přezdívku"
diff --git a/po/de.po b/po/de.po
index 90782dadb..9a945f985 100644
--- a/po/de.po
+++ b/po/de.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-21 10:01+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-03-20 22:35+0100\n"
"Last-Translator: Nils G <weechatter@arcor.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2541,6 +2541,10 @@ msgstr "%s%s: Fehler, Zirkelbezug beim Aufruf des Aliases \"%s\""
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: Fehler beim erstellen von alias \"%s\" => \"%s\""
+#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%sFehler: Konfigurationsoption \"%s\" nicht gefunden"
+
#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Alias \"%s\" => \"%s\" angelegt"
@@ -2563,13 +2567,21 @@ msgstr "%sAlias \"%s\" nicht gefunden"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" entfernt"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: Fehler beim Erstellen einer Konfigurationsdatei"
+
msgid "create an alias for a command"
msgstr "Einem Befehl wird ein Alias zugewiesen"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[Aliasname [Befehl [Argumente]]]"
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2585,7 +2597,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"alias_name: Name des Alias (kann mit Joker \"*\" beginnen oder enden für "
"Alias-Listing)\n"
@@ -2768,10 +2789,6 @@ msgstr "%s%s: Falscher Zeichensatz (De-/Kodieren erwartet)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: Ungültiger Zeichensatz: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: Fehler beim Erstellen einer Konfigurationsdatei"
-
msgid "change charset for current buffer"
msgstr "ändere Zeichensatz für aktuellen Buffer"
diff --git a/po/es.po b/po/es.po
index 2af97c45c..3e6463842 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2456,6 +2456,10 @@ msgstr "%s%s: error, referencia circular al ejecutar el alias \"%s\""
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: error al crear el alias \"%s\" => \"%s\""
+#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%sError: opción de configuración \"%s\" no encontrada"
+
#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Alias \"%s\" => \"%s\" creado"
@@ -2478,13 +2482,21 @@ msgstr "%sAlias \"%s\" no encontrado"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" eliminado"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: error el crear el archivo de configuración"
+
msgid "create an alias for a command"
msgstr "crear un alias para un comando"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[nombre_alias [comando [argumentos]]]"
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2500,7 +2512,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"nombre_alias: nombre del sinónimo (puede empezar o terminar con \"*\" para "
"un listado)\n"
@@ -2674,10 +2695,6 @@ msgstr "%s%s: tipo de set de caracteres erróneo (se esperaba decode o encode)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: set de caracteres inválido: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: error el crear el archivo de configuración"
-
msgid "change charset for current buffer"
msgstr "cambiar el set de caracteres para el buffer actual"
@@ -3272,6 +3289,19 @@ msgstr ""
" -all: desconectarse de todos los servidores\n"
"servidor: nombre del servidor a desconectar"
+msgid "forces a user to join channel(s)"
+msgstr "fuerza un usuario a unirse a un canal o canales"
+
+msgid "nickname channel[,channel]"
+msgstr "apodo canal[,canal]"
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+"apodo: apodo\n"
+"canal: nombre del canal"
+
msgid "give half channel operator status to nickname(s)"
msgstr "dar el estado de semi-operador del canal a el/los apodo(s)"
@@ -3570,6 +3600,21 @@ msgstr ""
" apodo: apodo del destinatario\n"
" texto: texto a enviar"
+msgid "change mode on channel, without having operator status"
+msgstr "cambiar el modo del canal, sin tener el estado de operador"
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr "canal modo"
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"canal: nombre del canal\n"
+" modo: modo para el canal"
+
msgid "give channel operator status to nickname(s)"
msgstr "dar el estado de operador del canal a el/los usuario(s)"
@@ -3675,34 +3720,6 @@ msgstr "opción: opción extra, para algunos servidores"
msgid "tell the server to restart itself"
msgstr "pedir al servidor que se reinicie"
-msgid "forces a user to join channel(s)"
-msgstr "fuerza un usuario a unirse a un canal o canales"
-
-msgid "nickname channel[,channel]"
-msgstr "apodo canal[,canal]"
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-"apodo: apodo\n"
-"canal: nombre del canal"
-
-msgid "change mode on channel, without having operator status"
-msgstr "cambiar el modo del canal, sin tener el estado de operador"
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr "canal modo"
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"canal: nombre del canal\n"
-" modo: modo para el canal"
-
msgid "forces a user to use another nick"
msgstr "fuerza al usuario a usar otro apodo"
diff --git a/po/fr.po b/po/fr.po
index be3942d35..41b544c82 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
-"PO-Revision-Date: 2010-03-20 16:33+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
+"PO-Revision-Date: 2010-03-21 18:16+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -1430,12 +1430,9 @@ msgstr ""
" s: secondes (par défaut)\n"
" m: minutes\n"
" h: heures\n"
-"commande: commande à exécuter (ou texte à envoyer au tampon si la commande "
-"ne commence pas par '/')\n"
+"commande: commande à exécuter (ou texte à envoyer au tampon si la commande ne commence pas par '/')\n"
"\n"
-"Note: la commande est exécutée sur le tampon où /wait a été exécuté (si le "
-"tampon n'est pas trouvé, alors la commande est exécutée sur le tampon "
-"WeeChat principal).\n"
+"Note : la commande est exécutée sur le tampon où /wait a été exécuté (si le tampon n'est pas trouvé, alors la commande est exécutée sur le tampon WeeChat principal).\n"
"\n"
"Exemples:\n"
" rejoindre le canal dans 10 sec: /wait 10 /join #test\n"
@@ -2498,6 +2495,10 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: erreur en création de l'alias \"%s\" => \"%s\""
#, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%s%s: erreur de création de la complétion pour l'alias \"%s\": alias non trouvé"
+
+#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Alias \"%s\" => \"%s\" créé"
@@ -2519,13 +2520,20 @@ msgstr "%sAlias \"%s\" non trouvé"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" supprimé"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: erreur de création du fichier de configuration"
+
msgid "create an alias for a command"
msgstr "créer un alias pour une commande"
-msgid "[alias_name [command [arguments]]]"
-msgstr "[nom_alias [commande [paramètres]]]"
+msgid "[[-completion completion] alias_name [command [arguments]]]"
+msgstr "[[-completion complétion] nom_alias [commande [paramètres]]]"
+#, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2541,17 +2549,25 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
-msgstr ""
-" nom_alias: nom de l'alias (peut démarrer ou se terminer par \"*\" pour une "
-"liste d'alias)\n"
-" commande: nom de la commande (plusieurs commandes peuvent être séparées "
-"par des point-virgules)\n"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
+msgstr ""
+"complétion: complétion pour l'alias (optionnel, par défaut la complétion se fait avec la commande cible)\n"
+" nom_alias: nom de l'alias (peut démarrer ou se terminer par \"*\" pour une liste d'alias)\n"
+" commande: nom de la commande (plusieurs commandes peuvent être séparées par des point-virgules)\n"
"paramètres: paramètres pour la commande\n"
"\n"
"Sans paramètre, cette commande liste tous les alias définis.\n"
"\n"
-"Note: dans la commande, les variables spéciales sont remplacées :\n"
+"Note : dans la commande, les variables spéciales sont remplacées :\n"
" $n: paramètre 'n' (entre 1 et 9)\n"
" $-m: paramètres de 1 à 'm'\n"
" $n-: paramètres de 'n' au dernier\n"
@@ -2560,7 +2576,15 @@ msgstr ""
" $~: le dernier paramètre\n"
" $nick: pseudo courant\n"
" $channel: canal courant\n"
-" $server: serveur courant"
+" $server: serveur courant\n"
+"\n"
+"Exemples :\n"
+" alias /split pour diviser la fenêtre horizontalement :\n"
+" /alias split /window splith\n"
+" alias /hello pour dire \"hello\" sur tous les canaux mais pas sur #weechat :\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin pour envoyer la commande IRC \"forcejoin\" avec la complétion de /sajoin :\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgid "remove aliases"
msgstr "supprimer des alias"
@@ -2721,10 +2745,6 @@ msgstr "%s%s: mauvais type de charset (decode ou encode attendu)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: charset invalide: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: erreur de création du fichier de configuration"
-
msgid "change charset for current buffer"
msgstr "changer le charset pour le tampon courant"
@@ -3321,6 +3341,19 @@ msgstr ""
" -all: se déconnecter de tous les serveurs\n"
"nom_serveur: nom du serveur pour se déconnecter"
+msgid "forces a user to join channel(s)"
+msgstr "force un utilisateur à rejoindre un ou plusieurs canaux"
+
+msgid "nickname channel[,channel]"
+msgstr "pseudo canal[,canal]"
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+"pseudo: pseudo\n"
+" canal: canal"
+
msgid "give half channel operator status to nickname(s)"
msgstr "donner le statut de demi-opérateur à un/des pseudo(s)"
@@ -3621,6 +3654,21 @@ msgstr ""
" pseudo: pseudo cible pour la notice\n"
" texte: texte à envoyer"
+msgid "change mode on channel, without having operator status"
+msgstr "changer le mode du canal, sans avoir le statut opérateur"
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr "mode canal"
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"canal: nom du canal\n"
+" mode: mode pour le canal"
+
msgid "give channel operator status to nickname(s)"
msgstr "donner le statut opérateur à un/des pseudo(s)"
@@ -3727,34 +3775,6 @@ msgstr "option: option supplémentaire, pour certains serveurs"
msgid "tell the server to restart itself"
msgstr "demander au serveur de redémarrer"
-msgid "forces a user to join channel(s)"
-msgstr "force un utilisateur à rejoindre un ou plusieurs canaux"
-
-msgid "nickname channel[,channel]"
-msgstr "pseudo canal[,canal]"
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-"pseudo: pseudo\n"
-" canal: canal"
-
-msgid "change mode on channel, without having operator status"
-msgstr "changer le mode du canal, sans avoir le statut opérateur"
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr "mode canal"
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"canal: nom du canal\n"
-" mode: mode pour le canal"
-
msgid "forces a user to use another nick"
msgstr "force un utilisateur à utiliser un autre pseudo"
diff --git a/po/hu.po b/po/hu.po
index ca4a600ca..fed686187 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2356,6 +2356,10 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s nincs elég memória az információs pult üzenethez\n"
#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%s a \"%s\" opció nem található\n"
+
+#, fuzzy, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "A \"%s\" => \"%s\" aliasz elkészült\n"
@@ -2379,14 +2383,21 @@ msgstr "%s cím \"%s\" nem található\n"
msgid "Alias \"%s\" removed"
msgstr "A \"%s\" aliasz eltávolítva\n"
+#, fuzzy, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "szerver konfigurációs fájljának újraolvastatása"
+
msgid "create an alias for a command"
msgstr "alias készítése egy parancshoz"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[alias_név [parancs [paraméterek]]]"
-#, fuzzy
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2402,7 +2413,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
" alias_név: az alias neve\n"
" parancs: parancs neve (WeeChat vagy IRC parancs, több parancs "
@@ -2554,10 +2574,6 @@ msgstr ""
msgid "%s%s: invalid charset: \"%s\""
msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n"
-#, fuzzy, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "szerver konfigurációs fájljának újraolvastatása"
-
#, fuzzy
msgid "change charset for current buffer"
msgstr "szobanév nem található a pufferhez"
@@ -3121,6 +3137,22 @@ msgstr ""
"szervernév: belső szervernév amivel a kapcsolatot bontja"
#, fuzzy
+msgid "forces a user to join channel(s)"
+msgstr "felhasználó erőszakos eltávolítása a szobából"
+
+#, fuzzy
+msgid "nickname channel[,channel]"
+msgstr "név szoba"
+
+#, fuzzy
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+" név: meghívandó név\n"
+"szoba: meghívandó szoba"
+
+#, fuzzy
msgid "give half channel operator status to nickname(s)"
msgstr "féloperátori jog biztosítása a felhasználó(k)nak"
@@ -3399,6 +3431,23 @@ msgstr ""
" név: felhasználó akinek az üzenetet küldjük\n"
"szöveg: az üzenet szövege"
+msgid "change mode on channel, without having operator status"
+msgstr ""
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+#, fuzzy
+msgid "channel mode"
+msgstr "%d szoba"
+
+#, fuzzy
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"szoba: a szoba neve, ahová csatlakozni szeretnénk\n"
+"kulcs: a csatlakozáshoz szükséges kulcs"
+
#, fuzzy
msgid "give channel operator status to nickname(s)"
msgstr "operátori jogok biztosítása felhasználó(k)nak"
@@ -3507,39 +3556,6 @@ msgid "tell the server to restart itself"
msgstr "szerver újraindítása"
#, fuzzy
-msgid "forces a user to join channel(s)"
-msgstr "felhasználó erőszakos eltávolítása a szobából"
-
-#, fuzzy
-msgid "nickname channel[,channel]"
-msgstr "név szoba"
-
-#, fuzzy
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-" név: meghívandó név\n"
-"szoba: meghívandó szoba"
-
-msgid "change mode on channel, without having operator status"
-msgstr ""
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-#, fuzzy
-msgid "channel mode"
-msgstr "%d szoba"
-
-#, fuzzy
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"szoba: a szoba neve, ahová csatlakozni szeretnénk\n"
-"kulcs: a csatlakozáshoz szükséges kulcs"
-
-#, fuzzy
msgid "forces a user to use another nick"
msgstr "felhasználó erőszakos eltávolítása a szobából"
diff --git a/po/it.po b/po/it.po
index 35313c680..07e11b0c5 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Weechat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
-"PO-Revision-Date: 2010-02-23 10:43+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
+"PO-Revision-Date: 2010-03-21 16:48+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -2453,6 +2453,10 @@ msgstr "%s%s: errore, riferimento circolare alla chiamata dell'alias \"%s\""
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: errore nella creazione dell'alias \"%s\" => \"%s\""
+#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%sErrore: opzione di configurazione \"%s\" non trovata"
+
#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Alias \"%s\" => \"%s\" creato"
@@ -2475,13 +2479,21 @@ msgstr "%sAlias \"%s\" non trovato"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" eliminato"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: impossibile creare il file di configurazione"
+
msgid "create an alias for a command"
msgstr "crea un alias per un comando"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[nome_alias [comando [argomenti]]]"
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2497,7 +2509,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"nome_alias: nome di un alias (può iniziare o terminare con \"*\" per un "
"elenco di alias)\n"
@@ -2674,10 +2695,6 @@ msgstr "%s%s: tipo set di caratteri errato (decodifica o codifica attesa)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: set di caratter invalido: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: impossibile creare il file di configurazione"
-
msgid "change charset for current buffer"
msgstr "modifica il set di caratteri per il buffer corrente"
@@ -3185,16 +3202,12 @@ msgid ""
" /connect my.server.org/6697 -ssl -password=test"
msgstr ""
" -all: connette a tutti i server\n"
-"nome_server: nome interno del server a cui connettersi (il server deve "
-"essere stato creato con /server add)\n"
-" -nojoin: non entrare in nessun canale (anche se l'ingresso automatico è "
-"attivo sul server)\n"
-" nome_host: nome host (oppure IP) del server \n"
+"nome_server: nome interno del server a cui connettersi (il server deve essere stato creato con /server add)\n"
+" -nojoin: non entrare in nessun canale (anche se l'ingresso automatico è attivo sul server)\n"
+" nome_host: nome host (oppure IP) del server\n"
" porta: porta per il server (6667 è la predefinita)\n"
-" opzione: imposta opzione per il server (per le opzioni bool, il valore "
-"può essere omesso)\n"
-" nooption: imposta il valore bool dell'opzione su off (per esempio: -"
-"nossl)\n"
+" opzione: imposta opzione per il server (per le opzioni bool, il valore può essere omesso)\n"
+" nooption: imposta il valore bool dell'opzione su off (per esempio: -nossl)\n"
"Esempi:\n"
" /connect freenode\n"
" /connect irc.oftc.net/6667\n"
@@ -3273,6 +3286,19 @@ msgstr ""
" -all: disconnetti da tutti i server\n"
"nome_server: nome del server da cui disconnettersi"
+msgid "forces a user to join channel(s)"
+msgstr "forza un utente ad entrare su uno o più canali"
+
+msgid "nickname channel[,channel]"
+msgstr "nick canale[,canale]"
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+" nick: nick\n"
+"canale: nome del canale"
+
msgid "give half channel operator status to nickname(s)"
msgstr "concede lo stato di halfop ad uno (o più) nick"
@@ -3571,6 +3597,21 @@ msgstr ""
" nick: utente a cui inviare la notifica\n"
" testo: testo da inviare"
+msgid "change mode on channel, without having operator status"
+msgstr "cambia modalità sul canale, senza avere lo status di operatore"
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr "canale modalità"
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"canale: nome del canale\n"
+"modalità: modalità per il canale"
+
msgid "give channel operator status to nickname(s)"
msgstr "concede lo stato di operatore del canale al(ai) nick"
@@ -3676,34 +3717,6 @@ msgstr "opzione: opzione extra, per alcuni server"
msgid "tell the server to restart itself"
msgstr "chiede al server di riavviarsi"
-msgid "forces a user to join channel(s)"
-msgstr "forza un utente ad entrare su uno o più canali"
-
-msgid "nickname channel[,channel]"
-msgstr "nick canale[,canale]"
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-" nick: nick\n"
-"canale: nome del canale"
-
-msgid "change mode on channel, without having operator status"
-msgstr "cambia modalità sul canale, senza avere lo status di operatore"
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr "canale modalità"
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"canale: nome del canale\n"
-"modalità: modalità per il canale"
-
msgid "forces a user to use another nick"
msgstr "forza un utente ad utilizzare un altro nick"
diff --git a/po/pl.po b/po/pl.po
index 71d04f166..c5bf1d765 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: Polish\n"
@@ -2464,6 +2464,10 @@ msgstr "%s%s: błąd, cykliczna referencja przy wywoływaniu aliasu \"%s\""
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: błąd podczas tworzenia aliasu \"%s\" => \"%s\""
+#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%sBłąd: nie znaleziono opcji konfiguracyjnej \"%s\" "
+
#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Utworzono alias \"%s\" => \"%s\" "
@@ -2486,13 +2490,21 @@ msgstr "%sAlias \"%s\" nie został znaleziony"
msgid "Alias \"%s\" removed"
msgstr "Alias \"%s\" został usunięty"
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "%s%s: błąd podczas tworzenia pliku konfiguracyjnego"
+
msgid "create an alias for a command"
msgstr "tworzy alias do komendy"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[nazwa_aliasu [komenda [argumenty]]]"
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2508,7 +2520,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"nazwa_aliasu: nazwa aliasu (może się zaczynać lub kończyć \"*\" dla "
"wyświetlenia listy aliasów)\n"
@@ -2680,10 +2701,6 @@ msgstr "%s%s: złe kodowanie (oczekiwano decode lub encode)"
msgid "%s%s: invalid charset: \"%s\""
msgstr "%s%s: nieprawidłowe kodowanie: \"%s\""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "%s%s: błąd podczas tworzenia pliku konfiguracyjnego"
-
msgid "change charset for current buffer"
msgstr "zmienia kodowanie dla obecnego bufora"
@@ -3276,6 +3293,19 @@ msgstr ""
" -all: rozłącza się ze wszystkimi serwerami\n"
"nazwa_serwera: nazwa serwera(ów) do rozłączenia"
+msgid "forces a user to join channel(s)"
+msgstr "zmusza użytkownika do wejścia na kanał(y)"
+
+msgid "nickname channel[,channel]"
+msgstr "nick kanał[,kanał]"
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+"nick: nick\n"
+" kanał: nazwa kanału"
+
msgid "give half channel operator status to nickname(s)"
msgstr "nadaje status półoperatora (halfopa)"
@@ -3575,6 +3605,21 @@ msgstr ""
"nick: użytkownik, do którego wysłac powiadomienie\n"
" tekst: treść"
+msgid "change mode on channel, without having operator status"
+msgstr "zmienia atrybuty kanału, bez posiadania statusu operatora"
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr "kanał atrybuty"
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"kanał: nazwa kanału\n"
+" atrybuty: atrybuty kanału"
+
msgid "give channel operator status to nickname(s)"
msgstr "nadaje uprawienia użytkownika kanału"
@@ -3679,34 +3724,6 @@ msgstr "opcje: dodatkowe opcje, dla niektórych serwerów"
msgid "tell the server to restart itself"
msgstr "mówi serwerowi, aby się ponownie uruchomił"
-msgid "forces a user to join channel(s)"
-msgstr "zmusza użytkownika do wejścia na kanał(y)"
-
-msgid "nickname channel[,channel]"
-msgstr "nick kanał[,kanał]"
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-"nick: nick\n"
-" kanał: nazwa kanału"
-
-msgid "change mode on channel, without having operator status"
-msgstr "zmienia atrybuty kanału, bez posiadania statusu operatora"
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr "kanał atrybuty"
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"kanał: nazwa kanału\n"
-" atrybuty: atrybuty kanału"
-
msgid "forces a user to use another nick"
msgstr "zmusza użytkownika do użycia innego nicku"
diff --git a/po/ru.po b/po/ru.po
index 1e492d567..f2f2659ad 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: 2010-02-23 10:43+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2368,6 +2368,10 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s недостаточно памяти для сообщения в строке информации\n"
#, fuzzy, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr "%s параметр конфигурации \"%s\" не найден\n"
+
+#, fuzzy, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr "Сокращение \"%s\" => \"%s\" создано\n"
@@ -2391,14 +2395,21 @@ msgstr "%s адрес \"%s\" не найден\n"
msgid "Alias \"%s\" removed"
msgstr "Сокращение \"%s\" удалено\n"
+#, fuzzy, c-format
+msgid "%s%s: error creating configuration file"
+msgstr "перезагрузить конфигурационный файл сервера"
+
msgid "create an alias for a command"
msgstr "создать ярлык на команду"
-msgid "[alias_name [command [arguments]]]"
+#, fuzzy
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr "[сокращение [команда [аргументы]]]"
-#, fuzzy
+#, fuzzy, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2414,7 +2425,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
"сокращение: название сокращения\n"
" команда: название команды (команда WeeChat или IRC, несколько команд "
@@ -2565,10 +2585,6 @@ msgstr ""
msgid "%s%s: invalid charset: \"%s\""
msgstr "Не могу записать лог-файл \"%s\"\n"
-#, fuzzy, c-format
-msgid "%s%s: error creating configuration file"
-msgstr "перезагрузить конфигурационный файл сервера"
-
#, fuzzy
msgid "change charset for current buffer"
msgstr "не найдено имя канала для буфера"
@@ -3132,6 +3148,22 @@ msgstr ""
"сервер: название сервера для отключения"
#, fuzzy
+msgid "forces a user to join channel(s)"
+msgstr "принудительно удалить пользователя с канала"
+
+#, fuzzy
+msgid "nickname channel[,channel]"
+msgstr "ник канал"
+
+#, fuzzy
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+" ник: приглашаемый ник\n"
+"канал: целевой канал"
+
+#, fuzzy
msgid "give half channel operator status to nickname(s)"
msgstr "даёт статус полу-оператора канала пользователю(-ям)"
@@ -3408,6 +3440,23 @@ msgstr ""
" ник: адресат уведомления\n"
"текст: отправляемый текст"
+msgid "change mode on channel, without having operator status"
+msgstr ""
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+#, fuzzy
+msgid "channel mode"
+msgstr "%d канал"
+
+#, fuzzy
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+"канал: название канала\n"
+" ключ: ключ для входа на канал"
+
#, fuzzy
msgid "give channel operator status to nickname(s)"
msgstr "даёт статус оператора канала нику(-ам)"
@@ -3515,39 +3564,6 @@ msgid "tell the server to restart itself"
msgstr "перезагрузить сервер"
#, fuzzy
-msgid "forces a user to join channel(s)"
-msgstr "принудительно удалить пользователя с канала"
-
-#, fuzzy
-msgid "nickname channel[,channel]"
-msgstr "ник канал"
-
-#, fuzzy
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-" ник: приглашаемый ник\n"
-"канал: целевой канал"
-
-msgid "change mode on channel, without having operator status"
-msgstr ""
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-#, fuzzy
-msgid "channel mode"
-msgstr "%d канал"
-
-#, fuzzy
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-"канал: название канала\n"
-" ключ: ключ для входа на канал"
-
-#, fuzzy
msgid "forces a user to use another nick"
msgstr "принудительно удалить пользователя с канала"
diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake
index 2f24eb498..913913a67 100644
--- a/po/srcfiles.cmake
+++ b/po/srcfiles.cmake
@@ -88,6 +88,8 @@ SET(WEECHAT_SOURCES
./src/gui/wxwidgets/gui-input.c
./src/plugins/alias/alias.c
./src/plugins/alias/alias.h
+./src/plugins/alias/alias-config.c
+./src/plugins/alias/alias-config.h
./src/plugins/alias/alias-info.c
./src/plugins/alias/alias-info.h
./src/plugins/aspell/weechat-aspell.c
diff --git a/po/weechat.pot b/po/weechat.pot
index f9b85835e..85d871a79 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-03-20 17:06+0100\n"
+"POT-Creation-Date: 2010-03-21 16:05+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2019,6 +2019,10 @@ msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr ""
#, c-format
+msgid "%s%s: error creating completion for alias \"%s\": alias not found"
+msgstr ""
+
+#, c-format
msgid "Alias \"%s\" => \"%s\" created"
msgstr ""
@@ -2040,13 +2044,20 @@ msgstr ""
msgid "Alias \"%s\" removed"
msgstr ""
+#, c-format
+msgid "%s%s: error creating configuration file"
+msgstr ""
+
msgid "create an alias for a command"
msgstr ""
-msgid "[alias_name [command [arguments]]]"
+msgid "[[-completion completion] alias_name [command [arguments]]]"
msgstr ""
+#, c-format
msgid ""
+"completion: completion for alias (optional, by default completion is done "
+"with target command)\n"
"alias_name: name of alias (can start or end with \"*\" for alias listing)\n"
" command: command name (many commands can be separated by semicolons)\n"
" arguments: arguments for command\n"
@@ -2062,7 +2073,16 @@ msgid ""
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
-" $server: current server"
+" $server: current server\n"
+"\n"
+"Examples:\n"
+" alias /split to split window horizontally:\n"
+" /alias split /window splith\n"
+" alias /hello to say \"hello\" on all channels but not on #weechat:\n"
+" /alias hello /allchan -exclude=#weechat msg * hello\n"
+" alias /forcejoin to send IRC command \"forcejoin\" with completion of /"
+"sajoin:\n"
+" /alias -completion %%sajoin /quote forcejoin"
msgstr ""
msgid "remove aliases"
@@ -2199,10 +2219,6 @@ msgstr ""
msgid "%s%s: invalid charset: \"%s\""
msgstr ""
-#, c-format
-msgid "%s%s: error creating configuration file"
-msgstr ""
-
msgid "change charset for current buffer"
msgstr ""
@@ -2714,6 +2730,17 @@ msgid ""
"servername: server name to disconnect"
msgstr ""
+msgid "forces a user to join channel(s)"
+msgstr ""
+
+msgid "nickname channel[,channel]"
+msgstr ""
+
+msgid ""
+"nickname: nickname\n"
+" channel: channel name"
+msgstr ""
+
msgid "give half channel operator status to nickname(s)"
msgstr ""
@@ -2940,6 +2967,19 @@ msgid ""
" text: text to send"
msgstr ""
+msgid "change mode on channel, without having operator status"
+msgstr ""
+
+#. TRANSLATORS: "channel" and "mode" are arguments
+#. for command, translate them separately
+msgid "channel mode"
+msgstr ""
+
+msgid ""
+"channel: channel name\n"
+" mode: mode for channel"
+msgstr ""
+
msgid "give channel operator status to nickname(s)"
msgstr ""
@@ -3029,30 +3069,6 @@ msgstr ""
msgid "tell the server to restart itself"
msgstr ""
-msgid "forces a user to join channel(s)"
-msgstr ""
-
-msgid "nickname channel[,channel]"
-msgstr ""
-
-msgid ""
-"nickname: nickname\n"
-" channel: channel name"
-msgstr ""
-
-msgid "change mode on channel, without having operator status"
-msgstr ""
-
-#. TRANSLATORS: "channel" and "mode" are arguments
-#. for command, translate them separately
-msgid "channel mode"
-msgstr ""
-
-msgid ""
-"channel: channel name\n"
-" mode: mode for channel"
-msgstr ""
-
msgid "forces a user to use another nick"
msgstr ""
diff --git a/src/plugins/alias/CMakeLists.txt b/src/plugins/alias/CMakeLists.txt
index 04c4ef945..b9b0c0b05 100644
--- a/src/plugins/alias/CMakeLists.txt
+++ b/src/plugins/alias/CMakeLists.txt
@@ -16,6 +16,7 @@
ADD_LIBRARY(alias MODULE
alias.c alias.h
+alias-config.c alias-config.h
alias-info.c alias-info.h)
SET_TARGET_PROPERTIES(alias PROPERTIES PREFIX "")
diff --git a/src/plugins/alias/Makefile.am b/src/plugins/alias/Makefile.am
index 785fa237c..511109f3d 100644
--- a/src/plugins/alias/Makefile.am
+++ b/src/plugins/alias/Makefile.am
@@ -22,6 +22,8 @@ lib_LTLIBRARIES = alias.la
alias_la_SOURCES = alias.c \
alias.h \
+ alias-config.c \
+ alias-config.h \
alias-info.c \
alias-info.h
alias_la_LDFLAGS = -module
diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c
new file mode 100644
index 000000000..4657a7d1c
--- /dev/null
+++ b/src/plugins/alias/alias-config.c
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2003-2010 by FlashCode <flashcode@flashtux.org>
+ * See README for License detail, AUTHORS for developers list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* alias-config.c: alias configuration options */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "../weechat-plugin.h"
+#include "alias.h"
+
+
+struct t_config_file *alias_config_file = NULL;
+struct t_config_section *alias_config_section_cmd = NULL;
+struct t_config_section *alias_config_section_completion = NULL;
+
+
+/*
+ * alias_config_cmd_change_cb: callback called when alias option is modified
+ * in section "cmd" (command)
+ */
+
+void
+alias_config_cmd_change_cb (void *data, struct t_config_option *option)
+{
+ struct t_config_option *ptr_option_completion;
+
+ /* make C compiler happy */
+ (void) data;
+
+ ptr_option_completion = weechat_config_search_option (alias_config_file,
+ alias_config_section_completion,
+ weechat_config_option_get_pointer (option, "name"));
+
+ alias_new (weechat_config_option_get_pointer (option, "name"),
+ weechat_config_option_get_pointer (option, "value"),
+ (ptr_option_completion) ?
+ weechat_config_option_get_pointer (ptr_option_completion, "value") : NULL);
+}
+
+/*
+ * alias_config_cmd_delete_cb: callback called when alias option is deleted
+ * in section "cmd" (command)
+ */
+
+void
+alias_config_cmd_delete_cb (void *data, struct t_config_option *option)
+{
+ struct t_config_option *ptr_option_completion;
+ struct t_alias *ptr_alias;
+
+ /* make C compiler happy */
+ (void) data;
+
+ ptr_option_completion = weechat_config_search_option (alias_config_file,
+ alias_config_section_completion,
+ weechat_config_option_get_pointer (option, "name"));
+
+ ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
+ if (ptr_alias)
+ alias_free (ptr_alias);
+
+ if (ptr_option_completion)
+ weechat_config_option_free (ptr_option_completion);
+}
+
+/*
+ * alias_config_completion_change_cb: callback called when alias completion is
+ * modified in section "completion"
+ */
+
+void
+alias_config_completion_change_cb (void *data, struct t_config_option *option)
+{
+ struct t_alias *ptr_alias;
+
+ /* make C compiler happy */
+ (void) data;
+
+ ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
+ if (ptr_alias && ptr_alias->hook)
+ {
+ alias_update_completion (ptr_alias,
+ weechat_config_option_get_pointer (option, "value"));
+ }
+}
+
+/*
+ * alias_config_completion_delete_cb: callback called when alias completion is
+ * deleted in section "completion"
+ */
+
+void
+alias_config_completion_delete_cb (void *data, struct t_config_option *option)
+{
+ struct t_alias *ptr_alias;
+
+ /* make C compiler happy */
+ (void) data;
+
+ ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
+ if (ptr_alias && ptr_alias->hook && ptr_alias->completion)
+ {
+ alias_update_completion (ptr_alias, NULL);
+ }
+}
+
+/*
+ * alias_config_reload: reload alias configuration file
+ */
+
+int
+alias_config_reload (void *data, struct t_config_file *config_file)
+{
+ /* make C compiler happy */
+ (void) data;
+
+ weechat_config_section_free_options (alias_config_section_cmd);
+ weechat_config_section_free_options (alias_config_section_completion);
+ alias_free_all ();
+
+ return weechat_config_reload (config_file);
+}
+
+/*
+ * alias_config_cmd_write_default_cb: write default aliases in configuration
+ * file in section "cmd" (command)
+ */
+
+void
+alias_config_cmd_write_default_cb (void *data,
+ struct t_config_file *config_file,
+ const char *section_name)
+{
+ /* make C compiler happy */
+ (void) data;
+
+ weechat_config_write_line (config_file, section_name, NULL);
+
+ weechat_config_write_line (config_file, "AAWAY", "%s", "\"allserv /away\"");
+ weechat_config_write_line (config_file, "AME", "%s", "\"allchan /me\"");
+ weechat_config_write_line (config_file, "AMSG", "%s", "\"allchan /msg *\"");
+ weechat_config_write_line (config_file, "ANICK", "%s", "\"allserv /nick\"");
+ weechat_config_write_line (config_file, "BYE", "%s", "\"quit\"");
+ weechat_config_write_line (config_file, "C", "%s", "\"buffer clear\"");
+ weechat_config_write_line (config_file, "CL", "%s", "\"buffer clear\"");
+ weechat_config_write_line (config_file, "CLOSE", "%s", "\"buffer close\"");
+ weechat_config_write_line (config_file, "CHAT", "%s", "\"dcc chat\"");
+ weechat_config_write_line (config_file, "EXIT", "%s", "\"quit\"");
+ weechat_config_write_line (config_file, "IG", "%s", "\"ignore\"");
+ weechat_config_write_line (config_file, "J", "%s", "\"join\"");
+ weechat_config_write_line (config_file, "K", "%s", "\"kick\"");
+ weechat_config_write_line (config_file, "KB", "%s", "\"kickban\"");
+ weechat_config_write_line (config_file, "LEAVE", "%s", "\"part\"");
+ weechat_config_write_line (config_file, "M", "%s", "\"msg\"");
+ weechat_config_write_line (config_file, "MUB", "%s", "\"unban *\"");
+ weechat_config_write_line (config_file, "N", "%s", "\"names\"");
+ weechat_config_write_line (config_file, "Q", "%s", "\"query\"");
+ weechat_config_write_line (config_file, "REDRAW", "%s", "\"window refresh\"");
+ weechat_config_write_line (config_file, "SAY", "%s", "\"msg *\"");
+ weechat_config_write_line (config_file, "SIGNOFF", "%s", "\"quit\"");
+ weechat_config_write_line (config_file, "T", "%s", "\"topic\"");
+ weechat_config_write_line (config_file, "UB", "%s", "\"unban\"");
+ weechat_config_write_line (config_file, "V", "%s", "\"command core version\"");
+ weechat_config_write_line (config_file, "W", "%s", "\"who\"");
+ weechat_config_write_line (config_file, "WC", "%s", "\"window merge\"");
+ weechat_config_write_line (config_file, "WI", "%s", "\"whois\"");
+ weechat_config_write_line (config_file, "WII", "%s", "\"whois $1 $1\"");
+ weechat_config_write_line (config_file, "WW", "%s", "\"whowas\"");
+}
+
+/*
+ * alias_config_cmd_new_option: create new option in section "cmd" (command)
+ */
+
+void
+alias_config_cmd_new_option (const char *name, const char *command)
+{
+ weechat_config_new_option (alias_config_file, alias_config_section_cmd,
+ name, "string", NULL,
+ NULL, 0, 0, "", command, 0,
+ NULL, NULL,
+ &alias_config_cmd_change_cb, NULL,
+ &alias_config_cmd_delete_cb, NULL);
+}
+
+/*
+ * alias_config_cmd_create_option_cb: create an alias in section "cmd"
+ * (command)
+ */
+
+int
+alias_config_cmd_create_option_cb (void *data,
+ struct t_config_file *config_file,
+ struct t_config_section *section,
+ const char *option_name, const char *value)
+{
+ struct t_alias *ptr_alias;
+ int rc;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) config_file;
+ (void) section;
+
+ rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
+
+ /* create config option */
+ alias_config_cmd_new_option (option_name, value);
+
+ /* create alias */
+ ptr_alias = alias_search (option_name);
+ if (ptr_alias)
+ alias_free (ptr_alias);
+ if (value && value[0])
+ rc = (alias_new (option_name, value, NULL)) ?
+ WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
+ else
+ rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
+
+ if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR)
+ {
+ weechat_printf (NULL,
+ _("%s%s: error creating alias \"%s\" => \"%s\""),
+ weechat_prefix ("error"), ALIAS_PLUGIN_NAME,
+ option_name, value);
+ }
+
+ return rc;
+}
+
+/*
+ * alias_config_completion_new_option: create new option in section "completion"
+ */
+
+void
+alias_config_completion_new_option (const char *name, const char *completion)
+{
+ weechat_config_new_option (alias_config_file,
+ alias_config_section_completion,
+ name, "string", NULL,
+ NULL, 0, 0, "", completion, 0,
+ NULL, NULL,
+ &alias_config_completion_change_cb, NULL,
+ &alias_config_completion_delete_cb, NULL);
+}
+
+/*
+ * alias_config_completion_create_option_cb: create a completion for an alias
+ * in section "completion"
+ */
+
+int
+alias_config_completion_create_option_cb (void *data,
+ struct t_config_file *config_file,
+ struct t_config_section *section,
+ const char *option_name,
+ const char *value)
+{
+ struct t_alias *ptr_alias;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) config_file;
+ (void) section;
+
+ ptr_alias = alias_search (option_name);
+ if (!ptr_alias)
+ {
+ weechat_printf (NULL,
+ _("%s%s: error creating completion for alias \"%s\": "
+ "alias not found"),
+ weechat_prefix ("error"), ALIAS_PLUGIN_NAME,
+ option_name);
+ return WEECHAT_CONFIG_OPTION_SET_ERROR;
+ }
+
+ /* create config option */
+ alias_config_completion_new_option (option_name, value);
+
+ /* create/update completion in alias */
+ alias_update_completion (ptr_alias, value);
+
+ return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
+}
+
+/*
+ * alias_config_init: init alias configuration file
+ * return: 1 if ok, 0 if error
+ */
+
+int
+alias_config_init ()
+{
+ struct t_config_section *ptr_section;
+
+ alias_config_file = weechat_config_new (ALIAS_CONFIG_NAME,
+ &alias_config_reload, NULL);
+ if (!alias_config_file)
+ return 0;
+
+ ptr_section = weechat_config_new_section (alias_config_file, "cmd",
+ 1, 1,
+ NULL, NULL,
+ NULL, NULL,
+ &alias_config_cmd_write_default_cb, NULL,
+ &alias_config_cmd_create_option_cb, NULL,
+ NULL, NULL);
+ if (!ptr_section)
+ {
+ weechat_config_free (alias_config_file);
+ return 0;
+ }
+ alias_config_section_cmd = ptr_section;
+
+ ptr_section = weechat_config_new_section (alias_config_file, "completion",
+ 1, 1,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ &alias_config_completion_create_option_cb, NULL,
+ NULL, NULL);
+ if (!ptr_section)
+ {
+ weechat_config_free (alias_config_file);
+ return 0;
+ }
+ alias_config_section_completion = ptr_section;
+
+ return 1;
+}
+
+/*
+ * alias_config_read: read alias configuration file
+ */
+
+int
+alias_config_read ()
+{
+ return weechat_config_read (alias_config_file);
+}
+
+/*
+ * alias_config_write: write alias configuration file
+ */
+
+int
+alias_config_write ()
+{
+ return weechat_config_write (alias_config_file);
+}
diff --git a/src/plugins/alias/alias-config.h b/src/plugins/alias/alias-config.h
new file mode 100644
index 000000000..b24427016
--- /dev/null
+++ b/src/plugins/alias/alias-config.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2003-2010 by FlashCode <flashcode@flashtux.org>
+ * See README for License detail, AUTHORS for developers list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef __WEECHAT_ALIAS_CONFIG_H
+#define __WEECHAT_ALIAS_CONFIG_H 1
+
+extern struct t_config_file *alias_config_file;
+extern struct t_config_section *alias_config_section_cmd;
+extern struct t_config_section *alias_config_section_completion;
+
+extern void alias_config_cmd_new_option (const char *name,
+ const char *command);
+extern void alias_config_completion_new_option (const char *name,
+ const char *completion);
+extern int alias_config_init ();
+extern int alias_config_read ();
+extern int alias_config_write ();
+
+#endif /* alias-config.h */
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c
index b59af9f83..9b9492d7e 100644
--- a/src/plugins/alias/alias.c
+++ b/src/plugins/alias/alias.c
@@ -25,6 +25,7 @@
#include "../weechat-plugin.h"
#include "alias.h"
+#include "alias-config.h"
#include "alias-info.h"
@@ -38,9 +39,6 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
struct t_weechat_plugin *weechat_alias_plugin = NULL;
-struct t_config_file *alias_config_file = NULL;
-struct t_config_section *alias_config_section_cmd = NULL;
-
struct t_alias *alias_list = NULL;
struct t_alias *last_alias = NULL;
@@ -331,7 +329,6 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
int some_args_replaced, length1, length2;
/* make C compiler happy */
- (void) argc;
(void) argv;
ptr_alias = (struct t_alias *)data;
@@ -450,6 +447,8 @@ alias_free (struct t_alias *alias)
free (alias->name);
if (alias->command)
free (alias->command);
+ if (alias->completion)
+ free (alias->completion);
free (alias);
alias_list = new_alias_list;
@@ -488,16 +487,70 @@ alias_find_pos (const char *name)
}
/*
+ * alias_hook_command: call weehat_hook_command() for an alias and store result
+ * in variable "hook" of alias
+ */
+
+void
+alias_hook_command (struct t_alias *alias)
+{
+ char *str_completion;
+ int length;
+
+ str_completion = NULL;
+
+ if (!alias->completion)
+ {
+ /*
+ * if alias has no custom completion, then default is to complete with
+ * completion template of target command, for example if alias is
+ * "/alias test /buffer", then str_completion will be "%%buffer"
+ */
+ length = 2 + strlen (alias->command) + 1;
+ str_completion = malloc (length);
+ if (str_completion)
+ {
+ snprintf (str_completion, length, "%%%%%s",
+ (weechat_string_is_command_char (alias->command)) ?
+ weechat_utf8_next_char (alias->command) : alias->command);
+ }
+ }
+
+ alias->hook = weechat_hook_command (alias->name, alias->command,
+ NULL, NULL,
+ (str_completion) ? str_completion : alias->completion,
+ &alias_cb, alias);
+
+ if (str_completion)
+ free (str_completion);
+}
+
+/*
+ * alias_update_completion: update completion for an alias
+ */
+
+void
+alias_update_completion (struct t_alias *alias, const char *completion)
+{
+ /* update completion in alias */
+ if (alias->completion)
+ free (alias->completion);
+ alias->completion = (completion) ? strdup (completion) : NULL;
+
+ /* unhook and hook again command, with new completion */
+ weechat_unhook (alias->hook);
+ alias->hook = NULL;
+ alias_hook_command (alias);
+}
+
+/*
* alias_new: create new alias and add it to alias list
*/
struct t_alias *
-alias_new (const char *name, const char *command)
+alias_new (const char *name, const char *command, const char *completion)
{
struct t_alias *new_alias, *ptr_alias, *pos_alias;
- struct t_hook *new_hook;
- char *str_completion;
- int length;
if (!name || !name[0] || !command || !command[0])
return NULL;
@@ -514,30 +567,14 @@ alias_new (const char *name, const char *command)
new_alias = malloc (sizeof (*new_alias));
if (new_alias)
{
- length = 2 + strlen (command) + 1;
- str_completion = malloc (length);
- if (str_completion)
- {
- snprintf (str_completion, length, "%%%%%s",
- (weechat_string_is_command_char (command)) ?
- weechat_utf8_next_char (command) : command);
- }
- new_hook = weechat_hook_command (name, command, NULL, NULL,
- (str_completion) ? str_completion : NULL,
- alias_cb, new_alias);
- if (str_completion)
- free (str_completion);
- if (!new_hook)
- {
- free (new_alias);
- return NULL;
- }
-
- new_alias->hook = new_hook;
+ new_alias->hook = NULL;
new_alias->name = strdup (name);
new_alias->command = strdup (command);
+ new_alias->completion = (completion) ? strdup (completion) : NULL;
new_alias->running = 0;
-
+
+ alias_hook_command (new_alias);
+
if (alias_list)
{
pos_alias = alias_find_pos (name);
@@ -607,199 +644,6 @@ alias_get_final_command (struct t_alias *alias)
}
/*
- * alias_config_change_cb: callback called when alias option is modified
- */
-
-void
-alias_config_change_cb (void *data, struct t_config_option *option)
-{
- /* make C compiler happy */
- (void) data;
-
- alias_new (weechat_config_option_get_pointer (option, "name"),
- weechat_config_option_get_pointer (option, "value"));
-}
-
-/*
- * alias_config_delete_cb: callback called when alias option is deleted
- */
-
-void
-alias_config_delete_cb (void *data, struct t_config_option *option)
-{
- struct t_alias *ptr_alias;
-
- /* make C compiler happy */
- (void) data;
-
- ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
- if (ptr_alias)
- alias_free (ptr_alias);
-}
-
-/*
- * alias_config_reload: reload alias configuration file
- */
-
-int
-alias_config_reload (void *data, struct t_config_file *config_file)
-{
- /* make C compiler happy */
- (void) data;
-
- weechat_config_section_free_options (alias_config_section_cmd);
- alias_free_all ();
-
- return weechat_config_reload (config_file);
-}
-
-/*
- * alias_config_write_default: write default aliases in configuration file
- */
-
-void
-alias_config_write_default (void *data,
- struct t_config_file *config_file,
- const char *section_name)
-{
- /* make C compiler happy */
- (void) data;
-
- weechat_config_write_line (config_file, section_name, NULL);
-
- weechat_config_write_line (config_file, "AAWAY", "%s", "\"allserv /away\"");
- weechat_config_write_line (config_file, "AME", "%s", "\"allchan /me\"");
- weechat_config_write_line (config_file, "AMSG", "%s", "\"allchan /msg *\"");
- weechat_config_write_line (config_file, "ANICK", "%s", "\"allserv /nick\"");
- weechat_config_write_line (config_file, "BYE", "%s", "\"quit\"");
- weechat_config_write_line (config_file, "C", "%s", "\"buffer clear\"");
- weechat_config_write_line (config_file, "CL", "%s", "\"buffer clear\"");
- weechat_config_write_line (config_file, "CLOSE", "%s", "\"buffer close\"");
- weechat_config_write_line (config_file, "CHAT", "%s", "\"dcc chat\"");
- weechat_config_write_line (config_file, "EXIT", "%s", "\"quit\"");
- weechat_config_write_line (config_file, "IG", "%s", "\"ignore\"");
- weechat_config_write_line (config_file, "J", "%s", "\"join\"");
- weechat_config_write_line (config_file, "K", "%s", "\"kick\"");
- weechat_config_write_line (config_file, "KB", "%s", "\"kickban\"");
- weechat_config_write_line (config_file, "LEAVE", "%s", "\"part\"");
- weechat_config_write_line (config_file, "M", "%s", "\"msg\"");
- weechat_config_write_line (config_file, "MUB", "%s", "\"unban *\"");
- weechat_config_write_line (config_file, "N", "%s", "\"names\"");
- weechat_config_write_line (config_file, "Q", "%s", "\"query\"");
- weechat_config_write_line (config_file, "REDRAW", "%s", "\"window refresh\"");
- weechat_config_write_line (config_file, "SAY", "%s", "\"msg *\"");
- weechat_config_write_line (config_file, "SIGNOFF", "%s", "\"quit\"");
- weechat_config_write_line (config_file, "T", "%s", "\"topic\"");
- weechat_config_write_line (config_file, "UB", "%s", "\"unban\"");
- weechat_config_write_line (config_file, "V", "%s", "\"command core version\"");
- weechat_config_write_line (config_file, "W", "%s", "\"who\"");
- weechat_config_write_line (config_file, "WC", "%s", "\"window merge\"");
- weechat_config_write_line (config_file, "WI", "%s", "\"whois\"");
- weechat_config_write_line (config_file, "WII", "%s", "\"whois $1 $1\"");
- weechat_config_write_line (config_file, "WW", "%s", "\"whowas\"");
-}
-
-/*
- * alias_config_create_option: create an alias
- */
-
-int
-alias_config_create_option (void *data, struct t_config_file *config_file,
- struct t_config_section *section,
- const char *option_name, const char *value)
-{
- struct t_alias *ptr_alias;
- int rc;
-
- /* make C compiler happy */
- (void) data;
-
- rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
-
- /* create config option */
- weechat_config_new_option (
- config_file, section,
- option_name, "string", NULL,
- NULL, 0, 0, "", value, 0,
- NULL, NULL,
- &alias_config_change_cb, NULL,
- &alias_config_delete_cb, NULL);
-
- /* create alias */
- ptr_alias = alias_search (option_name);
- if (ptr_alias)
- alias_free (ptr_alias);
- if (value && value[0])
- rc = (alias_new (option_name, value)) ?
- WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
- else
- rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
-
- if (rc == WEECHAT_CONFIG_OPTION_SET_ERROR)
- {
- weechat_printf (NULL,
- "%s%s: error creating alias \"%s\" => \"%s\"",
- weechat_prefix ("error"), ALIAS_PLUGIN_NAME,
- option_name, value);
- }
-
- return rc;
-}
-
-/*
- * alias_config_init: init alias configuration file
- * return: 1 if ok, 0 if error
- */
-
-int
-alias_config_init ()
-{
- struct t_config_section *ptr_section;
-
- alias_config_file = weechat_config_new (ALIAS_CONFIG_NAME,
- &alias_config_reload, NULL);
- if (!alias_config_file)
- return 0;
-
- ptr_section = weechat_config_new_section (alias_config_file, "cmd",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- &alias_config_write_default, NULL,
- &alias_config_create_option, NULL,
- NULL, NULL);
- if (!ptr_section)
- {
- weechat_config_free (alias_config_file);
- return 0;
- }
-
- alias_config_section_cmd = ptr_section;
-
- return 1;
-}
-
-/*
- * alias_config_read: read alias configuration file
- */
-
-int
-alias_config_read ()
-{
- return weechat_config_read (alias_config_file);
-}
-
-/*
- * alias_config_write: write alias configuration file
- */
-
-int
-alias_config_write ()
-{
- return weechat_config_write (alias_config_file);
-}
-
-/*
* alias_command_cb: display or create alias
*/
@@ -807,7 +651,7 @@ int
alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
- char *alias_name;
+ char *ptr_completion, *ptr_alias_name, *ptr_command;
struct t_alias *ptr_alias;
struct t_config_option *ptr_option;
int alias_found;
@@ -818,47 +662,71 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
if (argc > 1)
{
- alias_name = (weechat_string_is_command_char (argv[1])) ?
- weechat_utf8_next_char (argv[1]) : argv[1];
if (argc > 2)
{
- /* Define new alias */
- if (!alias_new (alias_name, argv_eol[2]))
+ /* get pointers to completion, alias name and command (+ args) */
+ ptr_completion = NULL;
+ ptr_alias_name = NULL;
+ ptr_command = NULL;
+ if ((argc > 4) && (weechat_strcasecmp (argv[1], "-completion") == 0))
+ {
+ ptr_completion = argv[2];
+ ptr_alias_name = (weechat_string_is_command_char (argv[3])) ?
+ weechat_utf8_next_char (argv[3]) : argv[3];
+ ptr_command = argv_eol[4];
+ }
+ else
+ {
+ ptr_alias_name = (weechat_string_is_command_char (argv[1])) ?
+ weechat_utf8_next_char (argv[1]) : argv[1];
+ ptr_command = argv_eol[2];
+ }
+
+ /* define new alias */
+ if (!alias_new (ptr_alias_name, ptr_command, ptr_completion))
{
weechat_printf (NULL,
_("%s%s: error creating alias \"%s\" "
"=> \"%s\""),
weechat_prefix ("error"), ALIAS_PLUGIN_NAME,
- alias_name, argv_eol[2]);
+ ptr_alias_name, ptr_command);
return WEECHAT_RC_ERROR;
}
- /* create config option */
+ /* create config option for command */
ptr_option = weechat_config_search_option (alias_config_file,
alias_config_section_cmd,
- alias_name);
+ ptr_alias_name);
+ if (ptr_option)
+ weechat_config_option_free (ptr_option);
+ alias_config_cmd_new_option (ptr_alias_name, ptr_command);
+
+ /* create config option for completion */
+ ptr_option = weechat_config_search_option (alias_config_file,
+ alias_config_section_completion,
+ ptr_alias_name);
if (ptr_option)
weechat_config_option_free (ptr_option);
- weechat_config_new_option (
- alias_config_file, alias_config_section_cmd,
- alias_name, "string", NULL,
- NULL, 0, 0, "", argv_eol[2], 0,
- NULL, NULL,
- &alias_config_change_cb, NULL,
- &alias_config_delete_cb, NULL);
+ if (ptr_completion)
+ alias_config_completion_new_option (ptr_alias_name, ptr_completion);
+ /* display message */
weechat_printf (NULL,
_("Alias \"%s\" => \"%s\" created"),
- alias_name, argv_eol[2]);
+ ptr_alias_name, ptr_command);
}
else
{
- /* Display list of aliases */
+ /* get pointer to alias name */
+ ptr_alias_name = (weechat_string_is_command_char (argv[1])) ?
+ weechat_utf8_next_char (argv[1]) : argv[1];
+
+ /* display list of aliases */
alias_found = 0;
for (ptr_alias = alias_list; ptr_alias;
ptr_alias = ptr_alias->next_alias)
{
- if (weechat_string_match (ptr_alias->name, alias_name, 0))
+ if (weechat_string_match (ptr_alias->name, ptr_alias_name, 0))
{
if (!alias_found)
{
@@ -876,7 +744,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
if (!alias_found)
{
weechat_printf (NULL, _("No alias found matching \"%s\""),
- alias_name);
+ ptr_alias_name);
}
}
}
@@ -942,12 +810,17 @@ unalias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
/* remove alias */
alias_free (ptr_alias);
- /* remove option */
+ /* remove options */
ptr_option = weechat_config_search_option (alias_config_file,
alias_config_section_cmd,
alias_name);
if (ptr_option)
weechat_config_option_free (ptr_option);
+ ptr_option = weechat_config_search_option (alias_config_file,
+ alias_config_section_completion,
+ alias_name);
+ if (ptr_option)
+ weechat_config_option_free (ptr_option);
weechat_printf (NULL,
_("Alias \"%s\" removed"),
@@ -1007,6 +880,8 @@ alias_add_to_infolist (struct t_infolist *infolist, struct t_alias *alias)
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "command", alias->command))
return 0;
+ if (!weechat_infolist_new_var_string (ptr_item, "completion", alias->completion))
+ return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "running", alias->running))
return 0;
@@ -1029,7 +904,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
if (!alias_config_init ())
{
weechat_printf (NULL,
- "%s%s: error creating configuration file",
+ _("%s%s: error creating configuration file"),
weechat_prefix("error"), ALIAS_PLUGIN_NAME);
return WEECHAT_RC_ERROR;
}
@@ -1037,9 +912,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_hook_command ("alias",
N_("create an alias for a command"),
- N_("[alias_name [command [arguments]]]"),
- N_("alias_name: name of alias (can start or end with "
- "\"*\" for alias listing)\n"
+ N_("[[-completion completion] alias_name [command "
+ "[arguments]]]"),
+ N_("completion: completion for alias (optional, by "
+ "default completion is done with target "
+ "command)\n"
+ "alias_name: name of alias (can start or end "
+ "with \"*\" for alias listing)\n"
" command: command name (many commands can be "
"separated by semicolons)\n"
" arguments: arguments for command\n\n"
@@ -1055,8 +934,18 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
" $~: last argument\n"
" $nick: current nick\n"
" $channel: current channel\n"
- " $server: current server"),
- "%(alias) %(commands)",
+ " $server: current server\n\n"
+ "Examples:\n"
+ " alias /split to split window horizontally:\n"
+ " /alias split /window splith\n"
+ " alias /hello to say \"hello\" on all channels "
+ "but not on #weechat:\n"
+ " /alias hello /allchan -exclude=#weechat msg "
+ "* hello\n"
+ " alias /forcejoin to send IRC command "
+ "\"forcejoin\" with completion of /sajoin:\n"
+ " /alias -completion %%sajoin /quote forcejoin"),
+ "%(alias)|-completion %(commands)",
&alias_command_cb, NULL);
weechat_hook_command ("unalias", N_("remove aliases"),
diff --git a/src/plugins/alias/alias.h b/src/plugins/alias/alias.h
index aa7eb7c3f..57215b6bd 100644
--- a/src/plugins/alias/alias.h
+++ b/src/plugins/alias/alias.h
@@ -30,6 +30,8 @@ struct t_alias
struct t_hook *hook; /* command hook */
char *name; /* alias name */
char *command; /* alias command */
+ char *completion; /* completion for alias (if not set, */
+ /* uses completion of target cmd) */
int running; /* 1 if alias is running */
struct t_alias *prev_alias; /* link to previous alias */
struct t_alias *next_alias; /* link to next alias */
@@ -40,6 +42,13 @@ extern struct t_alias *alias_list;
extern struct t_weechat_plugin *weechat_alias_plugin;
extern int alias_valid (struct t_alias *alias);
+extern struct t_alias *alias_search (const char *alias_name);
+extern void alias_update_completion (struct t_alias *alias,
+ const char *completion);
+extern struct t_alias *alias_new (const char *name, const char *command,
+ const char *completion);
+extern void alias_free (struct t_alias *alias);
+extern void alias_free_all ();
extern int alias_add_to_infolist (struct t_infolist *infolist,
struct t_alias *alias);