diff --git a/doc/de/Makefile.am b/doc/de/Makefile.am index 4f7f54b5e..35741d472 100644 --- a/doc/de/Makefile.am +++ b/doc/de/Makefile.am @@ -23,6 +23,7 @@ BOOK_AUTOGEN_INCLUDE = ../include_autogen.xml \ autogen/aspell_options.xml \ autogen/charset_commands.xml \ autogen/charset_options.xml \ + autogen/completions.xml \ autogen/demo_commands.xml \ autogen/fifo_infos.xml \ autogen/irc_commands.xml \ diff --git a/doc/de/autogen/completions.xml b/doc/de/autogen/completions.xml new file mode 100644 index 000000000..946666323 --- /dev/null +++ b/doc/de/autogen/completions.xml @@ -0,0 +1,203 @@ + + + + + alias + alias + list of alias + + + aspell + aspell_langs + list of supported langs for aspell + + + irc + irc_channel + current IRC channel + + + irc + irc_channel_nicks_hosts + nicks and hostnames of current IRC channel + + + irc + irc_channel_topic + topic of current IRC channel + + + irc + irc_channels + IRC channels (on all servers) + + + irc + irc_ignores_numbers + numbers for defined ignores + + + irc + irc_msg_part + default part message for IRC channel + + + irc + irc_server + current IRC server + + + irc + irc_server_nick + nick on current IRC server + + + irc + irc_server_nicks + nicks on all channels of current IRC server + + + irc + irc_servers + IRC servers (internal names) + + + irc + nick + nicks of current IRC channel + + + lua + lua_script + list of scripts + + + perl + perl_script + list of scripts + + + python + python_script + list of scripts + + + ruby + ruby_script + list of scripts + + + tcl + tcl_script + list of scripts + + + weechat + bars_names + names of bars + + + weechat + bars_options + options for bars + + + weechat + buffers_names + names of buffers + + + weechat + buffers_numbers + numbers of buffers + + + weechat + buffers_plugins_names + names of buffers (including plugins names) + + + weechat + commands + commands (weechat and plugins) + + + weechat + config_files + configuration files + + + weechat + config_option_values + values for a configuration option + + + weechat + config_options + configuration options + + + weechat + filename + filename + + + weechat + filters_names + names of filters + + + weechat + infolists + names of infolists hooked + + + weechat + infos + names of infos hooked + + + weechat + keys_codes + key codes + + + weechat + nicks + nicks in nicklist of current buffer + + + weechat + plugins_commands + commands defined by plugins + + + weechat + plugins_names + names of plugins + + + weechat + proxies_names + names of proxies + + + weechat + proxies_options + options for proxies + + + weechat + weechat_commands + weechat commands + + + xfer + nick + nicks of DCC chat + diff --git a/doc/de/autogen/weechat_commands.xml b/doc/de/autogen/weechat_commands.xml index 5e4e6be3c..b385619bd 100644 --- a/doc/de/autogen/weechat_commands.xml +++ b/doc/de/autogen/weechat_commands.xml @@ -150,14 +150,14 @@ functions for command line Cette commande est utilisée par les associations de touches ou les extensions. -/key [key [command [args]]] | [unbind key] | [reset -yes] | [missing] +/key [bind key [command [args]]] | [unbind key] | [reset -yes] | [missing] belegen/freigeben von Tasten - key: display or bind this key to a command - unbind: unbind a key - reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) - missing: add missing keys (using default bindings) + bind: bind a command to a key or display command bound to key + unbind: remove a key binding + reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) +missing: add missing keys (using default bindings) /layout [[save | apply | reset] [buffers | windows]] diff --git a/doc/de/autogen/weechat_options.xml b/doc/de/autogen/weechat_options.xml index ead661fea..b1c9deed1 100644 --- a/doc/de/autogen/weechat_options.xml +++ b/doc/de/autogen/weechat_options.xml @@ -572,7 +572,7 @@ type: string - values: any string (default value: '%n|%(irc_channels)') + values: any string (default value: '%(nicks)|%(irc_channels)') diff --git a/doc/de/dev/plugin_c_api.de.xml b/doc/de/dev/plugin_c_api.de.xml index 669a13179..e04330536 100644 --- a/doc/de/dev/plugin_c_api.de.xml +++ b/doc/de/dev/plugin_c_api.de.xml @@ -1836,7 +1836,7 @@ void weechat_exec_on_files ( : function called for each file found, arguments: - + Type @@ -2490,7 +2490,7 @@ struct t_config_file *weechat_config_new ( configuration file is reloaded with /reload (optional, may be NULL), arguments: - + Type @@ -2629,7 +2629,7 @@ struct t_config_section *weechat_config_new_section ( except if options in your section need custom function), arguments: - + Type @@ -2681,7 +2681,7 @@ struct t_config_section *weechat_config_new_section ( is written in file (should be NULL for most cases, except if your section needs to be written by a custom function), arguments: - + Type @@ -2727,7 +2727,7 @@ struct t_config_section *weechat_config_new_section ( : callback called when default values for section must be written in file, arguments: - + Type @@ -2769,7 +2769,7 @@ struct t_config_section *weechat_config_new_section ( new option is created in section (NULL if section does not allow new options to be created), arguments: - + Type @@ -2821,7 +2821,7 @@ struct t_config_section *weechat_config_new_section ( option is deleted (NULL if section does not allow options to be deleted), arguments: - + Type @@ -3095,7 +3095,7 @@ struct t_config_option *weechat_config_new_option ( : callback called to check new value for an option (optional), arguments: - + Type @@ -3136,7 +3136,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when value of option has changed (optional), arguments: - + Type @@ -3172,7 +3172,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when option will be deleted (optional), arguments: - + Type @@ -3727,7 +3727,7 @@ void *weechat_config_option_get_pointer ( : property name: - + Property @@ -4656,7 +4656,7 @@ const char *weechat_prefix (const char *prefix); : name of prefix: - + Prefix @@ -5036,12 +5036,27 @@ struct t_hook *weechat_hook_command ( list of completions for each arguments, separated by space. Many completions are possible for one argument, separated by "|". Default completion codes are: + + + + + Plugin + Code + Description + + + + &completions.xml; + + + + Special codes: Code - Completion + Description @@ -5053,71 +5068,6 @@ struct t_hook *weechat_hook_command ( %* Repeat last completion - - %b - Buffers names - - - %B - Buffers names (with plugin name) - - - %c - Configuration files - - - %f - Filename - - - %F - Filters - - - %h - Commands hooked - - - %i - Infos hooked - - - %I - Infolists hooked - - - %n - Nick - - - %o - Configuration option - - - %p - Plugin name - - - %P - Plugin commands - - - %r - Bar names - - - %v - Value of configuration option - - - %w - WeeChat commands - - - %(xxx) - Custom completion by plugin (xxx is a completion - code added by a plugin) - @@ -5128,7 +5078,7 @@ struct t_hook *weechat_hook_command ( : function called when command is used, arguments: - + Type @@ -5244,7 +5194,7 @@ struct t_hook *weechat_hook_command_run ( : function called when command is run, arguments: - + Type @@ -5351,7 +5301,7 @@ struct t_hook *weechat_hook_timer ( : function called when time is reached, arguments: - + Type @@ -5452,7 +5402,7 @@ struct t_hook *weechat_hook_fd ( : function called when a selected event occurs, arguments: - + Type @@ -5546,7 +5496,7 @@ struct t_hook *weechat_hook_process ( : function called when data from child is available, or when child has ended, arguments: - + Type @@ -5684,7 +5634,7 @@ struct t_hook *weechat_hook_connect ( : function called when connection is ok or failed, arguments: - + Type @@ -5858,7 +5808,7 @@ struct t_hook *weechat_hook_print ( : function called when message is printed, arguments: - + Type @@ -5981,7 +5931,7 @@ struct t_hook *weechat_hook_signal ( : function called when signal is received, arguments: - + Type @@ -6124,7 +6074,7 @@ struct t_hook *weechat_hook_config ( : function called when configuration option is changed, arguments: - + Type @@ -6217,7 +6167,7 @@ struct t_hook *weechat_hook_completion ( is used (user is completing something using this item), arguments: - + Type @@ -6383,7 +6333,7 @@ struct t_hook *weechat_hook_modifier ( : function called when modifier is received, arguments: - + Type @@ -6547,7 +6497,7 @@ struct t_hook *weechat_hook_info ( : function called when info is asked, arguments: - + Type @@ -6642,7 +6592,7 @@ struct t_hook *weechat_hook_infolist ( : function called when infolist is asked, arguments: - + Type @@ -6805,7 +6755,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when input text is entered on buffer, arguments: - + Type @@ -6845,7 +6795,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when buffer is closed, arguments: - + Type @@ -7294,7 +7244,7 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, : property name: - + Name @@ -7522,7 +7472,7 @@ void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *proper : property name: - + Name @@ -9005,7 +8955,7 @@ const char *weechat_info_get (const char *info_name, core or other plugin (see plugin doc for infos returned by each plugin). WeeChat core infos are: - + Info diff --git a/doc/docgen.pl b/doc/docgen.pl index 3faf9c347..6562cdb15 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -15,8 +15,8 @@ # along with this program. If not, see . # -# Documentation generator for WeeChat: build XML include files with commands -# and options for WeeChat core and plugins. +# Documentation generator for WeeChat: build XML include files with commands, +# options, infos and completions for WeeChat core and plugins. # # Instructions to build config files yourself in WeeChat directories (replace # all paths with your path to WeeChat): @@ -39,7 +39,7 @@ use File::Basename; my $version = "0.1"; -# -------------------------------[ config ]------------------------------------- +# -------------------------------[ config ]------------------------------------ # default path where doc XML files will be written (should be doc/ in sources # package tree) @@ -82,10 +82,14 @@ my @ignore_options = ("aspell\\.dict\\..*", "logger\\.mask\\..*", "weechat\\.proxy\\..*", "weechat\\.bar\\..*", - "weechat\\.debug\\..*", - ); + "weechat\\.debug\\..*"); -# --------------------------------[ init ]-------------------------------------- +# completions to ignore +my @ignore_completions_plugins = ("jabber"); +my @ignore_completions_items = ("jabber.*", + "weeget.*"); + +# -------------------------------[ init ]-------------------------------------- weechat::register("docgen", "FlashCode ", $version, "GPL", "Doc generator for WeeChat 0.2.7", "", ""); @@ -93,7 +97,7 @@ weechat::hook_command("docgen", "Doc generator", "", "", "", "docgen"); weechat::config_set_plugin("path", $default_path) if (weechat::config_get_plugin("path") eq ""); -# ------------------------------------------------------------------------------ +# ----------------------------------------------------------------------------- # get list of commands in a hash with 3 indexes: plugin, command, xxx sub get_commands @@ -192,6 +196,40 @@ sub get_infos return %infos; } +# get list of completions hooked by plugins in a hash with 3 indexes: plugin, item, xxx +sub get_completions +{ + my %completions; + + # get completions hooked + my $infolist = weechat::infolist_get("hook", "", "completion"); + while (weechat::infolist_next($infolist)) + { + my $completion_item = weechat::infolist_string($infolist, "completion_item"); + my $plugin = weechat::infolist_string($infolist, "plugin_name"); + $plugin = "weechat" if ($plugin eq ""); + + # check if completion item is ignored or not + my $ignore = 0; + foreach my $mask (@ignore_completions_plugins) + { + $ignore = 1 if ($plugin =~ /${mask}/); + } + foreach my $mask (@ignore_completions_items) + { + $ignore = 1 if ($completion_item =~ /${mask}/); + } + + if ($ignore ne 1) + { + $completions{$plugin}{$completion_item}{"description"} = weechat::infolist_string($infolist, "description"); + } + } + weechat::infolist_free($infolist); + + return %completions; +} + # escape string for XML output sub escape { @@ -207,6 +245,7 @@ sub docgen my %plugin_commands = get_commands(); my %plugin_options = get_options(); my %plugin_infos = get_infos(); + my %plugin_completions = get_completions(); # xml header (comment) for all files my $xml_header = @@ -235,6 +274,8 @@ sub docgen my $num_files_options_updated = 0; my $num_files_infos = 0; my $num_files_infos_updated = 0; + my $num_files_completions = 0; + my $num_files_completions_updated = 0; setlocale(LC_MESSAGES, $locale.".UTF-8"); my $d = Locale::gettext->domain_raw("weechat"); @@ -415,23 +456,65 @@ sub docgen weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); } } + + # write completions hooked + my $filename = $dir."completions.xml"; + if (open(FILE, ">".$filename.".tmp")) + { + print FILE $xml_header; + foreach my $plugin (sort keys %plugin_completions) + { + foreach my $completion_item (sort keys %{$plugin_completions{$plugin}}) + { + my $description = $plugin_completions{$plugin}{$completion_item}{"description"}; + $description = $d->get($description) if ($description ne ""); + + print FILE "\n"; + print FILE " ".escape($plugin)."\n"; + print FILE " ".escape($completion_item)."\n"; + print FILE " ".escape($description)."\n"; + print FILE "\n"; + } + } + #weechat::print("", "docgen: file ok: '$filename'"); + my $rc = system("diff ".$filename." ".$filename.".tmp >/dev/null 2>&1"); + if ($rc != 0) + { + system("mv -f ".$filename.".tmp ".$filename); + $num_files_updated++; + $num_files_completions_updated++; + } + else + { + system("rm ".$filename.".tmp"); + } + $num_files++; + $num_files_completions++; + close(FILE); + } + else + { + weechat::print("", weechat::prefix("error")."docgen error: unable to write file '$filename'"); + } } else { weechat::print("", weechat::prefix("error")."docgen error: directory '$dir' does not exist"); } my $total_files = $num_files_commands + $num_files_options - + $num_files_infos; + + $num_files_infos + $num_files_completions; my $total_files_updated = $num_files_commands_updated + $num_files_options_updated - + $num_files_infos_updated; + + $num_files_infos_updated + $num_files_completions_updated; weechat::print("", "docgen: ".$locale.": ".$total_files." files (" .$num_files_commands." cmd, " .$num_files_options." opt, " - .$num_files_infos." infos) -- " + .$num_files_infos." infos, " + .$num_files_completions." complt) -- " .$total_files_updated." updated (" .$num_files_commands_updated." cmd, " .$num_files_options_updated." opt, " - .$num_files_infos_updated." infos)"); + .$num_files_infos_updated." infos, " + .$num_files_completions_updated." complt)"); } weechat::print("", "docgen: total: ".$num_files." files (".$num_files_updated." updated)"); @@ -456,6 +539,8 @@ sub docgen { print FILE "\n"; } + print FILE "\n\n\n"; + print FILE "\n"; close(FILE); my $rc = system("diff ".$filename." ".$filename.".tmp >/dev/null 2>&1"); if ($rc != 0) diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am index 030d8e9c5..641fcdc6f 100644 --- a/doc/en/Makefile.am +++ b/doc/en/Makefile.am @@ -23,6 +23,7 @@ BOOK_AUTOGEN_INCLUDE = ../include_autogen.xml \ autogen/aspell_options.xml \ autogen/charset_commands.xml \ autogen/charset_options.xml \ + autogen/completions.xml \ autogen/demo_commands.xml \ autogen/fifo_infos.xml \ autogen/irc_commands.xml \ diff --git a/doc/en/autogen/completions.xml b/doc/en/autogen/completions.xml new file mode 100644 index 000000000..946666323 --- /dev/null +++ b/doc/en/autogen/completions.xml @@ -0,0 +1,203 @@ + + + + + alias + alias + list of alias + + + aspell + aspell_langs + list of supported langs for aspell + + + irc + irc_channel + current IRC channel + + + irc + irc_channel_nicks_hosts + nicks and hostnames of current IRC channel + + + irc + irc_channel_topic + topic of current IRC channel + + + irc + irc_channels + IRC channels (on all servers) + + + irc + irc_ignores_numbers + numbers for defined ignores + + + irc + irc_msg_part + default part message for IRC channel + + + irc + irc_server + current IRC server + + + irc + irc_server_nick + nick on current IRC server + + + irc + irc_server_nicks + nicks on all channels of current IRC server + + + irc + irc_servers + IRC servers (internal names) + + + irc + nick + nicks of current IRC channel + + + lua + lua_script + list of scripts + + + perl + perl_script + list of scripts + + + python + python_script + list of scripts + + + ruby + ruby_script + list of scripts + + + tcl + tcl_script + list of scripts + + + weechat + bars_names + names of bars + + + weechat + bars_options + options for bars + + + weechat + buffers_names + names of buffers + + + weechat + buffers_numbers + numbers of buffers + + + weechat + buffers_plugins_names + names of buffers (including plugins names) + + + weechat + commands + commands (weechat and plugins) + + + weechat + config_files + configuration files + + + weechat + config_option_values + values for a configuration option + + + weechat + config_options + configuration options + + + weechat + filename + filename + + + weechat + filters_names + names of filters + + + weechat + infolists + names of infolists hooked + + + weechat + infos + names of infos hooked + + + weechat + keys_codes + key codes + + + weechat + nicks + nicks in nicklist of current buffer + + + weechat + plugins_commands + commands defined by plugins + + + weechat + plugins_names + names of plugins + + + weechat + proxies_names + names of proxies + + + weechat + proxies_options + options for proxies + + + weechat + weechat_commands + weechat commands + + + xfer + nick + nicks of DCC chat + diff --git a/doc/en/autogen/weechat_commands.xml b/doc/en/autogen/weechat_commands.xml index e9740ea33..fb714edf6 100644 --- a/doc/en/autogen/weechat_commands.xml +++ b/doc/en/autogen/weechat_commands.xml @@ -150,14 +150,14 @@ functions for command line Cette commande est utilisée par les associations de touches ou les extensions. -/key [key [command [args]]] | [unbind key] | [reset -yes] | [missing] +/key [bind key [command [args]]] | [unbind key] | [reset -yes] | [missing] bind/unbind keys - key: display or bind this key to a command - unbind: unbind a key - reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) - missing: add missing keys (using default bindings) + bind: bind a command to a key or display command bound to key + unbind: remove a key binding + reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) +missing: add missing keys (using default bindings) /layout [[save | apply | reset] [buffers | windows]] diff --git a/doc/en/autogen/weechat_options.xml b/doc/en/autogen/weechat_options.xml index 0015063b2..20779ea41 100644 --- a/doc/en/autogen/weechat_options.xml +++ b/doc/en/autogen/weechat_options.xml @@ -572,7 +572,7 @@ type: string - values: any string (default value: '%n|%(irc_channels)') + values: any string (default value: '%(nicks)|%(irc_channels)') diff --git a/doc/en/dev/plugin_c_api.en.xml b/doc/en/dev/plugin_c_api.en.xml index b5f01bff4..f4a50efd7 100644 --- a/doc/en/dev/plugin_c_api.en.xml +++ b/doc/en/dev/plugin_c_api.en.xml @@ -1835,7 +1835,7 @@ void weechat_exec_on_files ( : function called for each file found, arguments: - + Type @@ -2489,7 +2489,7 @@ struct t_config_file *weechat_config_new ( configuration file is reloaded with /reload (optional, may be NULL), arguments: - + Type @@ -2628,7 +2628,7 @@ struct t_config_section *weechat_config_new_section ( except if options in your section need custom function), arguments: - + Type @@ -2680,7 +2680,7 @@ struct t_config_section *weechat_config_new_section ( is written in file (should be NULL for most cases, except if your section needs to be written by a custom function), arguments: - + Type @@ -2726,7 +2726,7 @@ struct t_config_section *weechat_config_new_section ( : callback called when default values for section must be written in file, arguments: - + Type @@ -2768,7 +2768,7 @@ struct t_config_section *weechat_config_new_section ( new option is created in section (NULL if section does not allow new options to be created), arguments: - + Type @@ -2820,7 +2820,7 @@ struct t_config_section *weechat_config_new_section ( option is deleted (NULL if section does not allow options to be deleted), arguments: - + Type @@ -3094,7 +3094,7 @@ struct t_config_option *weechat_config_new_option ( : callback called to check new value for an option (optional), arguments: - + Type @@ -3135,7 +3135,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when value of option has changed (optional), arguments: - + Type @@ -3171,7 +3171,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when option will be deleted (optional), arguments: - + Type @@ -3726,7 +3726,7 @@ void *weechat_config_option_get_pointer ( : property name: - + Property @@ -4655,7 +4655,7 @@ const char *weechat_prefix (const char *prefix); : name of prefix: - + Prefix @@ -5035,12 +5035,27 @@ struct t_hook *weechat_hook_command ( list of completions for each arguments, separated by space. Many completions are possible for one argument, separated by "|". Default completion codes are: + + + + + Plugin + Code + Description + + + + &completions.xml; + + + + Special codes: Code - Completion + Description @@ -5052,71 +5067,6 @@ struct t_hook *weechat_hook_command ( %* Repeat last completion - - %b - Buffers names - - - %B - Buffers names (with plugin name) - - - %c - Configuration files - - - %f - Filename - - - %F - Filters - - - %h - Commands hooked - - - %i - Infos hooked - - - %I - Infolists hooked - - - %n - Nick - - - %o - Configuration option - - - %p - Plugin name - - - %P - Plugin commands - - - %r - Bar names - - - %v - Value of configuration option - - - %w - WeeChat commands - - - %(xxx) - Custom completion by plugin (xxx is a completion - code added by a plugin) - @@ -5127,7 +5077,7 @@ struct t_hook *weechat_hook_command ( : function called when command is used, arguments: - + Type @@ -5243,7 +5193,7 @@ struct t_hook *weechat_hook_command_run ( : function called when command is run, arguments: - + Type @@ -5350,7 +5300,7 @@ struct t_hook *weechat_hook_timer ( : function called when time is reached, arguments: - + Type @@ -5451,7 +5401,7 @@ struct t_hook *weechat_hook_fd ( : function called when a selected event occurs, arguments: - + Type @@ -5545,7 +5495,7 @@ struct t_hook *weechat_hook_process ( : function called when data from child is available, or when child has ended, arguments: - + Type @@ -5683,7 +5633,7 @@ struct t_hook *weechat_hook_connect ( : function called when connection is ok or failed, arguments: - + Type @@ -5857,7 +5807,7 @@ struct t_hook *weechat_hook_print ( : function called when message is printed, arguments: - + Type @@ -5980,7 +5930,7 @@ struct t_hook *weechat_hook_signal ( : function called when signal is received, arguments: - + Type @@ -6123,7 +6073,7 @@ struct t_hook *weechat_hook_config ( : function called when configuration option is changed, arguments: - + Type @@ -6216,7 +6166,7 @@ struct t_hook *weechat_hook_completion ( is used (user is completing something using this item), arguments: - + Type @@ -6382,7 +6332,7 @@ struct t_hook *weechat_hook_modifier ( : function called when modifier is received, arguments: - + Type @@ -6546,7 +6496,7 @@ struct t_hook *weechat_hook_info ( : function called when info is asked, arguments: - + Type @@ -6641,7 +6591,7 @@ struct t_hook *weechat_hook_infolist ( : function called when infolist is asked, arguments: - + Type @@ -6804,7 +6754,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when input text is entered on buffer, arguments: - + Type @@ -6844,7 +6794,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when buffer is closed, arguments: - + Type @@ -7293,7 +7243,7 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, : property name: - + Name @@ -7521,7 +7471,7 @@ void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *proper : property name: - + Name @@ -9004,7 +8954,7 @@ const char *weechat_info_get (const char *info_name, core or other plugin (see plugin doc for infos returned by each plugin). WeeChat core infos are: - + Info diff --git a/doc/fr/Makefile.am b/doc/fr/Makefile.am index 7c9c7e9fd..9483f23ee 100644 --- a/doc/fr/Makefile.am +++ b/doc/fr/Makefile.am @@ -23,6 +23,7 @@ BOOK_AUTOGEN_INCLUDE = ../include_autogen.xml \ autogen/aspell_options.xml \ autogen/charset_commands.xml \ autogen/charset_options.xml \ + autogen/completions.xml \ autogen/demo_commands.xml \ autogen/fifo_infos.xml \ autogen/irc_commands.xml \ diff --git a/doc/fr/autogen/completions.xml b/doc/fr/autogen/completions.xml new file mode 100644 index 000000000..92c4d092a --- /dev/null +++ b/doc/fr/autogen/completions.xml @@ -0,0 +1,203 @@ + + + + + alias + alias + liste des alias + + + aspell + aspell_langs + liste des langues supportées pour aspell + + + irc + irc_channel + canal IRC courant + + + irc + irc_channel_nicks_hosts + pseudos et noms d'hôtes du canal IRC courant + + + irc + irc_channel_topic + titre du canal IRC courant + + + irc + irc_channels + canaux IRC (sur tous les serveurs) + + + irc + irc_ignores_numbers + numéros pour les ignores définis + + + irc + irc_msg_part + message de fin par défaut pour le canal IRC + + + irc + irc_server + serveur IRC courant + + + irc + irc_server_nick + pseudo sur le serveur IRC courant + + + irc + irc_server_nicks + pseudos sur tous les canaux du serveur IRC courant + + + irc + irc_servers + serveurs IRC (noms internes) + + + irc + nick + pseudos du canal IRC courant + + + lua + lua_script + liste des scripts + + + perl + perl_script + liste des scripts + + + python + python_script + liste des scripts + + + ruby + ruby_script + liste des scripts + + + tcl + tcl_script + liste des scripts + + + weechat + bars_names + noms des barres + + + weechat + bars_options + options pour les barres + + + weechat + buffers_names + noms des tampons + + + weechat + buffers_numbers + numéros des tampons + + + weechat + buffers_plugins_names + noms des tampons (incluant les noms d'extensions) + + + weechat + commands + commandes (weechat et extensions) + + + weechat + config_files + fichiers de configuration + + + weechat + config_option_values + valeurs pour une option de configuration + + + weechat + config_options + options de configuration + + + weechat + filename + nom de fichier + + + weechat + filters_names + noms des filtres + + + weechat + infolists + noms des infolistes accrochées + + + weechat + infos + noms des infos accrochées + + + weechat + keys_codes + codes des touches + + + weechat + nicks + pseudos dans la liste des pseudos du tampon courant + + + weechat + plugins_commands + commandes définies par les extensions + + + weechat + plugins_names + noms des extensions + + + weechat + proxies_names + noms des proxies + + + weechat + proxies_options + options pour les proxies + + + weechat + weechat_commands + commandes weechat + + + xfer + nick + pseudos de la discussion DCC + diff --git a/doc/fr/autogen/weechat_commands.xml b/doc/fr/autogen/weechat_commands.xml index e1f2412ed..dd720cb75 100644 --- a/doc/fr/autogen/weechat_commands.xml +++ b/doc/fr/autogen/weechat_commands.xml @@ -149,14 +149,14 @@ fonctions pour la ligne de commande Cette commande est utilisée par les associations de touches ou les extensions. -/key [touche [commande [args]]] | [unbind touche] | [reset -yes] | [missing] +/key [bind touche [commande [args]]] | [unbind touche] | [reset -yes] | [missing] associer/libérer des touches - touche: voir ou associer cette touche à une commande - unbind: supprimer l'association à une touche - reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !) - missing: ajoute les touches manquantes (en utilisant les touches par défaut) + bind: associer une commande à une touche ou afficher la commande associée à la touche + unbind: supprimer l'association à une touche + reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !) +missing: ajoute les touches manquantes (en utilisant les touches par défaut) /layout [[save | apply | reset] [buffers | windows]] diff --git a/doc/fr/autogen/weechat_options.xml b/doc/fr/autogen/weechat_options.xml index 89ecdfebd..10b3c5087 100644 --- a/doc/fr/autogen/weechat_options.xml +++ b/doc/fr/autogen/weechat_options.xml @@ -572,7 +572,7 @@ type: chaîne - valeurs: toute chaîne (valeur par défaut: '%n|%(irc_channels)') + valeurs: toute chaîne (valeur par défaut: '%(nicks)|%(irc_channels)') diff --git a/doc/fr/dev/plugin_c_api.fr.xml b/doc/fr/dev/plugin_c_api.fr.xml index fcdf963bc..ecf45a0df 100644 --- a/doc/fr/dev/plugin_c_api.fr.xml +++ b/doc/fr/dev/plugin_c_api.fr.xml @@ -1836,7 +1836,7 @@ void weechat_exec_on_files ( : function called for each file found, arguments: - + Type @@ -2490,7 +2490,7 @@ struct t_config_file *weechat_config_new ( configuration file is reloaded with /reload (optional, may be NULL), arguments: - + Type @@ -2629,7 +2629,7 @@ struct t_config_section *weechat_config_new_section ( except if options in your section need custom function), arguments: - + Type @@ -2681,7 +2681,7 @@ struct t_config_section *weechat_config_new_section ( is written in file (should be NULL for most cases, except if your section needs to be written by a custom function), arguments: - + Type @@ -2727,7 +2727,7 @@ struct t_config_section *weechat_config_new_section ( : callback called when default values for section must be written in file, arguments: - + Type @@ -2769,7 +2769,7 @@ struct t_config_section *weechat_config_new_section ( new option is created in section (NULL if section does not allow new options to be created), arguments: - + Type @@ -2821,7 +2821,7 @@ struct t_config_section *weechat_config_new_section ( option is deleted (NULL if section does not allow options to be deleted), arguments: - + Type @@ -3095,7 +3095,7 @@ struct t_config_option *weechat_config_new_option ( : callback called to check new value for an option (optional), arguments: - + Type @@ -3136,7 +3136,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when value of option has changed (optional), arguments: - + Type @@ -3172,7 +3172,7 @@ struct t_config_option *weechat_config_new_option ( : callback called when option will be deleted (optional), arguments: - + Type @@ -3727,7 +3727,7 @@ void *weechat_config_option_get_pointer ( : property name: - + Property @@ -4656,7 +4656,7 @@ const char *weechat_prefix (const char *prefix); : name of prefix: - + Prefix @@ -5036,12 +5036,27 @@ struct t_hook *weechat_hook_command ( list of completions for each arguments, separated by space. Many completions are possible for one argument, separated by "|". Default completion codes are: + + + + + Plugin + Code + Description + + + + &completions.xml; + + + + Special codes: Code - Completion + Description @@ -5053,71 +5068,6 @@ struct t_hook *weechat_hook_command ( %* Repeat last completion - - %b - Buffers names - - - %B - Buffers names (with plugin name) - - - %c - Configuration files - - - %f - Filename - - - %F - Filters - - - %h - Commands hooked - - - %i - Infos hooked - - - %I - Infolists hooked - - - %n - Nick - - - %o - Configuration option - - - %p - Plugin name - - - %P - Plugin commands - - - %r - Bar names - - - %v - Value of configuration option - - - %w - WeeChat commands - - - %(xxx) - Custom completion by plugin (xxx is a completion - code added by a plugin) - @@ -5128,7 +5078,7 @@ struct t_hook *weechat_hook_command ( : function called when command is used, arguments: - + Type @@ -5244,7 +5194,7 @@ struct t_hook *weechat_hook_command_run ( : function called when command is run, arguments: - + Type @@ -5351,7 +5301,7 @@ struct t_hook *weechat_hook_timer ( : function called when time is reached, arguments: - + Type @@ -5452,7 +5402,7 @@ struct t_hook *weechat_hook_fd ( : function called when a selected event occurs, arguments: - + Type @@ -5546,7 +5496,7 @@ struct t_hook *weechat_hook_process ( : function called when data from child is available, or when child has ended, arguments: - + Type @@ -5684,7 +5634,7 @@ struct t_hook *weechat_hook_connect ( : function called when connection is ok or failed, arguments: - + Type @@ -5858,7 +5808,7 @@ struct t_hook *weechat_hook_print ( : function called when message is printed, arguments: - + Type @@ -5981,7 +5931,7 @@ struct t_hook *weechat_hook_signal ( : function called when signal is received, arguments: - + Type @@ -6124,7 +6074,7 @@ struct t_hook *weechat_hook_config ( : function called when configuration option is changed, arguments: - + Type @@ -6217,7 +6167,7 @@ struct t_hook *weechat_hook_completion ( is used (user is completing something using this item), arguments: - + Type @@ -6383,7 +6333,7 @@ struct t_hook *weechat_hook_modifier ( : function called when modifier is received, arguments: - + Type @@ -6547,7 +6497,7 @@ struct t_hook *weechat_hook_info ( : function called when info is asked, arguments: - + Type @@ -6642,7 +6592,7 @@ struct t_hook *weechat_hook_infolist ( : function called when infolist is asked, arguments: - + Type @@ -6805,7 +6755,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when input text is entered on buffer, arguments: - + Type @@ -6845,7 +6795,7 @@ struct t_gui_buffer *weechat_buffer_new ( : function called when buffer is closed, arguments: - + Type @@ -7294,7 +7244,7 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, : property name: - + Name @@ -7522,7 +7472,7 @@ void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *proper : property name: - + Name @@ -9005,7 +8955,7 @@ const char *weechat_info_get (const char *info_name, core or other plugin (see plugin doc for infos returned by each plugin). WeeChat core infos are: - + Info diff --git a/doc/include_autogen.xml b/doc/include_autogen.xml index 633ff42a9..6ce8297f0 100644 --- a/doc/include_autogen.xml +++ b/doc/include_autogen.xml @@ -43,3 +43,7 @@ + + + + diff --git a/po/cs.po b/po/cs.po index 1d74c0dc6..e321d6fbb 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -352,6 +352,24 @@ msgstr "Žádné pole nejsou definovány" msgid "Key bindings (%d):" msgstr "Klávesové zkratky:" +msgid "Key:" +msgstr "Klávesa:" + +msgid "No key found" +msgstr "Žádná klávesa nenalezena" + +#, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%sChyba: nemohu napojit kalávesu \"%s\"" + +#, c-format +msgid "Key \"%s\" unbound" +msgstr "Klávesa \"%s\" odpojena" + +#, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%sChyba: nemohu odpojit klávesu \"%s\"" + msgid "Default key bindings restored" msgstr "Výchozí klávesové zkratky obnoveny" @@ -367,24 +385,6 @@ msgid_plural "%d new keys added" msgstr[0] "uživatel byl zablokován" msgstr[1] "uživatel byl zablokován" -#, c-format -msgid "Key \"%s\" unbound" -msgstr "Klávesa \"%s\" odpojena" - -#, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%sChyba: nemohu odpojit klávesu \"%s\"" - -msgid "Key:" -msgstr "Klávesa:" - -msgid "No key found" -msgstr "Žádná klávesa nenalezena" - -#, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%sChyba: nemohu napojit kalávesu \"%s\"" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "list: id: %d, rodič: %d, plugin: \"%s\", buffer: \"%s\"" @@ -963,18 +963,18 @@ msgid "bind/unbind keys" msgstr "napojit/odpojit klávesy" #, fuzzy -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" "[klávesa [funkce/příkaz]] [unbind klávesa] [functions] [call funkce " "[\"argumenty\"]] [reset -yes]" #, fuzzy msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" " klávesa: zobrazí nebo napojí klávesu na vnitřní funkci nebo příkaz " "(začínající \"/\")\n" @@ -2046,6 +2046,84 @@ msgstr "" msgid "Not enough memory for new line" msgstr "Nedostatek paměti pro nový řádek\n" +#, fuzzy +msgid "names of buffers" +msgstr "nevalidní délka pro buffer" + +#, fuzzy +msgid "numbers of buffers" +msgstr "nevalidní délka pro buffer" + +msgid "names of buffers (including plugins names)" +msgstr "" + +#, fuzzy +msgid "configuration files" +msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor" + +#, fuzzy +msgid "filename" +msgstr "uživatel byl zablokován" + +#, fuzzy +msgid "names of filters" +msgstr "Seznam pro aliasy:\n" + +#, fuzzy +msgid "commands (weechat and plugins)" +msgstr "Tento příkaz je používán napojenou klávesou nebo pluginy." + +#, fuzzy +msgid "names of infos hooked" +msgstr " napojené tisky:" + +#, fuzzy +msgid "names of infolists hooked" +msgstr " napojené tisky:" + +#, fuzzy +msgid "nicks in nicklist of current buffer" +msgstr "nevalidní délka pro buffer" + +#, fuzzy +msgid "configuration options" +msgstr "Nebyla nalezena žádná volba nastavení" + +#, fuzzy +msgid "names of plugins" +msgstr "nastaví konfigurační možnosti" + +#, fuzzy +msgid "commands defined by plugins" +msgstr "Tento příkaz je používán napojenou klávesou nebo pluginy." + +#, fuzzy +msgid "names of bars" +msgstr "Seznam pro aliasy:\n" + +#, fuzzy +msgid "values for a configuration option" +msgstr "Nebyla nalezena žádná volba nastavení" + +#, fuzzy +msgid "weechat commands" +msgstr "Další příkazy:" + +#, fuzzy +msgid "names of proxies" +msgstr "Seznam položek polí:" + +#, fuzzy +msgid "options for proxies" +msgstr "Seznam položek polí:" + +#, fuzzy +msgid "options for bars" +msgstr "Seznam polí:" + +msgid "key codes" +msgstr "" + #, fuzzy msgid "Error: not enough memory to add a buffer to hotlist" msgstr "%s nemohu přidat buffer do hotlistu\n" @@ -2187,6 +2265,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -3459,6 +3540,48 @@ msgstr "%s \"%s\" příkaz nemůže být spuštěn v bufferu serveru\n" msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "%s \"%s\" příkaz nemůže být spuštěn v bufferu serveru\n" +#, fuzzy +msgid "current IRC server" +msgstr "připojit se k serveru/serverům" + +#, fuzzy +msgid "nick on current IRC server" +msgstr "připojit se k serveru/serverům" + +#, fuzzy +msgid "nicks on all channels of current IRC server" +msgstr "seznam uživatelů přihlášených k serveru" + +msgid "IRC servers (internal names)" +msgstr "" + +#, fuzzy +msgid "current IRC channel" +msgstr "aktuální hodnota" + +#, fuzzy +msgid "nicks of current IRC channel" +msgstr "seznam uživatelů na kanálu" + +#, fuzzy +msgid "nicks and hostnames of current IRC channel" +msgstr "seznam uživatelů na kanálu" + +#, fuzzy +msgid "topic of current IRC channel" +msgstr "seznam uživatelů na kanálu" + +#, fuzzy +msgid "IRC channels (on all servers)" +msgstr "seznam uživatelů přihlášených k serveru" + +#, fuzzy +msgid "default part message for IRC channel" +msgstr "seznam uživatelů na kanálu" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5168,6 +5291,10 @@ msgstr "" "\n" "Pokud nejsou uvedeny argumenty, jsou vypsány všechny načtené skripty." +#, fuzzy +msgid "list of scripts" +msgstr "Seznam položek polí:" + #. TRANSLATORS: %s is language (for example "perl") #, fuzzy, c-format msgid "list of %s scripts" @@ -5445,6 +5572,10 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +#, fuzzy +msgid "nicks of DCC chat" +msgstr "seznam uživatelů na kanálu" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" "automaticky otevřít xfer buffer, když je přidána nová položka do xfer seznamu" @@ -5594,6 +5725,10 @@ msgstr "%s DCC: nemohu nastavit 'neblokovaci' volbu na soket\n" msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s chybí argument pro volbu \"%s\"\n" +#, fuzzy +#~ msgid "list of aliases" +#~ msgstr "Seznam pro aliasy:\n" + #, fuzzy #~ msgid "" #~ "smart completion for nicks (completes first with last speakers, " diff --git a/po/de.po b/po/de.po index 97a95a91f..d57a4e488 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -381,6 +381,26 @@ msgstr "Keine Aliases definiert.\n" msgid "Key bindings (%d):" msgstr "Tastenbelegungen:\n" +#, fuzzy +msgid "Key:" +msgstr "Taste:\n" + +#, fuzzy +msgid "No key found" +msgstr "Keine Taste gefunden.\n" + +#, fuzzy, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%s kann die Taste \"%s\" nicht zuordnen\n" + +#, fuzzy, c-format +msgid "Key \"%s\" unbound" +msgstr "Tastenbelegung \"%s\" gelöscht\n" + +#, fuzzy, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%s kann die Tastenbelegung \"%s\" nicht entfernen\n" + #, fuzzy msgid "Default key bindings restored" msgstr "Standardtastenbelegungen wiederhergestellt\n" @@ -397,26 +417,6 @@ msgid_plural "%d new keys added" msgstr[0] "Keine /ignore-Regeln definiert.\n" msgstr[1] "Keine /ignore-Regeln definiert.\n" -#, fuzzy, c-format -msgid "Key \"%s\" unbound" -msgstr "Tastenbelegung \"%s\" gelöscht\n" - -#, fuzzy, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%s kann die Tastenbelegung \"%s\" nicht entfernen\n" - -#, fuzzy -msgid "Key:" -msgstr "Taste:\n" - -#, fuzzy -msgid "No key found" -msgstr "Keine Taste gefunden.\n" - -#, fuzzy, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%s kann die Taste \"%s\" nicht zuordnen\n" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "" @@ -988,18 +988,18 @@ msgid "bind/unbind keys" msgstr "belegen/freigeben von Tasten" #, fuzzy -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" "[Taste [Funktion/Befehl]] [unbind Taste] [functions] [call Funktion " "[\"Argumente\"]] [reset -yes] " #, fuzzy msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" " Taste: diese Taste anzeigen oder mit einer internen Funktion oder " "einem Befehl, beginnend mit \"/\", belegen\n" @@ -2055,6 +2055,84 @@ msgstr "" msgid "Not enough memory for new line" msgstr "Nicht genügend Speicher für neue Zeile\n" +#, fuzzy +msgid "names of buffers" +msgstr "konnte den Puffer nicht laden" + +#, fuzzy +msgid "numbers of buffers" +msgstr "konnte den Puffer nicht laden" + +msgid "names of buffers (including plugins names)" +msgstr "" + +#, fuzzy +msgid "configuration files" +msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden" + +#, fuzzy +msgid "filename" +msgstr "/users wurde deaktiviert" + +#, fuzzy +msgid "names of filters" +msgstr "Liste der Aliases:\n" + +#, fuzzy +msgid "commands (weechat and plugins)" +msgstr " (kein Plugin)\n" + +#, fuzzy +msgid "names of infos hooked" +msgstr " Timer-Handler:\n" + +#, fuzzy +msgid "names of infolists hooked" +msgstr " Timer-Handler:\n" + +#, fuzzy +msgid "nicks in nicklist of current buffer" +msgstr "Fehlerhafte Pufferlänge" + +#, fuzzy +msgid "configuration options" +msgstr "Keine Konfigurationsoption gefunden\n" + +#, fuzzy +msgid "names of plugins" +msgstr "Konfigurationsparameter setzen" + +#, fuzzy +msgid "commands defined by plugins" +msgstr " (kein Plugin)\n" + +#, fuzzy +msgid "names of bars" +msgstr "Liste der Aliases:\n" + +#, fuzzy +msgid "values for a configuration option" +msgstr "Keine Konfigurationsoption gefunden\n" + +#, fuzzy +msgid "weechat commands" +msgstr "%s interne Befehle:\n" + +#, fuzzy +msgid "names of proxies" +msgstr "Liste der Aliases:\n" + +#, fuzzy +msgid "options for proxies" +msgstr "Liste der Aliases:\n" + +#, fuzzy +msgid "options for bars" +msgstr "Liste der Aliases:\n" + +msgid "key codes" +msgstr "" + #, fuzzy msgid "Error: not enough memory to add a buffer to hotlist" msgstr "%s Puffer kann nicht zur Hotlist hinzugefügt werden\n" @@ -2196,6 +2274,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -3435,6 +3516,48 @@ msgstr "%s der \"%s\"-Befehl kann nicht in Serverfenstern ausgeführt werden\n" msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "%s der \"%s\"-Befehl kann nicht in Serverfenstern ausgeführt werden\n" +#, fuzzy +msgid "current IRC server" +msgstr "mit Server verbinden" + +#, fuzzy +msgid "nick on current IRC server" +msgstr "mit Server verbinden" + +#, fuzzy +msgid "nicks on all channels of current IRC server" +msgstr "Channels, die bei Verbindung zum Server zu betreten sind" + +msgid "IRC servers (internal names)" +msgstr "" + +#, fuzzy +msgid "current IRC channel" +msgstr "User [Ziel [Channel]]" + +#, fuzzy +msgid "nicks of current IRC channel" +msgstr "Liste von Nicks im Channel" + +#, fuzzy +msgid "nicks and hostnames of current IRC channel" +msgstr "Liste von Nicks im Channel" + +#, fuzzy +msgid "topic of current IRC channel" +msgstr "Liste von Nicks im Channel" + +#, fuzzy +msgid "IRC channels (on all servers)" +msgstr "Channels, die bei Verbindung zum Server zu betreten sind" + +#, fuzzy +msgid "default part message for IRC channel" +msgstr "Liste von Nicks im Channel" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5107,6 +5230,10 @@ msgid "" "Without argument, this command lists all loaded scripts." msgstr "" +#, fuzzy +msgid "list of scripts" +msgstr "Liste der Aliases:\n" + #. TRANSLATORS: %s is language (for example "perl") #, fuzzy, c-format msgid "list of %s scripts" @@ -5380,6 +5507,10 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +#, fuzzy +msgid "nicks of DCC chat" +msgstr "Liste von Nicks im Channel" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -5528,6 +5659,10 @@ msgstr "%s DCC: kann die 'nonblock'-Option für den Socket nicht festlegen\n" msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s fehlende Argumente für die \"--dir\"-Option\n" +#, fuzzy +#~ msgid "list of aliases" +#~ msgstr "Liste der Aliases:\n" + #, fuzzy #~ msgid "" #~ "smart completion for nicks (completes first with last speakers, " @@ -5548,10 +5683,6 @@ msgstr "%s fehlende Argumente für die \"--dir\"-Option\n" #~ msgid " (used by a plugin)" #~ msgstr " (kein Plugin)\n" -#, fuzzy -#~ msgid " (masked by a plugin)" -#~ msgstr " (kein Plugin)\n" - #, fuzzy #~ msgid "plugin:" #~ msgstr " (kein Plugin)\n" diff --git a/po/es.po b/po/es.po index 1dac85e87..e38a2bd19 100644 --- a/po/es.po +++ b/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Roberto González Cardenete \n" "Language-Team: weechat-dev \n" @@ -377,6 +377,25 @@ msgstr "Ningún alias definido.\n" msgid "Key bindings (%d):" msgstr "Anclajes de clave:\n" +msgid "Key:" +msgstr "" + +#, fuzzy +msgid "No key found" +msgstr "Ningún alias definido.\n" + +#, fuzzy, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%s No ha sido posible atar la clave \"%s\"\n" + +#, fuzzy, c-format +msgid "Key \"%s\" unbound" +msgstr "Clave \"%s\" desatada\n" + +#, fuzzy, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%s No ha sido posible desatar la clave \"%s\"\n" + #, fuzzy msgid "Default key bindings restored" msgstr "Anclajes de clave por defecto restaurados\n" @@ -393,25 +412,6 @@ msgid_plural "%d new keys added" msgstr[0] "Sin ignores definidos.\n" msgstr[1] "Sin ignores definidos.\n" -#, fuzzy, c-format -msgid "Key \"%s\" unbound" -msgstr "Clave \"%s\" desatada\n" - -#, fuzzy, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%s No ha sido posible desatar la clave \"%s\"\n" - -msgid "Key:" -msgstr "" - -#, fuzzy -msgid "No key found" -msgstr "Ningún alias definido.\n" - -#, fuzzy, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%s No ha sido posible atar la clave \"%s\"\n" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "" @@ -984,16 +984,16 @@ msgid "bind/unbind keys" msgstr "atar/desatar claves" #, fuzzy -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "[clave función/comando] [desatar clave] [funciones] [reset -yes]" #, fuzzy msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" " clave: ata esta clave a una función interna o a un comando (comenzando " "por \"/ \")\n" @@ -2033,6 +2033,84 @@ msgstr "" msgid "Not enough memory for new line" msgstr "No hay suficiente memoria para una nueva línea\n" +#, fuzzy +msgid "names of buffers" +msgstr "falló al cargar el búfer" + +#, fuzzy +msgid "numbers of buffers" +msgstr "falló al cargar el búfer" + +msgid "names of buffers (including plugins names)" +msgstr "" + +#, fuzzy +msgid "configuration files" +msgstr "pedir al servidor que recargue su archivo de configuración" + +#, fuzzy +msgid "filename" +msgstr "los usuarios han sido desactivados" + +#, fuzzy +msgid "names of filters" +msgstr "Lista de alias:\n" + +#, fuzzy +msgid "commands (weechat and plugins)" +msgstr " (sin plugins)\n" + +#, fuzzy +msgid "names of infos hooked" +msgstr " manejadores de temporización:\n" + +#, fuzzy +msgid "names of infolists hooked" +msgstr " manejadores de temporización:\n" + +#, fuzzy +msgid "nicks in nicklist of current buffer" +msgstr "longitud inválida para un búfer" + +#, fuzzy +msgid "configuration options" +msgstr "Ninguna opción de configuración encontrada\n" + +#, fuzzy +msgid "names of plugins" +msgstr "poner opciones de configuración" + +#, fuzzy +msgid "commands defined by plugins" +msgstr " (sin plugins)\n" + +#, fuzzy +msgid "names of bars" +msgstr "Lista de alias:\n" + +#, fuzzy +msgid "values for a configuration option" +msgstr "Ninguna opción de configuración encontrada\n" + +#, fuzzy +msgid "weechat commands" +msgstr "Comandos internos %s :\n" + +#, fuzzy +msgid "names of proxies" +msgstr "Lista de alias:\n" + +#, fuzzy +msgid "options for proxies" +msgstr "Lista de alias:\n" + +#, fuzzy +msgid "options for bars" +msgstr "Lista de alias:\n" + +msgid "key codes" +msgstr "" + #, fuzzy msgid "Error: not enough memory to add a buffer to hotlist" msgstr "%s no es posible añadir un búfer a la lista caliente (hotlist)\n" @@ -2168,6 +2246,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -3424,6 +3505,48 @@ msgstr "%s el comando \"%s\" no puede ejecutarse en una ventana de servidor\n" msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "%s el comando \"%s\" no puede ejecutarse en una ventana de servidor\n" +#, fuzzy +msgid "current IRC server" +msgstr "conectarse a un servidor" + +#, fuzzy +msgid "nick on current IRC server" +msgstr "conectarse a un servidor" + +#, fuzzy +msgid "nicks on all channels of current IRC server" +msgstr "lista de canales a unirse cuando se conecte a un servidor" + +msgid "IRC servers (internal names)" +msgstr "" + +#, fuzzy +msgid "current IRC channel" +msgstr "usuario [destinatario [canal]]" + +#, fuzzy +msgid "nicks of current IRC channel" +msgstr "lista de usuarios en el canal" + +#, fuzzy +msgid "nicks and hostnames of current IRC channel" +msgstr "lista de usuarios en el canal" + +#, fuzzy +msgid "topic of current IRC channel" +msgstr "lista de usuarios en el canal" + +#, fuzzy +msgid "IRC channels (on all servers)" +msgstr "lista de canales a unirse cuando se conecte a un servidor" + +#, fuzzy +msgid "default part message for IRC channel" +msgstr "lista de usuarios en el canal" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5094,6 +5217,10 @@ msgid "" "Without argument, this command lists all loaded scripts." msgstr "" +#, fuzzy +msgid "list of scripts" +msgstr "Lista de alias:\n" + #. TRANSLATORS: %s is language (for example "perl") #, fuzzy, c-format msgid "list of %s scripts" @@ -5370,6 +5497,10 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +#, fuzzy +msgid "nicks of DCC chat" +msgstr "lista de usuarios en el canal" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -5521,6 +5652,10 @@ msgstr "%s no es posible crear el servidor\n" msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s falta un argumento para la opción --dir\n" +#, fuzzy +#~ msgid "list of aliases" +#~ msgstr "Lista de alias:\n" + #~ msgid "[action [args] | number | [[server] [channel]]]" #~ msgstr "[acción [argumentos] | número | [[servidor] [canal]]]" @@ -5533,10 +5668,6 @@ msgstr "%s falta un argumento para la opción --dir\n" #~ msgid " (used by a plugin)" #~ msgstr " (sin plugins)\n" -#, fuzzy -#~ msgid " (masked by a plugin)" -#~ msgstr " (sin plugins)\n" - #, fuzzy #~ msgid "plugin:" #~ msgstr " (sin plugins)\n" diff --git a/po/fr.po b/po/fr.po index 7ec767710..37b59b506 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" -"PO-Revision-Date: 2009-04-07 18:01+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"PO-Revision-Date: 2009-04-09 12:58+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -354,6 +354,24 @@ msgstr "Pas d'association de touche définie" msgid "Key bindings (%d):" msgstr "Associations de touches (%d):" +msgid "Key:" +msgstr "Touche:" + +msgid "No key found" +msgstr "Aucune touche trouvée" + +#, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%sErreur: impossible de créer la touche \"%s\"" + +#, c-format +msgid "Key \"%s\" unbound" +msgstr "Touche \"%s\" supprimée" + +#, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%sErreur: impossible de supprimer la touche \"%s\"" + msgid "Default key bindings restored" msgstr "Touches par défaut restaurées" @@ -369,24 +387,6 @@ msgid_plural "%d new keys added" msgstr[0] "%d nouvelle touche ajoutée" msgstr[1] "%d nouvelles touches ajoutées" -#, c-format -msgid "Key \"%s\" unbound" -msgstr "Touche \"%s\" supprimée" - -#, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%sErreur: impossible de supprimer la touche \"%s\"" - -msgid "Key:" -msgstr "Touche:" - -msgid "No key found" -msgstr "Aucune touche trouvée" - -#, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%sErreur: impossible de créer la touche \"%s\"" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "feuille: id: %d, parent: %d, extension: \"%s\", tampon: \"%s\"" @@ -1029,23 +1029,23 @@ msgstr "" msgid "bind/unbind keys" msgstr "associer/libérer des touches" -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" -"[touche [commande [args]]] | [unbind touche] | [reset -yes] | [missing]" +"[bind touche [commande [args]]] | [unbind touche] | [reset -yes] | [missing]" msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" -" touche: voir ou associer cette touche à une commande\n" -" unbind: supprimer l'association à une touche\n" -" reset: restaure les touches aux valeurs par défaut et supprime TOUTES " -"les touches personnelles (utiliser avec précaution !)\n" -" missing: ajoute les touches manquantes (en utilisant les touches par " -"défaut)" +" bind: associer une commande à une touche ou afficher la commande associée " +"à la touche\n" +" unbind: supprimer l'association à une touche\n" +" reset: restaure les touches aux valeurs par défaut et supprime TOUTES les " +"touches personnelles (utiliser avec précaution !)\n" +"missing: ajoute les touches manquantes (en utilisant les touches par défaut)" msgid "save/apply/reset layout for buffers and windows" msgstr "sauve/applique/réinitialise la disposition des tampons et fenêtres" @@ -2137,6 +2137,66 @@ msgstr "%sErreur: un tampon avec le même nom (%s) existe déjà" msgid "Not enough memory for new line" msgstr "Pas assez de mémoire pour une nouvelle ligne" +msgid "names of buffers" +msgstr "noms des tampons" + +msgid "numbers of buffers" +msgstr "numéros des tampons" + +msgid "names of buffers (including plugins names)" +msgstr "noms des tampons (incluant les noms d'extensions)" + +msgid "configuration files" +msgstr "fichiers de configuration" + +msgid "filename" +msgstr "nom de fichier" + +msgid "names of filters" +msgstr "noms des filtres" + +msgid "commands (weechat and plugins)" +msgstr "commandes (weechat et extensions)" + +msgid "names of infos hooked" +msgstr "noms des infos accrochées" + +msgid "names of infolists hooked" +msgstr "noms des infolistes accrochées" + +msgid "nicks in nicklist of current buffer" +msgstr "pseudos dans la liste des pseudos du tampon courant" + +msgid "configuration options" +msgstr "options de configuration" + +msgid "names of plugins" +msgstr "noms des extensions" + +msgid "commands defined by plugins" +msgstr "commandes définies par les extensions" + +msgid "names of bars" +msgstr "noms des barres" + +msgid "values for a configuration option" +msgstr "valeurs pour une option de configuration" + +msgid "weechat commands" +msgstr "commandes weechat" + +msgid "names of proxies" +msgstr "noms des proxies" + +msgid "options for proxies" +msgstr "options pour les proxies" + +msgid "options for bars" +msgstr "options pour les barres" + +msgid "key codes" +msgstr "codes des touches" + msgid "Error: not enough memory to add a buffer to hotlist" msgstr "Erreur: impossible d'ajouter le tampon à la liste des tampons actifs" @@ -2282,6 +2342,9 @@ msgstr "" "Les lignes d'entrée commençant par '/' ne sont pas vérifiées, sauf pour " "certaines commandes." +msgid "list of supported langs for aspell" +msgstr "liste des langues supportées pour aspell" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" "liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon" @@ -3582,6 +3645,39 @@ msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "" "%s%s: la commande \"%s\" doit être exécutée sur un serveur irc connecté" +msgid "current IRC server" +msgstr "serveur IRC courant" + +msgid "nick on current IRC server" +msgstr "pseudo sur le serveur IRC courant" + +msgid "nicks on all channels of current IRC server" +msgstr "pseudos sur tous les canaux du serveur IRC courant" + +msgid "IRC servers (internal names)" +msgstr "serveurs IRC (noms internes)" + +msgid "current IRC channel" +msgstr "canal IRC courant" + +msgid "nicks of current IRC channel" +msgstr "pseudos du canal IRC courant" + +msgid "nicks and hostnames of current IRC channel" +msgstr "pseudos et noms d'hôtes du canal IRC courant" + +msgid "topic of current IRC channel" +msgstr "titre du canal IRC courant" + +msgid "IRC channels (on all servers)" +msgstr "canaux IRC (sur tous les serveurs)" + +msgid "default part message for IRC channel" +msgstr "message de fin par défaut pour le canal IRC" + +msgid "numbers for defined ignores" +msgstr "numéros pour les ignores définis" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5306,6 +5402,9 @@ msgstr "" "\n" "Sans argument, cette commande liste tous les scripts chargés." +msgid "list of scripts" +msgstr "liste des scripts" + #. TRANSLATORS: %s is language (for example "perl") #, c-format msgid "list of %s scripts" @@ -5577,6 +5676,9 @@ msgstr "" "\n" "Sans paramètre, cette commande ouvre le tampon avec la liste des xfer." +msgid "nicks of DCC chat" +msgstr "pseudos de la discussion DCC" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" "ouvrir automatiquement le tampon xfer lorsqu'un nouveau xfer est ajouté à la " diff --git a/po/hu.po b/po/hu.po index 55aac80b4..6b6afc4e8 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -382,6 +382,26 @@ msgstr "Nincs aliasz definiálva.\n" msgid "Key bindings (%d):" msgstr "Billentyűparancsok:\n" +#, fuzzy +msgid "Key:" +msgstr "Billentyű:\n" + +#, fuzzy +msgid "No key found" +msgstr "Nem találtam billentyűt.\n" + +#, fuzzy, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n" + +#, fuzzy, c-format +msgid "Key \"%s\" unbound" +msgstr "A(z) \"%s\" billentyűparancs visszavonva\n" + +#, fuzzy, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%s nem sikerült a(z) \"%s\" billentyűparancsot visszavonni\n" + #, fuzzy msgid "Default key bindings restored" msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" @@ -398,26 +418,6 @@ msgid_plural "%d new keys added" msgstr[0] "Nincs mellőzés megadva.\n" msgstr[1] "Nincs mellőzés megadva.\n" -#, fuzzy, c-format -msgid "Key \"%s\" unbound" -msgstr "A(z) \"%s\" billentyűparancs visszavonva\n" - -#, fuzzy, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%s nem sikerült a(z) \"%s\" billentyűparancsot visszavonni\n" - -#, fuzzy -msgid "Key:" -msgstr "Billentyű:\n" - -#, fuzzy -msgid "No key found" -msgstr "Nem találtam billentyűt.\n" - -#, fuzzy, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "" @@ -1004,18 +1004,18 @@ msgid "bind/unbind keys" msgstr "billentyűk hozzárendelése/hozzárendelés eltávolítása" #, fuzzy -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" "[billentyű [funkció/parancs]] [unbind billentyű] [funkciók] [call funkció " "[\"paraméterek\"]] [reset -yes]" #, fuzzy msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" "billentyű: billentyű hozzárendelése valamely belső funkcióhoz vagy \"/\" " "jellel kezdődő parancshoz\n" @@ -2063,6 +2063,84 @@ msgstr "%s nem sikerült a \"%s\" modult betölteni: már van ilyen nevű modul\ msgid "Not enough memory for new line" msgstr "Nincs elég memória az új sorhoz\n" +#, fuzzy +msgid "names of buffers" +msgstr "puffer betöltése sikertelen" + +#, fuzzy +msgid "numbers of buffers" +msgstr "puffer betöltése sikertelen" + +msgid "names of buffers (including plugins names)" +msgstr "" + +#, fuzzy +msgid "configuration files" +msgstr "szerver konfigurációs fájljának újraolvastatása" + +#, fuzzy +msgid "filename" +msgstr "a felhasználók le lettek tiltva" + +#, fuzzy +msgid "names of filters" +msgstr "Aliaszok listája:\n" + +#, fuzzy +msgid "commands (weechat and plugins)" +msgstr " (nem található bővítőmodul)\n" + +#, fuzzy +msgid "names of infos hooked" +msgstr " időkezelők:\n" + +#, fuzzy +msgid "names of infolists hooked" +msgstr " időkezelők:\n" + +#, fuzzy +msgid "nicks in nicklist of current buffer" +msgstr "érvénytelen pufferhossz" + +#, fuzzy +msgid "configuration options" +msgstr "Nem található az opció\n" + +#, fuzzy +msgid "names of plugins" +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" + +#, fuzzy +msgid "names of bars" +msgstr "Aliaszok listája:\n" + +#, fuzzy +msgid "values for a configuration option" +msgstr "Nem található az opció\n" + +#, fuzzy +msgid "weechat commands" +msgstr "%s belső parancsok:\n" + +#, fuzzy +msgid "names of proxies" +msgstr "Aliaszok listája:\n" + +#, fuzzy +msgid "options for proxies" +msgstr "Aliaszok listája:\n" + +#, fuzzy +msgid "options for bars" +msgstr "Aliaszok listája:\n" + +msgid "key codes" +msgstr "" + #, fuzzy msgid "Error: not enough memory to add a buffer to hotlist" msgstr "%s nincs elég memória az ignore elkészítéséhez\n" @@ -2205,6 +2283,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -3474,6 +3555,48 @@ msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" +#, fuzzy +msgid "current IRC server" +msgstr "csatlakozás a szerver(ek)hez" + +#, fuzzy +msgid "nick on current IRC server" +msgstr "csatlakozás a szerver(ek)hez" + +#, fuzzy +msgid "nicks on all channels of current IRC server" +msgstr "szobák listája ahová be akarunk lépni csatlakozás után" + +msgid "IRC servers (internal names)" +msgstr "" + +#, fuzzy +msgid "current IRC channel" +msgstr "felhasználó [cél [szoba]]" + +#, fuzzy +msgid "nicks of current IRC channel" +msgstr "felhasználók listája a szobában" + +#, fuzzy +msgid "nicks and hostnames of current IRC channel" +msgstr "felhasználók listája a szobában" + +#, fuzzy +msgid "topic of current IRC channel" +msgstr "felhasználók listája a szobában" + +#, fuzzy +msgid "IRC channels (on all servers)" +msgstr "szobák listája ahová be akarunk lépni csatlakozás után" + +#, fuzzy +msgid "default part message for IRC channel" +msgstr "felhasználók listája a szobában" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5162,6 +5285,10 @@ msgid "" "Without argument, this command lists all loaded scripts." msgstr "" +#, fuzzy +msgid "list of scripts" +msgstr "Aliaszok listája:\n" + #. TRANSLATORS: %s is language (for example "perl") #, fuzzy, c-format msgid "list of %s scripts" @@ -5437,6 +5564,10 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +#, fuzzy +msgid "nicks of DCC chat" +msgstr "felhasználók listája a szobában" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -5580,6 +5711,10 @@ msgstr "%s DCC: nem sikerült 'nonblock' opciót beállítani a csatornán\n" msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" +#, fuzzy +#~ msgid "list of aliases" +#~ msgstr "Aliaszok listája:\n" + #, fuzzy #~ msgid "" #~ "smart completion for nicks (completes first with last speakers, " @@ -5597,10 +5732,6 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" #~ msgid " (used by a plugin)" #~ msgstr " (nem található bővítőmodul)\n" -#, fuzzy -#~ msgid " (masked by a plugin)" -#~ msgstr " (nem található bővítőmodul)\n" - #, fuzzy #~ msgid "plugin:" #~ msgstr " (nem található bővítőmodul)\n" diff --git a/po/ru.po b/po/ru.po index ee816cbb4..a4ffc940a 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -378,6 +378,26 @@ msgstr "Сокращения не заданы.\n" msgid "Key bindings (%d):" msgstr "Комбинации клавиш:\n" +#, fuzzy +msgid "Key:" +msgstr "Клавиша:\n" + +#, fuzzy +msgid "No key found" +msgstr "Клавиши не найдены.\n" + +#, fuzzy, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "%s не могу установить клавишу \"%s\"\n" + +#, fuzzy, c-format +msgid "Key \"%s\" unbound" +msgstr "Клавиша \"%s\" не привязана\n" + +#, fuzzy, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "%s не могу отвязать клавишу \"%s\"\n" + #, fuzzy msgid "Default key bindings restored" msgstr "Комбинации клавиш по умолчанию восстановлены\n" @@ -393,26 +413,6 @@ msgid_plural "%d new keys added" msgstr[0] "Игнорирования не заданы.\n" msgstr[1] "Игнорирования не заданы.\n" -#, fuzzy, c-format -msgid "Key \"%s\" unbound" -msgstr "Клавиша \"%s\" не привязана\n" - -#, fuzzy, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "%s не могу отвязать клавишу \"%s\"\n" - -#, fuzzy -msgid "Key:" -msgstr "Клавиша:\n" - -#, fuzzy -msgid "No key found" -msgstr "Клавиши не найдены.\n" - -#, fuzzy, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "%s не могу установить клавишу \"%s\"\n" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "" @@ -999,18 +999,18 @@ msgid "bind/unbind keys" msgstr "установить/снять клавиши" #, fuzzy -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" "[клавиша [функция/команда]] [unbind клавиша] [функции] [call функция " "[\"аргументы\"]] [reset -yes]" #, fuzzy msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" " клавиша: отобразить или назначить этой клавише функцию или команду " "(начинающуюся на \"/\")\n" @@ -2068,6 +2068,84 @@ msgstr "" msgid "Not enough memory for new line" msgstr "Недостаточно памяти для новой строчки\n" +#, fuzzy +msgid "names of buffers" +msgstr "загрузка буфера не удалась" + +#, fuzzy +msgid "numbers of buffers" +msgstr "загрузка буфера не удалась" + +msgid "names of buffers (including plugins names)" +msgstr "" + +#, fuzzy +msgid "configuration files" +msgstr "перезагрузить конфигурационный файл сервера" + +#, fuzzy +msgid "filename" +msgstr "команда users отключена" + +#, fuzzy +msgid "names of filters" +msgstr "Список сокращений:\n" + +#, fuzzy +msgid "commands (weechat and plugins)" +msgstr " (нет pluginа)\n" + +#, fuzzy +msgid "names of infos hooked" +msgstr " обработчики таймера:\n" + +#, fuzzy +msgid "names of infolists hooked" +msgstr " обработчики таймера:\n" + +#, fuzzy +msgid "nicks in nicklist of current buffer" +msgstr "некорректная длина буфера" + +#, fuzzy +msgid "configuration options" +msgstr "Не найден параметр\n" + +#, fuzzy +msgid "names of plugins" +msgstr "настроить параметры конфигурации" + +#, fuzzy +msgid "commands defined by plugins" +msgstr " (нет pluginа)\n" + +#, fuzzy +msgid "names of bars" +msgstr "Список сокращений:\n" + +#, fuzzy +msgid "values for a configuration option" +msgstr "Не найден параметр\n" + +#, fuzzy +msgid "weechat commands" +msgstr "Внутренние команды %s:\n" + +#, fuzzy +msgid "names of proxies" +msgstr "Список сокращений:\n" + +#, fuzzy +msgid "options for proxies" +msgstr "Список сокращений:\n" + +#, fuzzy +msgid "options for bars" +msgstr "Список сокращений:\n" + +msgid "key codes" +msgstr "" + #, fuzzy msgid "Error: not enough memory to add a buffer to hotlist" msgstr "%s не могу добавить буфер в хотлист\n" @@ -2209,6 +2287,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -3467,6 +3548,48 @@ msgstr "%s \"%s\" команда может быть выполнена толь msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "%s \"%s\" команда может быть выполнена только в буфере сервера\n" +#, fuzzy +msgid "current IRC server" +msgstr "подключиться к серверу(-ам)" + +#, fuzzy +msgid "nick on current IRC server" +msgstr "подключиться к серверу(-ам)" + +#, fuzzy +msgid "nicks on all channels of current IRC server" +msgstr "Список каналов, на которые заходить при соединении с сервером" + +msgid "IRC servers (internal names)" +msgstr "" + +#, fuzzy +msgid "current IRC channel" +msgstr "пользователь [цель [канал]]" + +#, fuzzy +msgid "nicks of current IRC channel" +msgstr "список ников на канале" + +#, fuzzy +msgid "nicks and hostnames of current IRC channel" +msgstr "список ников на канале" + +#, fuzzy +msgid "topic of current IRC channel" +msgstr "список ников на канале" + +#, fuzzy +msgid "IRC channels (on all servers)" +msgstr "Список каналов, на которые заходить при соединении с сервером" + +#, fuzzy +msgid "default part message for IRC channel" +msgstr "список ников на канале" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -5138,6 +5261,10 @@ msgid "" "Without argument, this command lists all loaded scripts." msgstr "" +#, fuzzy +msgid "list of scripts" +msgstr "Список сокращений:\n" + #. TRANSLATORS: %s is language (for example "perl") #, fuzzy, c-format msgid "list of %s scripts" @@ -5406,6 +5533,10 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +#, fuzzy +msgid "nicks of DCC chat" +msgstr "список ников на канале" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" @@ -5551,6 +5682,10 @@ msgstr "%s DCC: не могу установить неблокирующий р msgid "%s%s: timeout for \"%s\" with %s" msgstr "%s нет аргумента для параметра \"%s\"\n" +#, fuzzy +#~ msgid "list of aliases" +#~ msgstr "Список сокращений:\n" + #, fuzzy #~ msgid "" #~ "smart completion for nicks (completes first with last speakers, " @@ -5568,10 +5703,6 @@ msgstr "%s нет аргумента для параметра \"%s\"\n" #~ msgid " (used by a plugin)" #~ msgstr " (нет pluginа)\n" -#, fuzzy -#~ msgid " (masked by a plugin)" -#~ msgstr " (нет pluginа)\n" - #, fuzzy #~ msgid "plugin:" #~ msgstr " (нет pluginа)\n" diff --git a/po/weechat.pot b/po/weechat.pot index c89054c38..190b6546a 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: 2009-04-07 18:12+0200\n" +"POT-Creation-Date: 2009-04-09 12:57+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -333,6 +333,24 @@ msgstr "" msgid "Key bindings (%d):" msgstr "" +msgid "Key:" +msgstr "" + +msgid "No key found" +msgstr "" + +#, c-format +msgid "%sError: unable to bind key \"%s\"" +msgstr "" + +#, c-format +msgid "Key \"%s\" unbound" +msgstr "" + +#, c-format +msgid "%sError: unable to unbind key \"%s\"" +msgstr "" + msgid "Default key bindings restored" msgstr "" @@ -346,24 +364,6 @@ msgid_plural "%d new keys added" msgstr[0] "" msgstr[1] "" -#, c-format -msgid "Key \"%s\" unbound" -msgstr "" - -#, c-format -msgid "%sError: unable to unbind key \"%s\"" -msgstr "" - -msgid "Key:" -msgstr "" - -msgid "No key found" -msgstr "" - -#, c-format -msgid "%sError: unable to bind key \"%s\"" -msgstr "" - #, c-format msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\"" msgstr "" @@ -870,15 +870,15 @@ msgstr "" msgid "bind/unbind keys" msgstr "" -msgid "[key [command [args]]] | [unbind key] | [reset -yes] | [missing]" +msgid "[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]" msgstr "" msgid "" -" key: display or bind this key to a command\n" -" unbind: unbind a key\n" -" reset: restore bindings to the default values and delete ALL personal " +" bind: bind a command to a key or display command bound to key\n" +" unbind: remove a key binding\n" +" reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)\n" -" missing: add missing keys (using default bindings)" +"missing: add missing keys (using default bindings)" msgstr "" msgid "save/apply/reset layout for buffers and windows" @@ -1757,6 +1757,66 @@ msgstr "" msgid "Not enough memory for new line" msgstr "" +msgid "names of buffers" +msgstr "" + +msgid "numbers of buffers" +msgstr "" + +msgid "names of buffers (including plugins names)" +msgstr "" + +msgid "configuration files" +msgstr "" + +msgid "filename" +msgstr "" + +msgid "names of filters" +msgstr "" + +msgid "commands (weechat and plugins)" +msgstr "" + +msgid "names of infos hooked" +msgstr "" + +msgid "names of infolists hooked" +msgstr "" + +msgid "nicks in nicklist of current buffer" +msgstr "" + +msgid "configuration options" +msgstr "" + +msgid "names of plugins" +msgstr "" + +msgid "commands defined by plugins" +msgstr "" + +msgid "names of bars" +msgstr "" + +msgid "values for a configuration option" +msgstr "" + +msgid "weechat commands" +msgstr "" + +msgid "names of proxies" +msgstr "" + +msgid "options for proxies" +msgstr "" + +msgid "options for bars" +msgstr "" + +msgid "key codes" +msgstr "" + msgid "Error: not enough memory to add a buffer to hotlist" msgstr "" @@ -1880,6 +1940,9 @@ msgid "" "Input line beginning with a '/' is not checked, except for some commands." msgstr "" +msgid "list of supported langs for aspell" +msgstr "" + msgid "comma separated list of dictionaries to use on this buffer" msgstr "" @@ -2954,6 +3017,39 @@ msgstr "" msgid "%s%s: command \"%s\" must be executed on connected irc server" msgstr "" +msgid "current IRC server" +msgstr "" + +msgid "nick on current IRC server" +msgstr "" + +msgid "nicks on all channels of current IRC server" +msgstr "" + +msgid "IRC servers (internal names)" +msgstr "" + +msgid "current IRC channel" +msgstr "" + +msgid "nicks of current IRC channel" +msgstr "" + +msgid "nicks and hostnames of current IRC channel" +msgstr "" + +msgid "topic of current IRC channel" +msgstr "" + +msgid "IRC channels (on all servers)" +msgstr "" + +msgid "default part message for IRC channel" +msgstr "" + +msgid "numbers for defined ignores" +msgstr "" + #, c-format msgid "" "%s%s: warning: server \"%s\" not found in configuration file, not deleted in " @@ -4447,6 +4543,9 @@ msgid "" "Without argument, this command lists all loaded scripts." msgstr "" +msgid "list of scripts" +msgstr "" + #. TRANSLATORS: %s is language (for example "perl") #, c-format msgid "list of %s scripts" @@ -4698,6 +4797,9 @@ msgid "" "Without argument, this command opens buffer with xfer list." msgstr "" +msgid "nicks of DCC chat" +msgstr "" + msgid "auto open xfer buffer when a new xfer is added to list" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index cd11607c3..85f0a9328 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1753,6 +1753,69 @@ command_key (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } + /* bind a key (or display binding) */ + if (string_strcasecmp (argv[1], "bind") == 0) + { + if (argc == 3) + { + ptr_key = NULL; + internal_code = gui_keyboard_get_internal_code (argv[2]); + if (internal_code) + ptr_key = gui_keyboard_search (NULL, internal_code); + if (ptr_key) + { + gui_chat_printf (NULL, ""); + gui_chat_printf (NULL, _("Key:")); + command_key_display (ptr_key); + } + else + { + gui_chat_printf (NULL, + _("No key found")); + } + if (internal_code) + free (internal_code); + return WEECHAT_RC_OK; + } + + /* bind new key */ + gui_keyboard_verbose = 1; + ptr_key = gui_keyboard_bind (NULL, argv[2], argv_eol[3]); + gui_keyboard_verbose = 0; + if (!ptr_key) + { + gui_chat_printf (NULL, + _("%sError: unable to bind key \"%s\""), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[2]); + return WEECHAT_RC_ERROR; + } + return WEECHAT_RC_OK; + } + + /* unbind a key */ + if (string_strcasecmp (argv[1], "unbind") == 0) + { + if (argc >= 3) + { + if (gui_keyboard_unbind (NULL, argv[2])) + { + gui_chat_printf (NULL, + _("Key \"%s\" unbound"), + argv[2]); + } + else + { + gui_chat_printf (NULL, + _("%sError: unable to unbind key \"%s\""), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[2]); + return WEECHAT_RC_ERROR; + } + } + return WEECHAT_RC_OK; + } + /* reset keys (only with "-yes", for security reason) */ if (string_strcasecmp (argv[1], "reset") == 0) { @@ -1789,65 +1852,6 @@ command_key (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } - /* unbind a key */ - if (string_strcasecmp (argv[1], "unbind") == 0) - { - if (argc >= 3) - { - if (gui_keyboard_unbind (NULL, argv[2])) - { - gui_chat_printf (NULL, - _("Key \"%s\" unbound"), - argv[2]); - } - else - { - gui_chat_printf (NULL, - _("%sError: unable to unbind key \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[2]); - return WEECHAT_RC_ERROR; - } - } - return WEECHAT_RC_OK; - } - - /* display a key */ - if (argc == 2) - { - ptr_key = NULL; - internal_code = gui_keyboard_get_internal_code (argv[1]); - if (internal_code) - ptr_key = gui_keyboard_search (NULL, internal_code); - if (ptr_key) - { - gui_chat_printf (NULL, ""); - gui_chat_printf (NULL, _("Key:")); - command_key_display (ptr_key); - } - else - { - gui_chat_printf (NULL, - _("No key found")); - } - if (internal_code) - free (internal_code); - return WEECHAT_RC_OK; - } - - /* bind new key */ - gui_keyboard_verbose = 1; - ptr_key = gui_keyboard_bind (NULL, argv[1], argv_eol[2]); - gui_keyboard_verbose = 0; - if (!ptr_key) - { - gui_chat_printf (NULL, - _("%sError: unable to bind key \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[1]); - return WEECHAT_RC_ERROR; - } - return WEECHAT_RC_OK; } @@ -3658,10 +3662,17 @@ command_init () " /bar scroll nicklist #weechat y-100%\n" " scroll to end of nicklist on current buffer:\n" " /bar scroll nicklist * ye"), - "add|default|del|set|hide|show|toggle|scroll|list|listfull|" - "listitems %r name|hidden|priority|conditions|position|" - "filling_top_bottom|filling_left_right|size|size_max|" - "color_fg|color_delim|color_bg|separator|items", + "add %(bars_names) root|window bottom|top|left|right" + " || default" + " || del %(bars_names)|-all" + " || set %(bars_names) %(bars_options)" + " || hide %(bars_names)" + " || show %(bars_names)" + " || toggle %(bars_names)" + " || scroll %(bars_names) %(buffers_plugins_names)|*" + " || list" + " || listfull" + " || listitems", &command_bar, NULL); hook_command (NULL, "buffer", N_("manage buffers"), @@ -3686,7 +3697,15 @@ command_init () " close buffer: /buffer close\n" " jump to #weechat: /buffer #weechat\n" " jump to next buffer: /buffer +1"), - "clear|move|close|list|notify|localvar|set|%b %b", + "clear -all|%(buffers_numbers)" + " || move %(buffers_numbers)" + " || close" + " || list" + " || notify" + " || localvar" + " || set" + " || %(buffers_names)" + " || %(buffers_numbers)", &command_buffer, NULL); hook_command (NULL, "command", N_("launch explicit WeeChat or plugin command"), @@ -3695,7 +3714,7 @@ command_init () "command)\n" "command: command to execute (a '/' is automatically " "added if not found at beginning of command)"), - "%p|" PLUGIN_CORE " %P", + "%(plugins_names)|" PLUGIN_CORE " %(plugins_commands)", &command_command, NULL); hook_command (NULL, "debug", N_("control debug for core/plugins"), @@ -3709,7 +3728,7 @@ command_init () "windows: display windows tree\n" " text: send \"debug\" signal with \"text\" as " "argument"), - "%p|core|list|dump|buffer|windows", + "%(plugins_names)|core|list|dump|buffer|windows", &command_debug, NULL); hook_command (NULL, "filter", N_("filter messages in buffers, to hide/show them according " @@ -3745,14 +3764,19 @@ command_init () " filter lines containing \"weechat sucks\" on IRC " "channel #weechat:\n" " /filter add sucks irc.freenode.#weechat * weechat sucks"), - "list|enable|disable|toggle|add|rename|del %F %B", + "list" + " || enable %(filters_names)" + " || disable %(filters_names)" + " || toggle %(filters_names)" + " || add %(filters_names) %(buffers_plugins_names)|*" + " || del %(filters_names)|-all", &command_filter, NULL); hook_command (NULL, "help", N_("display help about commands and options"), N_("[command | option]"), N_("command: a command name\n" " option: an option name (use /set to see list)"), - "%h|%o", + "%(commands)|%(config_options)", &command_help, NULL); hook_command (NULL, "history", N_("show buffer command history"), @@ -3791,14 +3815,18 @@ command_init () &command_input, NULL); hook_command (NULL, "key", N_("bind/unbind keys"), - N_("[key [command [args]]] | [unbind key] | [reset -yes] | " - "[missing]"), - N_(" key: display or bind this key to a command\n" - " unbind: unbind a key\n" - " reset: restore bindings to the default values and " + N_("[bind key [command [args]]] | [unbind key] | " + "[reset -yes] | [missing]"), + N_(" bind: bind a command to a key or display command " + "bound to key\n" + " unbind: remove a key binding\n" + " reset: restore bindings to the default values and " "delete ALL personal bindings (use carefully!)\n" - " missing: add missing keys (using default bindings)"), - "unbind|reset|missing", + "missing: add missing keys (using default bindings)"), + "bind %(keys_codes) %(commands)" + " || unbind %(key_codes)" + " || reset" + " || missing", &command_key, NULL); hook_command (NULL, "layout", N_("save/apply/reset layout for buffers and windows"), @@ -3824,7 +3852,12 @@ command_init () "all plugins, then autoload plugins)\n" " unload: unload one or all plugins\n\n" "Without argument, this command lists loaded plugins."), - "list|listfull|load|autoload|reload|unload %f|%p", + "list %(plugins_names)" + " || listfull %(plugins_names)" + " || load %(filename)" + " || autoload" + " || reload %(plugins_names)" + " || unload %(plugins_names)", &command_plugin, NULL); hook_command (NULL, "proxy", N_("manage proxies"), @@ -3854,7 +3887,10 @@ command_init () " /proxy add myproxy socks5 sample.host.org 3128 myuser mypass\n" " delete a proxy:\n" " /proxy del myproxy"), - "add|del|set|list %y name|type|ipv6|address|port|username|password", + "add %(proxies_names) http|socks4|socks5" + " || del %(proxies_names)" + " || set %(proxies_names) %(proxies_options)" + " || list ", &command_proxy, NULL); hook_command (NULL, "quit", N_("quit WeeChat"), @@ -3867,7 +3903,7 @@ command_init () N_("file: configuration file to reload\n\n" "Without argument, all files (WeeChat and plugins) are " "reloaded."), - "%c|%*", + "%(config_files)|%*", &command_reload, NULL); hook_command (NULL, "save", N_("save configuration files to disk"), @@ -3875,7 +3911,7 @@ command_init () N_("file: configuration file to save\n\n" "Without argument, all files (WeeChat and plugins) are " "saved."), - "%c|%*", + "%(config_files)|%*", &command_save, NULL); hook_command (NULL, "set", N_("set config options"), @@ -3890,7 +3926,7 @@ command_init () "For all types, you can use null to remove " "option value (undefined value). This works only " "for some special plugin variables."), - "%o %v", + "%(config_options) %(config_option_values)", &command_set, NULL); hook_command (NULL, "unset", N_("unset/reset config options"), @@ -3899,7 +3935,7 @@ command_init () "to mass-reset options, use carefully!)\n\n" "According to option, it's reset (for standard options) " "or removed (for optional settings, like server values)."), - "%o", + "%(config_options)", &command_unset, NULL); hook_command (NULL, "upgrade", N_("upgrade WeeChat without disconnecting from servers"), @@ -3909,7 +3945,7 @@ command_init () "This command run again a WeeChat binary, so it should " "have been compiled or installed with a package manager " "before running this command."), - "%f", + "%(filename)", &command_upgrade, NULL); hook_command (NULL, "uptime", N_("show WeeChat uptime"), @@ -3967,10 +4003,11 @@ command_init () " scroll 2 lines up: /window scroll -2\n" " scroll 2 days up: /window scroll -2d\n" " scroll to beginning of current day: /window scroll -d"), - "list|-1|+1|up|down|left|right|splith|splitv|resize|merge|" - "page_up|page_down|refresh|scroll_up|scroll|scroll_down|" - "scroll_top|scroll_bottom|scroll_previous_highlight|" - "scroll_next_highlight|zoom all", + "list|-1|+1|up|down|left|right|splith|splitv|resize|page_up|" + "page_down|refresh|scroll_up|scroll|scroll_down|scroll_top|" + "scroll_bottom|scroll_previous_highlight|" + "scroll_next_highlight|zoom" + " || merge all", &command_window, NULL); } diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 5841516f0..94ccb915b 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -1606,7 +1606,7 @@ config_weechat_init_options () "default_template", "string", N_("default completion template (please see documentation for template " "codes and values)"), - NULL, 0, 0, "%n|%(irc_channels)", NULL, 0, + NULL, 0, 0, "%(nicks)|%(irc_channels)", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_add_space = config_file_new_option ( weechat_config_file, ptr_section, diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index f5e880488..c6e41d97f 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -35,9 +35,11 @@ #include "weechat.h" #include "wee-hook.h" #include "wee-infolist.h" +#include "wee-list.h" #include "wee-log.h" #include "wee-network.h" #include "wee-string.h" +#include "wee-utf8.h" #include "wee-util.h" #include "../gui/gui-buffer.h" #include "../gui/gui-chat.h" @@ -321,6 +323,164 @@ hook_search_command (struct t_weechat_plugin *plugin, const char *command) return NULL; } +/* + * hook_command_build_completion: build variables/arrays that will be used for + * completion of commands arguments + */ + +void +hook_command_build_completion (struct t_hook_command *hook_command) +{ + int i, j, k, length, num_items; + struct t_weelist *list; + char *pos_completion, *pos_double_pipe, *pos_start, *pos_end; + char **items, *last_space, *ptr_template; + + /* split templates using "||" as separator */ + hook_command->cplt_num_templates = 1; + pos_completion = hook_command->completion; + while ((pos_double_pipe = strstr (pos_completion, "||")) != NULL) + { + hook_command->cplt_num_templates++; + pos_completion = pos_double_pipe + 2; + } + hook_command->cplt_templates = malloc (hook_command->cplt_num_templates * + sizeof (*hook_command->cplt_templates)); + for (i = 0; i < hook_command->cplt_num_templates; i++) + { + hook_command->cplt_templates[i] = NULL; + } + pos_completion = hook_command->completion; + i = 0; + while (pos_completion) + { + pos_double_pipe = strstr (pos_completion, "||"); + if (!pos_double_pipe) + pos_double_pipe = pos_completion + strlen (pos_completion); + pos_start = pos_completion; + pos_end = pos_double_pipe - 1; + if (pos_end < pos_start) + { + hook_command->cplt_templates[i] = strdup (""); + } + else + { + while (pos_start[0] == ' ') + { + pos_start++; + } + pos_end = pos_double_pipe - 1; + while ((pos_end > pos_start) && (pos_end[0] == ' ')) + { + pos_end--; + } + hook_command->cplt_templates[i] = string_strndup (pos_start, + pos_end - pos_start + 1); + } + i++; + if (!pos_double_pipe[0]) + pos_completion = NULL; + else + pos_completion = pos_double_pipe + 2; + } + + /* for each template, split/count args */ + hook_command->cplt_templates_static = malloc (hook_command->cplt_num_templates * + sizeof (*hook_command->cplt_templates_static)); + hook_command->cplt_template_num_args = malloc (hook_command->cplt_num_templates * + sizeof (*hook_command->cplt_template_num_args)); + hook_command->cplt_template_args = malloc (hook_command->cplt_num_templates * + sizeof (*hook_command->cplt_template_args)); + hook_command->cplt_template_num_args_concat = 0; + for (i = 0; i < hook_command->cplt_num_templates; i++) + { + /* build static part of template: it's first argument(s) which does not + contain "%" or "|" */ + last_space = NULL; + ptr_template = hook_command->cplt_templates[i]; + while (ptr_template && ptr_template[0]) + { + if (ptr_template[0] == ' ') + last_space = ptr_template; + else if ((ptr_template[0] == '%') || (ptr_template[0] == '|')) + break; + ptr_template = utf8_next_char (ptr_template); + } + if (last_space) + { + last_space--; + while (last_space > hook_command->cplt_templates[i]) + { + if (last_space[0] != ' ') + break; + } + if (last_space < hook_command->cplt_templates[i]) + last_space = NULL; + else + last_space++; + } + if (last_space) + hook_command->cplt_templates_static[i] = string_strndup (hook_command->cplt_templates[i], + last_space - hook_command->cplt_templates[i]); + else + hook_command->cplt_templates_static[i] = strdup (hook_command->cplt_templates[i]); + + /* build arguments for each template */ + hook_command->cplt_template_args[i] = string_explode (hook_command->cplt_templates[i], + " ", 0, 0, + &(hook_command->cplt_template_num_args[i])); + if (hook_command->cplt_template_num_args[i] > hook_command->cplt_template_num_args_concat) + hook_command->cplt_template_num_args_concat = hook_command->cplt_template_num_args[i]; + } + + /* build strings with concatentaion of items from different templates + for each argument: these strings will be used when completing argument + if we can't find which template to use (for example for first argument) + */ + hook_command->cplt_template_args_concat = malloc (hook_command->cplt_template_num_args_concat * + sizeof (*hook_command->cplt_template_args_concat)); + list = weelist_new (); + for (i = 0; i < hook_command->cplt_template_num_args_concat; i++) + { + /* first compute length */ + length = 1; + for (j = 0; j < hook_command->cplt_num_templates; j++) + { + if (i < hook_command->cplt_template_num_args[j]) + length += strlen (hook_command->cplt_template_args[j][i]) + 1; + } + /* alloc memory */ + hook_command->cplt_template_args_concat[i] = malloc (length); + if (hook_command->cplt_template_args_concat[i]) + { + /* concatene items with "|" as separator */ + weelist_remove_all (list); + hook_command->cplt_template_args_concat[i][0] = '\0'; + for (j = 0; j < hook_command->cplt_num_templates; j++) + { + if (i < hook_command->cplt_template_num_args[j]) + { + items = string_explode (hook_command->cplt_template_args[j][i], + "|", 0, 0, &num_items); + for (k = 0; k < num_items; k++) + { + if (!weelist_search (list, items[k])) + { + if (hook_command->cplt_template_args_concat[i][0]) + strcat (hook_command->cplt_template_args_concat[i], "|"); + strcat (hook_command->cplt_template_args_concat[i], + items[k]); + weelist_add (list, items[k], WEECHAT_LIST_POS_END, + NULL); + } + } + string_free_exploded (items); + } + } + } + } +} + /* * hook_command: hook a command */ @@ -374,6 +534,16 @@ hook_command (struct t_weechat_plugin *plugin, const char *command, new_hook_command->completion = (completion) ? strdup (completion) : strdup (""); + /* build completion variables for command */ + new_hook_command->cplt_num_templates = 0; + new_hook_command->cplt_templates = NULL; + new_hook_command->cplt_templates_static = NULL; + new_hook_command->cplt_template_num_args = NULL; + new_hook_command->cplt_template_args = NULL; + new_hook_command->cplt_template_num_args_concat = 0; + new_hook_command->cplt_template_args_concat = NULL; + hook_command_build_completion (new_hook_command); + hook_add_to_list (new_hook); return new_hook; @@ -1593,6 +1763,7 @@ hook_config_exec (const char *option, const char *value) struct t_hook * hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, + const char *description, t_hook_callback_completion *callback, void *callback_data) { struct t_hook *new_hook; @@ -1617,6 +1788,8 @@ hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, new_hook->hook_data = new_hook_completion; new_hook_completion->callback = callback; new_hook_completion->completion_item = strdup (completion_item); + new_hook_completion->description = + (description) ? strdup (description) : strdup (""); hook_add_to_list (new_hook); @@ -1950,6 +2123,8 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name, void unhook (struct t_hook *hook) { + int i; + /* invalid hook? */ if (!hook_valid (hook)) return; @@ -1982,6 +2157,20 @@ unhook (struct t_hook *hook) free (HOOK_COMMAND(hook, args_description)); if (HOOK_COMMAND(hook, completion)) free (HOOK_COMMAND(hook, completion)); + if (HOOK_COMMAND(hook, cplt_templates)) + { + for (i = 0; i < HOOK_COMMAND(hook, cplt_num_templates); i++) + { + if (HOOK_COMMAND(hook, cplt_templates)[i]) + free (HOOK_COMMAND(hook, cplt_templates)[i]); + if (HOOK_COMMAND(hook, cplt_templates_static)[i]) + free (HOOK_COMMAND(hook, cplt_templates_static)[i]); + string_free_exploded (HOOK_COMMAND(hook, cplt_template_args)[i]); + } + free (HOOK_COMMAND(hook, cplt_templates)); + } + if (HOOK_COMMAND(hook, cplt_template_num_args)) + free (HOOK_COMMAND(hook, cplt_template_num_args)); break; case HOOK_TYPE_COMMAND_RUN: if (HOOK_COMMAND_RUN(hook, command)) @@ -2048,6 +2237,8 @@ unhook (struct t_hook *hook) case HOOK_TYPE_COMPLETION: if (HOOK_COMPLETION(hook, completion_item)) free (HOOK_COMPLETION(hook, completion_item)); + if (HOOK_COMPLETION(hook, description)) + free (HOOK_COMPLETION(hook, description)); break; case HOOK_TYPE_MODIFIER: if (HOOK_MODIFIER(hook, modifier)) @@ -2343,6 +2534,13 @@ hook_add_to_infolist_type (struct t_infolist *infolist, return 0; if (!infolist_new_var_string (ptr_item, "completion_item", HOOK_COMPLETION(ptr_hook, completion_item))) return 0; + if (!infolist_new_var_string (ptr_item, "description", HOOK_COMPLETION(ptr_hook, description))) + return 0; + if (!infolist_new_var_string (ptr_item, "description_nls", + (HOOK_COMPLETION(ptr_hook, description) + && HOOK_COMPLETION(ptr_hook, description)[0]) ? + _(HOOK_COMPLETION(ptr_hook, description)) : "")) + return 0; } break; case HOOK_TYPE_MODIFIER: @@ -2429,7 +2627,7 @@ hook_add_to_infolist (struct t_infolist *infolist, void hook_print_log () { - int type; + int type, i, j; struct t_hook *ptr_hook; struct tm *local_time; char text_time[1024]; @@ -2441,164 +2639,186 @@ hook_print_log () { log_printf (""); log_printf ("[hook (addr:0x%lx)]", ptr_hook); - log_printf (" plugin . . . . . . . . : 0x%lx ('%s')", + log_printf (" plugin. . . . . . . . . : 0x%lx ('%s')", ptr_hook->plugin, plugin_get_name (ptr_hook->plugin)); - log_printf (" deleted. . . . . . . . : %d", ptr_hook->deleted); - log_printf (" running. . . . . . . . : %d", ptr_hook->running); - log_printf (" type . . . . . . . . . : %d (%s)", + log_printf (" deleted . . . . . . . . : %d", ptr_hook->deleted); + log_printf (" running . . . . . . . . : %d", ptr_hook->running); + log_printf (" type. . . . . . . . . . : %d (%s)", ptr_hook->type, hook_type_string[ptr_hook->type]); - log_printf (" callback_data. . . . . : 0x%lx", ptr_hook->callback_data); + log_printf (" callback_data . . . . . : 0x%lx", ptr_hook->callback_data); switch (ptr_hook->type) { case HOOK_TYPE_COMMAND: if (!ptr_hook->deleted) { log_printf (" command data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_COMMAND(ptr_hook, callback)); - log_printf (" command. . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, command)); - log_printf (" description. . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); - log_printf (" args . . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); - log_printf (" args_description . . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); - log_printf (" completion . . . . . : '%s'", HOOK_COMMAND(ptr_hook, completion)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND(ptr_hook, callback)); + log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, command)); + log_printf (" description . . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); + log_printf (" args. . . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); + log_printf (" args_description. . . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); + log_printf (" completion. . . . . . : '%s'", HOOK_COMMAND(ptr_hook, completion)); + log_printf (" cplt_num_templates. . : %d", HOOK_COMMAND(ptr_hook, cplt_num_templates)); + for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_num_templates); i++) + { + log_printf (" cplt_templates[%04d] . . . : '%s'", + i, HOOK_COMMAND(ptr_hook, cplt_templates)[i]); + log_printf (" cplt_templates_static[%04d]: '%s'", + i, HOOK_COMMAND(ptr_hook, cplt_templates_static)[i]); + log_printf (" num_args. . . . . . : %d", + HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]); + for (j = 0; j < HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]; j++) + { + log_printf (" args[%04d]. . . . . : '%s'", + j, HOOK_COMMAND(ptr_hook, cplt_template_args)[i][j]); + } + } + log_printf (" num_args_concat . . . : %d", HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat)); + for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat); i++) + { + log_printf (" args_concat[%04d] . . : '%s'", + i, HOOK_COMMAND(ptr_hook, cplt_template_args_concat)[i]); + } } break; case HOOK_TYPE_COMMAND_RUN: if (!ptr_hook->deleted) { log_printf (" command_run data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_COMMAND_RUN(ptr_hook, callback)); - log_printf (" command. . . . . . . : '%s'", HOOK_COMMAND_RUN(ptr_hook, command)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND_RUN(ptr_hook, callback)); + log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND_RUN(ptr_hook, command)); } break; case HOOK_TYPE_TIMER: if (!ptr_hook->deleted) { log_printf (" timer data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_TIMER(ptr_hook, callback)); - log_printf (" interval . . . . . . : %ld", HOOK_TIMER(ptr_hook, interval)); - log_printf (" align_second . . . . : %d", HOOK_TIMER(ptr_hook, align_second)); - log_printf (" remaining_calls. . . : %d", HOOK_TIMER(ptr_hook, remaining_calls)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_TIMER(ptr_hook, callback)); + log_printf (" interval. . . . . . . : %ld", HOOK_TIMER(ptr_hook, interval)); + log_printf (" align_second. . . . . : %d", HOOK_TIMER(ptr_hook, align_second)); + log_printf (" remaining_calls . . . : %d", HOOK_TIMER(ptr_hook, remaining_calls)); local_time = localtime (&HOOK_TIMER(ptr_hook, last_exec).tv_sec); strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); - log_printf (" last_exec.tv_sec . . : %ld (%s)", + log_printf (" last_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, last_exec.tv_sec), text_time); - log_printf (" last_exec.tv_usec. . : %ld", HOOK_TIMER(ptr_hook, last_exec.tv_usec)); + log_printf (" last_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, last_exec.tv_usec)); local_time = localtime (&HOOK_TIMER(ptr_hook, next_exec).tv_sec); strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); - log_printf (" next_exec.tv_sec . . : %ld (%s)", + log_printf (" next_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, next_exec.tv_sec), text_time); - log_printf (" next_exec.tv_usec. . : %ld", HOOK_TIMER(ptr_hook, next_exec.tv_usec)); + log_printf (" next_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, next_exec.tv_usec)); } break; case HOOK_TYPE_FD: if (!ptr_hook->deleted) { log_printf (" fd data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_FD(ptr_hook, callback)); - log_printf (" fd . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd)); - log_printf (" flags. . . . . . . . : %d", HOOK_FD(ptr_hook, flags)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_FD(ptr_hook, callback)); + log_printf (" fd. . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd)); + log_printf (" flags . . . . . . . . : %d", HOOK_FD(ptr_hook, flags)); } break; case HOOK_TYPE_PROCESS: if (!ptr_hook->deleted) { log_printf (" process data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, callback)); - log_printf (" command. . . . . . . : '%s'", HOOK_PROCESS(ptr_hook, command)); - log_printf (" timeout. . . . . . . : %d", HOOK_PROCESS(ptr_hook, timeout)); - log_printf (" child_stdout_read. . : %d", HOOK_PROCESS(ptr_hook, child_stdout_read)); - log_printf (" child_stdout_write . : %d", HOOK_PROCESS(ptr_hook, child_stdout_write)); - log_printf (" child_stderr_read. . : %d", HOOK_PROCESS(ptr_hook, child_stderr_read)); - log_printf (" child_stderr_write . : %d", HOOK_PROCESS(ptr_hook, child_stderr_write)); - log_printf (" child_pid. . . . . . : %d", HOOK_PROCESS(ptr_hook, child_pid)); - log_printf (" hook_fd_stdout . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd_stdout)); - log_printf (" hook_fd_stderr . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd_stderr)); - log_printf (" hook_timer . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_timer)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, callback)); + log_printf (" command . . . . . . . : '%s'", HOOK_PROCESS(ptr_hook, command)); + log_printf (" timeout . . . . . . . : %d", HOOK_PROCESS(ptr_hook, timeout)); + log_printf (" child_stdout_read . . : %d", HOOK_PROCESS(ptr_hook, child_stdout_read)); + log_printf (" child_stdout_write. . : %d", HOOK_PROCESS(ptr_hook, child_stdout_write)); + log_printf (" child_stderr_read . . : %d", HOOK_PROCESS(ptr_hook, child_stderr_read)); + log_printf (" child_stderr_write. . : %d", HOOK_PROCESS(ptr_hook, child_stderr_write)); + log_printf (" child_pid . . . . . . : %d", HOOK_PROCESS(ptr_hook, child_pid)); + log_printf (" hook_fd_stdout. . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd_stdout)); + log_printf (" hook_fd_stderr. . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd_stderr)); + log_printf (" hook_timer. . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_timer)); } break; case HOOK_TYPE_CONNECT: if (!ptr_hook->deleted) { log_printf (" connect data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, callback)); - log_printf (" address. . . . . . . : '%s'", HOOK_CONNECT(ptr_hook, address)); - log_printf (" port . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, port)); - log_printf (" sock . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, sock)); - log_printf (" ipv6 . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, ipv6)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, callback)); + log_printf (" address . . . . . . . : '%s'", HOOK_CONNECT(ptr_hook, address)); + log_printf (" port. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, port)); + log_printf (" sock. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, sock)); + log_printf (" ipv6. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, ipv6)); #ifdef HAVE_GNUTLS - log_printf (" gnutls_sess. . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_sess)); + log_printf (" gnutls_sess . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_sess)); #endif - log_printf (" local_hostname . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname)); - log_printf (" child_read . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read)); - log_printf (" child_write. . . . . : %d", HOOK_CONNECT(ptr_hook, child_write)); - log_printf (" child_pid. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_pid)); - log_printf (" hook_fd. . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_fd)); + log_printf (" local_hostname. . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname)); + log_printf (" child_read. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read)); + log_printf (" child_write . . . . . : %d", HOOK_CONNECT(ptr_hook, child_write)); + log_printf (" child_pid . . . . . . : %d", HOOK_CONNECT(ptr_hook, child_pid)); + log_printf (" hook_fd . . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_fd)); } break; case HOOK_TYPE_PRINT: if (!ptr_hook->deleted) { log_printf (" print data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, callback)); - log_printf (" buffer . . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, buffer)); - log_printf (" tags_count . . . . . : %d", HOOK_PRINT(ptr_hook, tags_count)); - log_printf (" tags_array . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, tags_array)); - log_printf (" message. . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message)); - log_printf (" strip_colors . . . . : %d", HOOK_PRINT(ptr_hook, strip_colors)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, callback)); + log_printf (" buffer. . . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, buffer)); + log_printf (" tags_count. . . . . . : %d", HOOK_PRINT(ptr_hook, tags_count)); + log_printf (" tags_array. . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, tags_array)); + log_printf (" message . . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message)); + log_printf (" strip_colors. . . . . : %d", HOOK_PRINT(ptr_hook, strip_colors)); } break; case HOOK_TYPE_SIGNAL: if (!ptr_hook->deleted) { log_printf (" signal data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_SIGNAL(ptr_hook, callback)); - log_printf (" signal . . . . . . . : '%s'", HOOK_SIGNAL(ptr_hook, signal)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_SIGNAL(ptr_hook, callback)); + log_printf (" signal. . . . . . . . : '%s'", HOOK_SIGNAL(ptr_hook, signal)); } break; case HOOK_TYPE_CONFIG: if (!ptr_hook->deleted) { log_printf (" config data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_CONFIG(ptr_hook, callback)); - log_printf (" option . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONFIG(ptr_hook, callback)); + log_printf (" option. . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); } break; case HOOK_TYPE_COMPLETION: if (!ptr_hook->deleted) { log_printf (" completion data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_COMPLETION(ptr_hook, callback)); - log_printf (" completion_item. . . : '%s'", HOOK_COMPLETION(ptr_hook, completion_item)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMPLETION(ptr_hook, callback)); + log_printf (" completion_item . . . : '%s'", HOOK_COMPLETION(ptr_hook, completion_item)); + log_printf (" description . . . . . : '%s'", HOOK_COMPLETION(ptr_hook, description)); } break; case HOOK_TYPE_MODIFIER: if (!ptr_hook->deleted) { log_printf (" modifier data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_MODIFIER(ptr_hook, callback)); - log_printf (" modifier . . . . . . : '%s'", HOOK_MODIFIER(ptr_hook, modifier)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_MODIFIER(ptr_hook, callback)); + log_printf (" modifier. . . . . . . : '%s'", HOOK_MODIFIER(ptr_hook, modifier)); } break; case HOOK_TYPE_INFO: if (!ptr_hook->deleted) { log_printf (" info data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_INFO(ptr_hook, callback)); - log_printf (" info_name. . . . . . : '%s'", HOOK_INFO(ptr_hook, info_name)); - log_printf (" description. . . . . : '%s'", HOOK_INFO(ptr_hook, description)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFO(ptr_hook, callback)); + log_printf (" info_name . . . . . . : '%s'", HOOK_INFO(ptr_hook, info_name)); + log_printf (" description . . . . . : '%s'", HOOK_INFO(ptr_hook, description)); } break; case HOOK_TYPE_INFOLIST: if (!ptr_hook->deleted) { log_printf (" infolist data:"); - log_printf (" callback . . . . . . : 0x%lx", HOOK_INFOLIST(ptr_hook, callback)); - log_printf (" infolist_name. . . . : '%s'", HOOK_INFOLIST(ptr_hook, infolist_name)); - log_printf (" description. . . . . : '%s'", HOOK_INFOLIST(ptr_hook, description)); + log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFOLIST(ptr_hook, callback)); + log_printf (" infolist_name . . . . : '%s'", HOOK_INFOLIST(ptr_hook, infolist_name)); + log_printf (" description . . . . . : '%s'", HOOK_INFOLIST(ptr_hook, description)); } break; case HOOK_NUM_TYPES: @@ -2606,8 +2826,8 @@ hook_print_log () it is never used as type */ break; } - log_printf (" prev_hook. . . . . . . : 0x%lx", ptr_hook->prev_hook); - log_printf (" next_hook. . . . . . . : 0x%lx", ptr_hook->next_hook); + log_printf (" prev_hook . . . . . . . : 0x%lx", ptr_hook->prev_hook); + log_printf (" next_hook . . . . . . . : 0x%lx", ptr_hook->next_hook); } } } diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index fb6aa0010..2827d3c31 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -97,12 +97,26 @@ typedef int (t_hook_callback_command)(void *data, struct t_gui_buffer *buffer, struct t_hook_command { - t_hook_callback_command *callback; /* command callback */ - char *command; /* name of command (without '/') */ - char *description; /* (for /help) short cmd description */ - char *args; /* (for /help) command arguments */ - char *args_description; /* (for /help) args long description */ - char *completion; /* template for completion */ + t_hook_callback_command *callback; /* command callback */ + char *command; /* name of command (without '/') */ + char *description; /* (for /help) short cmd description*/ + char *args; /* (for /help) command arguments */ + char *args_description; /* (for /help) args long description*/ + char *completion; /* template for completion */ + + /* templates */ + int cplt_num_templates; /* number of templates for compl. */ + char **cplt_templates; /* completion templates */ + char **cplt_templates_static; /* static part of template (at */ + /* beginning */ + + /* arguments for each template */ + int *cplt_template_num_args; /* number of arguments for template */ + char ***cplt_template_args; /* arguments for each template */ + + /* concatenation of arg N for each template */ + int cplt_template_num_args_concat; /* number of concatened arguments */ + char **cplt_template_args_concat; /* concatened arguments */ }; /* hook command run */ @@ -241,6 +255,7 @@ struct t_hook_completion { t_hook_callback_completion *callback; /* completion callback */ char *completion_item; /* name of completion */ + char *description; /* description */ }; /* hook modifier */ @@ -355,6 +370,7 @@ extern struct t_hook *hook_config (struct t_weechat_plugin *plugin, extern void hook_config_exec (const char *option, const char *value); extern struct t_hook *hook_completion (struct t_weechat_plugin *plugin, const char *completion_item, + const char *description, t_hook_callback_completion *callback, void *callback_data); extern void hook_completion_list_add (struct t_gui_completion *completion, diff --git a/src/core/wee-proxy.h b/src/core/wee-proxy.h index b4fde0b44..b7b521f73 100644 --- a/src/core/wee-proxy.h +++ b/src/core/wee-proxy.h @@ -52,6 +52,7 @@ struct t_proxy /* variables */ +extern char *proxy_option_string[]; extern char *proxy_type_string[]; extern struct t_proxy *weechat_proxies; extern struct t_proxy *last_weechat_proxy; diff --git a/src/core/weechat.c b/src/core/weechat.c index 236f5c3db..d32e0c53e 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -64,6 +64,7 @@ #include "wee-util.h" #include "../gui/gui-chat.h" #include "../gui/gui-color.h" +#include "../gui/gui-completion.h" #include "../gui/gui-layout.h" #include "../gui/gui-main.h" #include "../gui/gui-keyboard.h" @@ -388,6 +389,7 @@ main (int argc, char *argv[]) gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */ weechat_init_vars (); /* initialize some variables */ command_init (); /* initialize WeeChat commands */ + gui_completion_init (); /* add core completion hooks */ gui_keyboard_init (); /* init keyboard */ if (!config_weechat_init ()) /* init options with default values */ exit (EXIT_FAILURE); diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h index 5b9484912..2a8f79694 100644 --- a/src/gui/gui-bar.h +++ b/src/gui/gui-bar.h @@ -98,6 +98,7 @@ struct t_gui_bar /* variables */ +extern char *gui_bar_option_string[]; extern char *gui_bar_type_string[]; extern char *gui_bar_position_string[]; extern char *gui_bar_filling_string[]; diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 142d99abb..9a9858e56 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -346,7 +346,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin, if (new_completion) { new_buffer->completion = new_completion; - gui_completion_init (new_completion, new_buffer); + gui_completion_buffer_init (new_completion, new_buffer); } /* init history */ diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 482c55fd2..50e4b5328 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -/* gui-completion.c: completes words according to context */ +/* gui-completion.c: word completion according to context */ #ifdef HAVE_CONFIG_H @@ -54,17 +54,17 @@ struct t_gui_completion_partial *last_gui_completion_partial = NULL; /* - * gui_completion_init: init completion + * gui_completion_buffer_init: init completion for a buffer */ void -gui_completion_init (struct t_gui_completion *completion, - struct t_gui_buffer *buffer) +gui_completion_buffer_init (struct t_gui_completion *completion, + struct t_gui_buffer *buffer) { completion->buffer = buffer; completion->context = GUI_COMPLETION_NULL; completion->base_command = NULL; - completion->base_command_arg = 0; + completion->base_command_arg_index = 0; completion->base_word = NULL; completion->base_word_pos = 0; completion->position = -1; @@ -334,49 +334,134 @@ gui_completion_list_add (struct t_gui_completion *completion, const char *word, } /* - * gui_completion_list_add_bars_names: add bars names to completion list + * gui_completion_list_add_bars_names_cb: add bars names to completion list */ -void -gui_completion_list_add_bars_names (struct t_gui_completion *completion) +int +gui_completion_list_add_bars_names_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_gui_bar *ptr_bar; - + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar) { gui_completion_list_add (completion, ptr_bar->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_buffers_names: add buffers names to completion list + * gui_completion_list_add_bars_options: add bars options to completion list */ -void -gui_completion_list_add_buffers_names (struct t_gui_completion *completion) +int +gui_completion_list_add_bars_options_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + int i; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (i = 0; i < GUI_BAR_NUM_OPTIONS; i++) + { + gui_completion_list_add (completion, gui_bar_option_string[i], + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + +/* + * gui_completion_list_add_buffers_names_cb: add buffers names to completion + * list + */ + +int +gui_completion_list_add_buffers_names_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_gui_buffer *ptr_buffer; - + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) { gui_completion_list_add (completion, ptr_buffer->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_plugins_buffers_names: add plugins + buffers names - * to completion list + * gui_completion_list_add_buffers_numbers_cb: add buffers numbers to + * completion list */ -void -gui_completion_list_add_plugins_buffers_names (struct t_gui_completion *completion) +int +gui_completion_list_add_buffers_numbers_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + struct t_gui_buffer *ptr_buffer; + char str_number[32]; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (ptr_buffer = gui_buffers; ptr_buffer; + ptr_buffer = ptr_buffer->next_buffer) + { + snprintf (str_number, sizeof (str_number), "%d", ptr_buffer->number); + gui_completion_list_add (completion, str_number, + 0, WEECHAT_LIST_POS_END); + } + + return WEECHAT_RC_OK; +} + +/* + * gui_completion_list_add_buffers_plugins_names_cb: add plugins + buffers names + * to completion list + */ + +int +gui_completion_list_add_buffers_plugins_names_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_gui_buffer *ptr_buffer; char name[512]; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) { @@ -386,45 +471,65 @@ gui_completion_list_add_plugins_buffers_names (struct t_gui_completion *completi gui_completion_list_add (completion, name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_config_files: add config files to completion list + * gui_completion_list_add_config_files_cb: add config files to completion list */ -void -gui_completion_list_add_config_files (struct t_gui_completion *completion) +int +gui_completion_list_add_config_files_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_config_file *ptr_config_file; - + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_config_file = config_files; ptr_config_file; ptr_config_file = ptr_config_file->next_config) { gui_completion_list_add (completion, ptr_config_file->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* * gui_completion_list_add_filename: add filename to completion list */ -void -gui_completion_list_add_filename (struct t_gui_completion *completion) +int +gui_completion_list_add_filename_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { char *path_d, *path_b, *p, *d_name; char *real_prefix, *prefix; - char *buffer; - int buffer_len; + char *buf; + int buf_len; DIR *dp; struct dirent *entry; struct stat statbuf; char home[3] = { '~', DIR_SEPARATOR_CHAR, '\0' }; - buffer_len = PATH_MAX; - buffer = malloc (buffer_len); - if (!buffer) - return; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + buf_len = PATH_MAX; + buf = malloc (buf_len); + if (!buf) + return WEECHAT_RC_OK; completion->add_space = 0; @@ -445,22 +550,22 @@ gui_completion_list_add_filename (struct t_gui_completion *completion) prefix = strdup (DIR_SEPARATOR); } - snprintf (buffer, buffer_len, "%s", completion->base_word + strlen (prefix)); - p = strrchr (buffer, DIR_SEPARATOR_CHAR); + snprintf (buf, buf_len, "%s", completion->base_word + strlen (prefix)); + p = strrchr (buf, DIR_SEPARATOR_CHAR); if (p) { *p = '\0'; - path_d = strdup (buffer); + path_d = strdup (buf); p++; path_b = strdup (p); } else { path_d = strdup (""); - path_b = strdup (buffer); + path_b = strdup (buf); } - sprintf (buffer, "%s%s%s", real_prefix, DIR_SEPARATOR, path_d); - d_name = strdup (buffer); + sprintf (buf, "%s%s%s", real_prefix, DIR_SEPARATOR, path_d); + d_name = strdup (buf); dp = opendir (d_name); if (dp != NULL) { @@ -471,12 +576,12 @@ gui_completion_list_add_filename (struct t_gui_completion *completion) if (strcmp (entry->d_name, ".") == 0 || strcmp (entry->d_name, "..") == 0) continue; - snprintf(buffer, buffer_len, "%s%s%s", + snprintf(buf, buf_len, "%s%s%s", d_name, DIR_SEPARATOR, entry->d_name); - if (stat(buffer, &statbuf) == -1) + if (stat(buf, &statbuf) == -1) continue; - snprintf(buffer, buffer_len, "%s%s%s%s%s%s", + snprintf(buf, buf_len, "%s%s%s%s%s%s", prefix, ((strcmp(prefix, "") == 0) || strchr(prefix, DIR_SEPARATOR_CHAR)) ? "" : DIR_SEPARATOR, @@ -485,7 +590,7 @@ gui_completion_list_add_filename (struct t_gui_completion *completion) entry->d_name, S_ISDIR(statbuf.st_mode) ? DIR_SEPARATOR : ""); - gui_completion_list_add (completion, buffer, + gui_completion_list_add (completion, buf, 0, WEECHAT_LIST_POS_SORT); } } @@ -497,35 +602,55 @@ gui_completion_list_add_filename (struct t_gui_completion *completion) free (real_prefix); free (path_d); free (path_b); - free (buffer); + free (buf); + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_filters: add filters to completion list + * gui_completion_list_add_filters_cb: add filters to completion list */ -void -gui_completion_list_add_filters (struct t_gui_completion *completion) +int +gui_completion_list_add_filters_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_gui_filter *ptr_filter; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_filter = gui_filters; ptr_filter; ptr_filter = ptr_filter->next_filter) { gui_completion_list_add (completion, ptr_filter->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_command_hooks: add command hooks to completion list + * gui_completion_list_add_commands_cb: add command hooks to completion list */ -void -gui_completion_list_add_command_hooks (struct t_gui_completion *completion) +int +gui_completion_list_add_commands_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_hook *ptr_hook; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { @@ -536,17 +661,27 @@ gui_completion_list_add_command_hooks (struct t_gui_completion *completion) HOOK_COMMAND(ptr_hook, command), 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_info_hooks: add info hooks to completion list + * gui_completion_list_add_infos_cb: add info hooks to completion list */ -void -gui_completion_list_add_info_hooks (struct t_gui_completion *completion) +int +gui_completion_list_add_infos_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_hook *ptr_hook; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_hook = weechat_hooks[HOOK_TYPE_INFO]; ptr_hook; ptr_hook = ptr_hook->next_hook) { @@ -557,17 +692,27 @@ gui_completion_list_add_info_hooks (struct t_gui_completion *completion) HOOK_INFO(ptr_hook, info_name), 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_infolist_hooks: add infolist hooks to completion list + * gui_completion_list_add_infolists_cb: add infolist hooks to completion list */ -void -gui_completion_list_add_infolist_hooks (struct t_gui_completion *completion) +int +gui_completion_list_add_infolists_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_hook *ptr_hook; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_hook = weechat_hooks[HOOK_TYPE_INFOLIST]; ptr_hook; ptr_hook = ptr_hook->next_hook) { @@ -578,19 +723,29 @@ gui_completion_list_add_infolist_hooks (struct t_gui_completion *completion) HOOK_INFOLIST(ptr_hook, infolist_name), 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_nicks: add nicks to completion list + * gui_completion_list_add_nicks_cb: add nicks to completion list */ -void -gui_completion_list_add_nicks (struct t_gui_completion *completion) +int +gui_completion_list_add_nicks_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_gui_nick_group *ptr_group; struct t_gui_nick *ptr_nick; int count_before; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + count_before = weelist_size (completion->completion_list); hook_completion_exec (completion->buffer->plugin, "nick", @@ -616,14 +771,20 @@ gui_completion_list_add_nicks (struct t_gui_completion *completion) &ptr_group, &ptr_nick); } } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_option: add config option to completion list + * gui_completion_list_add_config_options_cb: add config option to completion + * list */ -void -gui_completion_list_add_option (struct t_gui_completion *completion) +int +gui_completion_list_add_config_options_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_config_file *ptr_config; struct t_config_section *ptr_section; @@ -631,6 +792,11 @@ gui_completion_list_add_option (struct t_gui_completion *completion) int length; char *option_full_name; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_config = config_files; ptr_config; ptr_config = ptr_config->next_config) { @@ -657,38 +823,58 @@ gui_completion_list_add_option (struct t_gui_completion *completion) } } } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_plugin: add plugin name to completion list + * gui_completion_list_add_plugins_cb: add plugin name to completion list */ -void -gui_completion_list_add_plugin (struct t_gui_completion *completion) +int +gui_completion_list_add_plugins_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_weechat_plugin *ptr_plugin; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_plugin = weechat_plugins; ptr_plugin; ptr_plugin = ptr_plugin->next_plugin) { gui_completion_list_add (completion, ptr_plugin->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_plugin_commands: add plugin commands to completion - * list (plugin name is previous - * argument) + * gui_completion_list_add_plugins_commands_cb: add plugin commands to completion + * list (plugin name is previous + * argument) */ -void -gui_completion_list_add_plugin_commands (struct t_gui_completion *completion) +int +gui_completion_list_add_plugins_commands_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { char *pos_space, *plugin_name; struct t_weechat_plugin *ptr_plugin; struct t_hook *ptr_hook; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + if (completion->args) { pos_space = strchr (completion->args, ' '); @@ -707,7 +893,7 @@ gui_completion_list_add_plugin_commands (struct t_gui_completion *completion) plugin list */ ptr_plugin = plugin_search (plugin_name); if (!ptr_plugin) - return; + return WEECHAT_RC_OK; } for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) @@ -725,14 +911,20 @@ gui_completion_list_add_plugin_commands (struct t_gui_completion *completion) free (plugin_name); } } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_option_value: add option value to completion list + * gui_completion_list_add_config_option_values_cb: add option value to + * completion list */ -void -gui_completion_list_add_option_value (struct t_gui_completion *completion) +int +gui_completion_list_add_config_option_values_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { char *pos_space, *option_full_name, *pos_section, *pos_option; char *file, *section, *value_string; @@ -742,6 +934,11 @@ gui_completion_list_add_option_value (struct t_gui_completion *completion) struct t_config_section *ptr_section, *section_found; struct t_config_option *option_found; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + if (completion->args) { pos_space = strchr (completion->args, ' '); @@ -943,17 +1140,28 @@ gui_completion_list_add_option_value (struct t_gui_completion *completion) free (section); } } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_weechat_cmd: add WeeChat commands to completion list + * gui_completion_list_add_weechat_commands_cb: add WeeChat commands to + * completion list */ -void -gui_completion_list_add_weechat_cmd (struct t_gui_completion *completion) +int +gui_completion_list_add_weechat_commands_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_hook *ptr_hook; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; ptr_hook; ptr_hook = ptr_hook->next_hook) { @@ -967,23 +1175,94 @@ gui_completion_list_add_weechat_cmd (struct t_gui_completion *completion) 0, WEECHAT_LIST_POS_SORT); } } + + return WEECHAT_RC_OK; } /* - * gui_completion_list_add_proxies_names: add proxies names to completion list + * gui_completion_list_add_proxies_names_cb: add proxies names to completion + * list */ -void -gui_completion_list_add_proxies_names (struct t_gui_completion *completion) +int +gui_completion_list_add_proxies_names_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) { struct t_proxy *ptr_proxy; + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + for (ptr_proxy = weechat_proxies; ptr_proxy; ptr_proxy = ptr_proxy->next_proxy) { gui_completion_list_add (completion, ptr_proxy->name, 0, WEECHAT_LIST_POS_SORT); } + + return WEECHAT_RC_OK; +} + +/* + * gui_completion_list_add_proxies_options: add proxies options to completion + * list + */ + +int +gui_completion_list_add_proxies_options_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + int i; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (i = 0; i < PROXY_NUM_OPTIONS; i++) + { + gui_completion_list_add (completion, proxy_option_string[i], + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + +/* + * gui_completion_list_add_keys_codes_cb: add keys to completion list + */ + +int +gui_completion_list_add_keys_codes_cb (void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + struct t_gui_key *ptr_key; + char *expanded_name; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key) + { + expanded_name = gui_keyboard_get_expanded_name (ptr_key->key); + gui_completion_list_add (completion, + (expanded_name) ? expanded_name : ptr_key->key, + 0, WEECHAT_LIST_POS_SORT); + if (expanded_name) + free (expanded_name); + } + + return WEECHAT_RC_OK; } /* @@ -1045,54 +1324,6 @@ gui_completion_build_list_template (struct t_gui_completion *completion, break; case '*': /* repeat last completion (do nothing there) */ break; - case 'b': /* buffers names */ - gui_completion_list_add_buffers_names (completion); - break; - case 'B': /* plugin + "." + buffer name */ - gui_completion_list_add_plugins_buffers_names (completion); - break; - case 'c': /* config files */ - gui_completion_list_add_config_files (completion); - break; - case 'f': /* filename */ - gui_completion_list_add_filename (completion); - break; - case 'F': /* filters */ - gui_completion_list_add_filters (completion); - break; - case 'h': /* command hooks */ - gui_completion_list_add_command_hooks (completion); - break; - case 'i': /* infos hooked */ - gui_completion_list_add_info_hooks (completion); - break; - case 'I': /* infolists hooked */ - gui_completion_list_add_infolist_hooks (completion); - break; - case 'n': /* nick */ - gui_completion_list_add_nicks (completion); - break; - case 'o': /* config option */ - gui_completion_list_add_option (completion); - break; - case 'p': /* plugin name */ - gui_completion_list_add_plugin (completion); - break; - case 'P': /* plugin commands */ - gui_completion_list_add_plugin_commands (completion); - break; - case 'r': /* bar names */ - gui_completion_list_add_bars_names (completion); - break; - case 'v': /* value of config option */ - gui_completion_list_add_option_value (completion); - break; - case 'w': /* WeeChat commands */ - gui_completion_list_add_weechat_cmd (completion); - break; - case 'y': /* proxy names */ - gui_completion_list_add_proxies_names (completion); - break; case '(': /* custom completion by a plugin */ pos++; pos_end = strchr (pos, ')'); @@ -1128,16 +1359,77 @@ gui_completion_build_list_template (struct t_gui_completion *completion, } /* - * gui_completion_build_list: build data list according to command and argument # + * gui_completion_get_matching_template: get template matching arguments for + * command + */ + +int +gui_completion_get_matching_template (struct t_gui_completion *completion, + struct t_hook *hook_command) +{ + int i, length; + + /* without at least one argument, we can't find matching template! */ + if (completion->base_command_arg_index <= 1) + return -1; + + for (i = 0; i < HOOK_COMMAND(hook_command, cplt_num_templates); i++) + { + length = strlen (HOOK_COMMAND(hook_command, cplt_templates_static)[i]); + if ((strncmp (HOOK_COMMAND(hook_command, cplt_templates_static)[i], + completion->args, length) == 0) + && (completion->args[length] == ' ')) + { + return i; + } + } + + return -1; +} + +/* + * gui_completion_get_template_for_args: get template according to user + * arguments for command + */ + +char * +gui_completion_get_template_for_args (struct t_gui_completion *completion, + struct t_hook *hook_command) +{ + int matching_template; + + /* if only one template available, then use it */ + if (HOOK_COMMAND(hook_command, cplt_num_templates) == 1) + return strdup (HOOK_COMMAND(hook_command, cplt_templates)[0]); + + /* search which template is matching arguments from user */ + matching_template = gui_completion_get_matching_template (completion, + hook_command); + if (matching_template >= 0) + { + return strdup (HOOK_COMMAND(hook_command, cplt_templates[matching_template])); + } + else + { + if (HOOK_COMMAND(hook_command, cplt_template_num_args_concat) >= completion->base_command_arg_index) + return strdup (HOOK_COMMAND(hook_command, cplt_template_args_concat[completion->base_command_arg_index - 1])); + else + return strdup (""); + } +} + +/* + * gui_completion_build_list: build data list according to command and + * argument index */ void gui_completion_build_list (struct t_gui_completion *completion) { struct t_hook *ptr_hook; - char *pos_template, *pos_space; + char *template, *pos_template, *pos_space; int repeat_last, i, length; - + repeat_last = 0; ptr_hook = gui_completion_search_command (completion); @@ -1148,30 +1440,36 @@ gui_completion_build_list (struct t_gui_completion *completion) return; } - length = strlen (HOOK_COMMAND(ptr_hook, completion)); + template = gui_completion_get_template_for_args (completion, ptr_hook); + if (!template) + return; + + length = strlen (template); if (length >= 2) { - if (strcmp (HOOK_COMMAND(ptr_hook, completion) + length - 2, - "%*") == 0) + if (strcmp (template + length - 2, "%*") == 0) repeat_last = 1; } i = 1; - pos_template = HOOK_COMMAND(ptr_hook, completion); + pos_template = template; while (pos_template && pos_template[0]) { pos_space = strchr (pos_template, ' '); - if (i == completion->base_command_arg) + if (i == completion->base_command_arg_index) { gui_completion_build_list_template (completion, pos_template, ptr_hook->plugin); + free (template); return; } if (pos_space) { pos_template = pos_space; while (pos_template[0] == ' ') + { pos_template++; + } } else pos_template = NULL; @@ -1186,6 +1484,7 @@ gui_completion_build_list (struct t_gui_completion *completion) completion), ptr_hook->plugin); } + free (template); } /* @@ -1200,7 +1499,7 @@ gui_completion_find_context (struct t_gui_completion *completion, /* look for context */ gui_completion_free_data (completion); - gui_completion_init (completion, completion->buffer); + gui_completion_buffer_init (completion, completion->buffer); command = ((data[0] == '/') && (data[1] != '/')) ? 1 : 0; command_arg = 0; i = 0; @@ -1222,12 +1521,12 @@ gui_completion_find_context (struct t_gui_completion *completion, if (command_arg > 0) { completion->context = GUI_COMPLETION_COMMAND_ARG; - completion->base_command_arg = command_arg; + completion->base_command_arg_index = command_arg; } else { completion->context = GUI_COMPLETION_COMMAND; - completion->base_command_arg = 0; + completion->base_command_arg_index = 0; } } else @@ -1637,7 +1936,7 @@ gui_completion_auto (struct t_gui_completion *completion) || (completion->base_word[0] == '~')) { if (!completion->completion_list->items) - gui_completion_list_add_filename (completion); + gui_completion_list_add_filename_cb (NULL, NULL, NULL, completion); gui_completion_complete (completion); return; } @@ -1731,7 +2030,7 @@ gui_completion_print_log (struct t_gui_completion *completion) log_printf (" buffer. . . . . . . . . : 0x%lx", completion->buffer); log_printf (" context . . . . . . . . : %d", completion->context); log_printf (" base_command. . . . . . : '%s'", completion->base_command); - log_printf (" base_command_arg. . . . : %d", completion->base_command_arg); + log_printf (" base_command_arg_index. : %d", completion->base_command_arg_index); log_printf (" base_word . . . . . . . : '%s'", completion->base_word); log_printf (" base_word_pos . . . . . : %d", completion->base_word_pos); log_printf (" position. . . . . . . . : %d", completion->position); @@ -1752,3 +2051,72 @@ gui_completion_print_log (struct t_gui_completion *completion) "completion list element"); } } + +/* + * gui_completion_init: add hooks for completions done by WeeChat core + */ + +void +gui_completion_init () +{ + hook_completion (NULL, "buffers_names", /* it was %b */ + N_("names of buffers"), + &gui_completion_list_add_buffers_names_cb, NULL); + hook_completion (NULL, "buffers_numbers", + N_("numbers of buffers"), + &gui_completion_list_add_buffers_numbers_cb, NULL); + hook_completion (NULL, "buffers_plugins_names", /* it was %B */ + N_("names of buffers (including plugins names)"), + &gui_completion_list_add_buffers_plugins_names_cb, NULL); + hook_completion (NULL, "config_files", /* it was %c */ + N_("configuration files"), + &gui_completion_list_add_config_files_cb, NULL); + hook_completion (NULL, "filename", /* it was %f */ + N_("filename"), + &gui_completion_list_add_filename_cb, NULL); + hook_completion (NULL, "filters_names", /* it was %F */ + N_("names of filters"), + &gui_completion_list_add_filters_cb, NULL); + hook_completion (NULL, "commands", /* it was %h */ + N_("commands (weechat and plugins)"), + &gui_completion_list_add_commands_cb, NULL); + hook_completion (NULL, "infos", /* it was %i */ + N_("names of infos hooked"), + &gui_completion_list_add_infos_cb, NULL); + hook_completion (NULL, "infolists", /* it was %I */ + N_("names of infolists hooked"), + &gui_completion_list_add_infolists_cb, NULL); + hook_completion (NULL, "nicks", /* it was %n */ + N_("nicks in nicklist of current buffer"), + &gui_completion_list_add_nicks_cb, NULL); + hook_completion (NULL, "config_options", /* it was %o */ + N_("configuration options"), + &gui_completion_list_add_config_options_cb, NULL); + hook_completion (NULL, "plugins_names", /* it was %p */ + N_("names of plugins"), + &gui_completion_list_add_plugins_cb, NULL); + hook_completion (NULL, "plugins_commands", /* it was %P */ + N_("commands defined by plugins"), + &gui_completion_list_add_plugins_commands_cb, NULL); + hook_completion (NULL, "bars_names", /* it was %r */ + N_("names of bars"), + &gui_completion_list_add_bars_names_cb, NULL); + hook_completion (NULL, "config_option_values", /* it was %v */ + N_("values for a configuration option"), + &gui_completion_list_add_config_option_values_cb, NULL); + hook_completion (NULL, "weechat_commands", /* it was %w */ + N_("weechat commands"), + &gui_completion_list_add_weechat_commands_cb, NULL); + hook_completion (NULL, "proxies_names", /* it was %y */ + N_("names of proxies"), + &gui_completion_list_add_proxies_names_cb, NULL); + hook_completion (NULL, "proxies_options", + N_("options for proxies"), + &gui_completion_list_add_proxies_options_cb, NULL); + hook_completion (NULL, "bars_options", + N_("options for bars"), + &gui_completion_list_add_bars_options_cb, NULL); + hook_completion (NULL, "keys_codes", + N_("key codes"), + &gui_completion_list_add_keys_codes_cb, NULL); +} diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h index 072ecbde3..b5b43654d 100644 --- a/src/gui/gui-completion.h +++ b/src/gui/gui-completion.h @@ -31,7 +31,7 @@ struct t_gui_completion struct t_gui_buffer *buffer; /* buffer where completion was asked */ int context; /* context: null, nick, command, cmd arg */ char *base_command; /* cmd with arg to complete (can be NULL) */ - int base_command_arg; /* # arg to complete (if context=cmd arg) */ + int base_command_arg_index; /* # arg to complete (if context=cmd arg) */ char *base_word; /* word to complete (when Tab was pressed) */ int base_word_pos; /* beggining of base word */ int position; /* position where Tab was pressed */ @@ -63,8 +63,8 @@ extern struct t_gui_completion_partial *gui_completion_partial_list; /* completion functions */ -extern void gui_completion_init (struct t_gui_completion *completion, - struct t_gui_buffer *buffer); +extern void gui_completion_buffer_init (struct t_gui_completion *completion, + struct t_gui_buffer *buffer); extern void gui_completion_free (struct t_gui_completion *completion); extern void gui_completion_stop (struct t_gui_completion *completion, int remove_partial_completion_list); @@ -75,5 +75,6 @@ extern void gui_completion_search (struct t_gui_completion *completion, int direction, const char *data, int size, int pos); extern void gui_completion_print_log (struct t_gui_completion *completion); +extern void gui_completion_init (); #endif /* gui-completion.h */ diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index 4c2d0e4c5..53e724fcd 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -953,7 +953,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "by user, and $* is replaced by all arguments.\n" "Variables $nick, $channel and $server are " "replaced by current nick/channel/server."), - "%(alias) %h", + "%(alias) %(commands)", &alias_command_cb, NULL); weechat_hook_command ("unalias", N_("remove an alias"), @@ -962,7 +962,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "%(alias)", &unalias_command_cb, NULL); - weechat_hook_completion ("alias", &alias_completion_cb, NULL); + weechat_hook_completion ("alias", N_("list of alias"), + &alias_completion_cb, NULL); alias_info_init (); diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c index 74724edec..98095f38a 100644 --- a/src/plugins/aspell/weechat-aspell.c +++ b/src/plugins/aspell/weechat-aspell.c @@ -909,6 +909,31 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } +/* + * weechat_aspell_completion_langs_cb: completion with aspell langs + */ + +int +weechat_aspell_completion_langs_cb (void *data, const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + int i; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (i = 0; langs_avail[i].code; i++) + { + weechat_hook_completion_list_add (completion, langs_avail[i].code, + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + /* * weechat_plugin_init : init aspell plugin */ @@ -941,8 +966,14 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "\n" "Input line beginning with a '/' is not checked, " "except for some commands."), - "dictlist|enable|disable|addword", + "dictlist" + " || enable %(aspell_langs)" + " || disable" + " || addword", &weechat_aspell_command_cb, NULL); + weechat_hook_completion ("aspell_langs", + N_("list of supported langs for aspell"), + &weechat_aspell_completion_langs_cb, NULL); /* callback for buffer_switch */ weechat_hook_signal ("buffer_switch", diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index 5158c1dde..112394c79 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -416,7 +416,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "arguments: optional arguments for info\n\n" "Without argument, this command displays list " "of available infos"), - "%i", + "%(infos)", &demo_info_command_cb, NULL); weechat_hook_command ("demo_infolist", @@ -426,7 +426,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) "arguments: optional arguments for infolist\n\n" "Without argument, this command displays list " "of available infolists"), - "%I", + "%(infolists)", &demo_infolist_command_cb, NULL); weechat_hook_signal ("*", &demo_signal_cb, NULL); diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 76f0b552c..dae2904a3 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -3773,7 +3773,9 @@ irc_command_init () "is 6667)\n" " ipv6: use IPv6 protocol\n" " ssl: use SSL protocol"), - "%(irc_servers)|-all|-nojoin|%*", &irc_command_connect, NULL); + "-all -nojoin" + " || %(irc_servers)|%*", + &irc_command_connect, NULL); weechat_hook_command ("ctcp", N_("send a CTCP message (Client-To-Client Protocol)"), N_("receiver type [arguments]"), @@ -3781,7 +3783,7 @@ irc_command_init () " type: CTCP type (examples: \"version\", " "\"ping\", ..)\n" "arguments: arguments for CTCP"), - "%(irc_channel)|%n action|ping|version", + "%(irc_channel)|%(nicks) action|ping|version", &irc_command_ctcp, NULL); weechat_hook_command ("cycle", N_("leave and rejoin a channel"), @@ -3796,25 +3798,26 @@ irc_command_init () N_(" action: 'send' (file) or 'chat'\n" "nickname: nickname to send file or chat\n" " file: filename (on local host)"), - "chat|send %n %f", + "chat %(nicks)" + " || send %(nicks) %(filename)", &irc_command_dcc, NULL); weechat_hook_command ("dehalfop", N_("remove half channel operator status from " "nickname(s)"), N_("[nickname [nickname]]"), "", - NULL, &irc_command_dehalfop, NULL); + "%(nicks)", &irc_command_dehalfop, NULL); weechat_hook_command ("deop", N_("remove channel operator status from " "nickname(s)"), N_("[nickname [nickname]]"), "", - NULL, &irc_command_deop, NULL); + "%(nicks)|%*", &irc_command_deop, NULL); weechat_hook_command ("devoice", N_("remove voice from nickname(s)"), N_("[nickname [nickname]]"), "", - NULL, &irc_command_devoice, NULL); + "%(nicks)|%*", &irc_command_devoice, NULL); weechat_hook_command ("die", N_("shutdown the server"), "", @@ -3825,13 +3828,15 @@ irc_command_init () N_("[-all | servername [servername ...]]"), N_(" -all: disconnect from all servers\n" "servername: server name to disconnect"), - "%(irc_servers)|-all", &irc_command_disconnect, NULL); + "-all" + " || %(irc_servers)|%*", + &irc_command_disconnect, NULL); weechat_hook_command ("halfop", N_("give half channel operator status to " "nickname(s)"), N_("[nickname [nickname]]"), "", - NULL, &irc_command_halfop, NULL); + "%(nicks)", &irc_command_halfop, NULL); weechat_hook_command ("ignore", N_("ignore nicks/hosts from servers or channels"), N_("[list] | [add [re:]nick/host [server [channel]]] | " @@ -3856,8 +3861,10 @@ irc_command_init () " /ignore add toto@domain.com freenode\n" " ignore host \"toto*@*.domain.com\" on freenode/#weechat:\n" " /ignore add toto*@*.domain.com freenode #weechat"), - "list|add|del %(irc_channel_nicks_hosts) " - "%(irc_servers) %(irc_channels) ", &irc_command_ignore, NULL); + "list" + " || add %(irc_channel_nicks_hosts) %(irc_servers) %(irc_channels) %-" + " || del -all|%(irc_ignores_numbers) %-", + &irc_command_ignore, NULL); weechat_hook_command ("info", N_("get information describing the server"), N_("[target]"), @@ -3868,12 +3875,12 @@ irc_command_init () N_("nickname channel"), N_("nickname: nick to invite\n" " channel: channel to invite"), - "%n %(irc_channel)", &irc_command_invite, NULL); + "%(nicks) %(irc_channel)", &irc_command_invite, NULL); weechat_hook_command ("ison", N_("check if a nickname is currently on IRC"), N_("nickname [nickname ...]"), N_("nickname: nickname"), - NULL, &irc_command_ison, NULL); + "%(nicks)|%*", &irc_command_ison, NULL); weechat_hook_command ("join", N_("join a channel"), N_("channel[,channel] [key[,key]]"), @@ -3886,7 +3893,7 @@ irc_command_init () N_(" channel: channel where user is\n" "nickname: nickname to kick\n" " comment: comment for kick"), - "%n %-", &irc_command_kick, NULL); + "%(nicks) %-", &irc_command_kick, NULL); weechat_hook_command ("kickban", N_("kicks and bans a nick from a channel"), N_("[channel] nickname [comment]"), @@ -3899,7 +3906,7 @@ irc_command_init () N_("nickname comment"), N_("nickname: nickname\n" " comment: comment for kill"), - "%n %-", &irc_command_kill, NULL); + "%(nicks) %-", &irc_command_kill, NULL); weechat_hook_command ("links", N_("list all servernames which are known by the " "server answering the query"), @@ -3969,31 +3976,35 @@ irc_command_init () "receiver: nick or channel (may be mask, '*' = " "current channel)\n" " text: text to send"), - NULL, &irc_command_msg, NULL); + "-server %(irc_servers)" + " || %(nicks) %-", + &irc_command_msg, NULL); weechat_hook_command ("names", N_("list nicknames on channels"), N_("[channel[,channel]]"), N_("channel: channel name"), - "%(irc_channels)|%*", &irc_command_names, NULL); + "%(irc_channels)", &irc_command_names, NULL); weechat_hook_command ("nick", N_("change current nickname"), N_("[-all] nickname"), N_(" -all: set new nickname for all connected " "servers\n" "nickname: new nickname"), - "-all", &irc_command_nick, NULL); + "-all %(irc_server_nick)" + " || %(irc_server_nick)", + &irc_command_nick, NULL); weechat_hook_command ("notice", N_("send notice message to user"), N_("[-server server] nickname text"), N_(" server: send to this server (internal name)\n" "nickname: user to send notice to\n" " text: text to send"), - "%n %-", &irc_command_notice, NULL); + "%(nicks) %-", &irc_command_notice, NULL); weechat_hook_command ("op", N_("give channel operator status to nickname(s)"), N_("nickname [nickname]"), "", - NULL, &irc_command_op, NULL); + "%(nicks)|%*", &irc_command_op, NULL); weechat_hook_command ("oper", N_("get operator privileges"), N_("user password"), @@ -4026,7 +4037,7 @@ irc_command_init () N_(" server: send to this server (internal name)\n" "nickname: nickname for private conversation\n" " text: text to send"), - "%n %-", &irc_command_query, NULL); + "%(nicks) %-", &irc_command_query, NULL); weechat_hook_command ("quote", N_("send raw data to server without parsing"), N_("[-server server] data"), @@ -4041,7 +4052,9 @@ irc_command_init () "servername: server name to reconnect\n" " -nojoin: do not join any channel (even if " "autojoin is enabled on server)"), - "%(irc_servers)|-all|-nojoin|%*", &irc_command_reconnect, NULL); + "-all -nojoin" + " || %(irc_servers)|-nojoin|%*", + &irc_command_reconnect, NULL); weechat_hook_command ("rehash", N_("tell the server to reload its config file"), "", @@ -4171,7 +4184,7 @@ irc_command_init () N_("return a list of information about nicknames"), N_("nickname [nickname ...]"), N_("nickname: nickname"), - "%n", &irc_command_userhost, NULL); + "%(nicks)", &irc_command_userhost, NULL); weechat_hook_command ("users", N_("list of users logged into the server"), N_("[target]"), @@ -4183,12 +4196,12 @@ irc_command_init () N_("[server | nickname]"), N_(" server: server name\n" "nickname: nickname"), - "%n", &irc_command_version, NULL); + "%(nicks)", &irc_command_version, NULL); weechat_hook_command ("voice", N_("give voice to nickname(s)"), N_("[nickname [nickname]]"), "", - NULL, &irc_command_voice, NULL); + "%(nicks)|%*", &irc_command_voice, NULL); weechat_hook_command ("wallops", N_("send a message to all currently connected users " "who have set the 'w' user mode for themselves"), diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c index 0de87a2ca..49e30beea 100644 --- a/src/plugins/irc/irc-completion.c +++ b/src/plugins/irc/irc-completion.c @@ -29,6 +29,7 @@ #include "irc-color.h" #include "irc-completion.h" #include "irc-config.h" +#include "irc-ignore.h" #include "irc-server.h" #include "irc-channel.h" #include "irc-nick.h" @@ -424,6 +425,35 @@ irc_completion_msg_part_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * irc_completion_ignores_numbers_cb: callback for completion with ignores + * numbers + */ + +int +irc_completion_ignores_numbers_cb (void *data, const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + struct t_irc_ignore *ptr_ignore; + char str_number[32]; + + /* make C compiler happy */ + (void) data; + (void) completion_item; + (void) buffer; + + for (ptr_ignore = irc_ignore_list; ptr_ignore; + ptr_ignore = ptr_ignore->next_ignore) + { + snprintf (str_number, sizeof (str_number), "%d", ptr_ignore->number); + weechat_hook_completion_list_add (completion, str_number, + 0, WEECHAT_LIST_POS_END); + } + + return WEECHAT_RC_OK; +} + /* * irc_completion_init: init completion for IRC plugin */ @@ -432,23 +462,36 @@ void irc_completion_init () { weechat_hook_completion ("irc_server", + N_("current IRC server"), &irc_completion_server_cb, NULL); weechat_hook_completion ("irc_server_nick", + N_("nick on current IRC server"), &irc_completion_server_nick_cb, NULL); weechat_hook_completion ("irc_server_nicks", + N_("nicks on all channels of current IRC server"), &irc_completion_server_nicks_cb, NULL); weechat_hook_completion ("irc_servers", + N_("IRC servers (internal names)"), &irc_completion_servers_cb, NULL); weechat_hook_completion ("irc_channel", + N_("current IRC channel"), &irc_completion_channel_cb, NULL); weechat_hook_completion ("nick", + N_("nicks of current IRC channel"), &irc_completion_channel_nicks_cb, NULL); weechat_hook_completion ("irc_channel_nicks_hosts", + N_("nicks and hostnames of current IRC channel"), &irc_completion_channel_nicks_hosts_cb, NULL); weechat_hook_completion ("irc_channel_topic", + N_("topic of current IRC channel"), &irc_completion_channel_topic_cb, NULL); weechat_hook_completion ("irc_channels", + N_("IRC channels (on all servers)"), &irc_completion_channels_cb, NULL); weechat_hook_completion ("irc_msg_part", + N_("default part message for IRC channel"), &irc_completion_msg_part_cb, NULL); + weechat_hook_completion ("irc_ignores_numbers", + N_("numbers for defined ignores"), + &irc_completion_ignores_numbers_cb, NULL); } diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h index 3e3c68eaa..cfaa5a23c 100644 --- a/src/plugins/irc/irc-protocol.h +++ b/src/plugins/irc/irc-protocol.h @@ -59,7 +59,7 @@ struct t_irc_server; -typedef int (t_irc_recv_func)(struct t_irc_server *server, const char *comand, +typedef int (t_irc_recv_func)(struct t_irc_server *server, const char *command, int argc, char **argv, char **argv_eol); struct t_irc_protocol_msg diff --git a/src/plugins/jabber/jabber-command.c b/src/plugins/jabber/jabber-command.c index 8937cb6bd..67bdb2cb2 100644 --- a/src/plugins/jabber/jabber-command.c +++ b/src/plugins/jabber/jabber-command.c @@ -819,7 +819,7 @@ jabber_command_init () N_("buddy [text]"), N_("buddy: buddy name for chat\n" " text: text to send"), - "%n %-", &jabber_command_jchat, NULL); + "%(nicks) %-", &jabber_command_jchat, NULL); weechat_hook_command ("jconnect", N_("connect to Jabber server(s)"), N_("[-all [-nojoin] | servername [servername ...] " diff --git a/src/plugins/jabber/jabber-completion.c b/src/plugins/jabber/jabber-completion.c index 5df9044e4..68e1a9ca7 100644 --- a/src/plugins/jabber/jabber-completion.c +++ b/src/plugins/jabber/jabber-completion.c @@ -435,24 +435,24 @@ jabber_completion_msg_part_cb (void *data, const char *completion_item, void jabber_completion_init () { - weechat_hook_completion ("jabber_server", + weechat_hook_completion ("jabber_server", "", &jabber_completion_server_cb, NULL); - weechat_hook_completion ("jabber_server_local_name", + weechat_hook_completion ("jabber_server_local_name", "", &jabber_completion_server_local_name_cb, NULL); - weechat_hook_completion ("jabber_server_buddies", + weechat_hook_completion ("jabber_server_buddies", "", &jabber_completion_server_buddies_cb, NULL); - weechat_hook_completion ("jabber_servers", + weechat_hook_completion ("jabber_servers", "", &jabber_completion_servers_cb, NULL); - weechat_hook_completion ("jabber_muc", + weechat_hook_completion ("jabber_muc", "", &jabber_completion_muc_cb, NULL); - weechat_hook_completion ("buddy", + weechat_hook_completion ("buddy", "", &jabber_completion_muc_buddies_cb, NULL); - weechat_hook_completion ("jabber_muc_buddies_hosts", + weechat_hook_completion ("jabber_muc_buddies_hosts", "", &jabber_completion_muc_buddies_hosts_cb, NULL); - weechat_hook_completion ("jabber_muc_topic", + weechat_hook_completion ("jabber_muc_topic", "", &jabber_completion_muc_topic_cb, NULL); - weechat_hook_completion ("jabber_mucs", + weechat_hook_completion ("jabber_mucs", "", &jabber_completion_mucs_cb, NULL); - weechat_hook_completion ("jabber_msg_part", + weechat_hook_completion ("jabber_msg_part", "", &jabber_completion_msg_part_cb, NULL); } diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c index 48360cc75..1e03cb35f 100644 --- a/src/plugins/logger/logger.c +++ b/src/plugins/logger/logger.c @@ -1003,7 +1003,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) " 3: server message\n" " 4: join/part/quit\n" " 9: all other messages"), - "list|set|disable", + "list" + " || set 1|2|3|4|5|6|7|8|9" + " || disable", &logger_command_cb, NULL); logger_start_buffer_all (); diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index e2d510acf..957d249b1 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -3930,7 +3930,7 @@ weechat_lua_api_hook_completion_cb (void *data, const char *completion_item, static int weechat_lua_api_hook_completion (lua_State *L) { - const char *completion, *function; + const char *completion, *description, *function; char *result; int n; @@ -3944,22 +3944,25 @@ weechat_lua_api_hook_completion (lua_State *L) } completion = NULL; + description = NULL; function = NULL; n = lua_gettop (lua_current_interpreter); - if (n < 2) + if (n < 3) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_completion"); LUA_RETURN_EMPTY; } - completion = lua_tostring (lua_current_interpreter, -2); + completion = lua_tostring (lua_current_interpreter, -3); + description = lua_tostring (lua_current_interpreter, -2); function = lua_tostring (lua_current_interpreter, -1); result = script_ptr2str (script_api_hook_completion (weechat_lua_plugin, lua_current_script, completion, + description, &weechat_lua_api_hook_completion_cb, function)); diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 6b9db3e23..38c035031 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -3317,7 +3317,7 @@ weechat_perl_api_hook_completion_cb (void *data, const char *completion_item, static XS (XS_weechat_api_hook_completion) { - char *result, *completion, *function; + char *result, *completion, *description, *function; dXSARGS; /* make C compiler happy */ @@ -3329,17 +3329,19 @@ static XS (XS_weechat_api_hook_completion) PERL_RETURN_EMPTY; } - if (items < 2) + if (items < 3) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_completion"); PERL_RETURN_EMPTY; } completion = SvPV (ST (0), PL_na); - function = SvPV (ST (1), PL_na); + description = SvPV (ST (1), PL_na); + function = SvPV (ST (2), PL_na); result = script_ptr2str (script_api_hook_completion (weechat_perl_plugin, perl_current_script, completion, + description, &weechat_perl_api_hook_completion_cb, function)); diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index d66291586..e9c43ae02 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -3527,7 +3527,7 @@ weechat_python_api_hook_completion_cb (void *data, const char *completion_item, static PyObject * weechat_python_api_hook_completion (PyObject *self, PyObject *args) { - char *completion, *function, *result; + char *completion, *description, *function, *result; PyObject *object; /* make C compiler happy */ @@ -3540,9 +3540,10 @@ weechat_python_api_hook_completion (PyObject *self, PyObject *args) } completion = NULL; + description = NULL; function = NULL; - if (!PyArg_ParseTuple (args, "ss", &completion, &function)) + if (!PyArg_ParseTuple (args, "sss", &completion, &description, &function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_completion"); PYTHON_RETURN_EMPTY; @@ -3551,6 +3552,7 @@ weechat_python_api_hook_completion (PyObject *self, PyObject *args) result = script_ptr2str(script_api_hook_completion (weechat_python_plugin, python_current_script, completion, + description, &weechat_python_api_hook_completion_cb, function)); diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 99e46bf46..d3ba648c7 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -4020,9 +4020,9 @@ weechat_ruby_api_hook_completion_cb (void *data, const char *completion_item, static VALUE weechat_ruby_api_hook_completion (VALUE class, VALUE completion, - VALUE function) + VALUE description, VALUE function) { - char *c_completion, *c_function, *result; + char *c_completion, *c_description, *c_function, *result; VALUE return_value; /* make C compiler happy */ @@ -4035,23 +4035,27 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion, } c_completion = NULL; + c_description = NULL; c_function = NULL; - if (NIL_P (completion) || NIL_P (function)) + if (NIL_P (completion) || NIL_P (description) || NIL_P (function)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_completion"); RUBY_RETURN_EMPTY; } Check_Type (completion, T_STRING); + Check_Type (description, T_STRING); Check_Type (function, T_STRING); c_completion = STR2CSTR (completion); + c_description = STR2CSTR (description); c_function = STR2CSTR (function); result = script_ptr2str (script_api_hook_completion (weechat_ruby_plugin, ruby_current_script, c_completion, + c_description, &weechat_ruby_api_hook_completion_cb, c_function)); @@ -6657,7 +6661,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) rb_define_module_function (ruby_mWeechat, "hook_signal", &weechat_ruby_api_hook_signal, 2); rb_define_module_function (ruby_mWeechat, "hook_signal_send", &weechat_ruby_api_hook_signal_send, 3); rb_define_module_function (ruby_mWeechat, "hook_config", &weechat_ruby_api_hook_config, 2); - rb_define_module_function (ruby_mWeechat, "hook_completion", &weechat_ruby_api_hook_completion, 2); + rb_define_module_function (ruby_mWeechat, "hook_completion", &weechat_ruby_api_hook_completion, 3); rb_define_module_function (ruby_mWeechat, "hook_completion_list_add", &weechat_ruby_api_hook_completion_list_add, 4); rb_define_module_function (ruby_mWeechat, "hook_modifier", &weechat_ruby_api_hook_modifier, 2); rb_define_module_function (ruby_mWeechat, "hook_modifier_exec", &weechat_ruby_api_hook_modifier_exec, 3); diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index 99266a04f..2aa4db899 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -26,6 +26,7 @@ #include "../weechat-plugin.h" #include "script.h" +#include "script-api.h" #include "script-callback.h" @@ -1076,6 +1077,7 @@ struct t_hook * script_api_hook_completion (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, const char *completion, + const char *description, int (*callback)(void *data, const char *completion_item, struct t_gui_buffer *buffer, @@ -1089,7 +1091,8 @@ script_api_hook_completion (struct t_weechat_plugin *weechat_plugin, if (!new_script_callback) return NULL; - new_hook = weechat_hook_completion (completion, callback, new_script_callback); + new_hook = weechat_hook_completion (completion, description, + callback, new_script_callback); if (!new_hook) { script_callback_free_data (new_script_callback); diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 6f6959a62..e769bc583 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -196,6 +196,7 @@ extern struct t_hook *script_api_hook_config (struct t_weechat_plugin *weechat_p extern struct t_hook *script_api_hook_completion (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, const char *completion, + const char *description, int (*callback)(void *data, const char *completion_item, struct t_gui_buffer *buffer, diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index e609afdca..eac4dd996 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -105,7 +105,7 @@ script_init (struct t_weechat_plugin *weechat_plugin, void *signal_data), void (*callback_load_file)(void *data, const char *filename)) { - char *string, *completion = "list|listfull|load|autoload|reload|unload %f"; + char *string, *completion = "list|listfull|load|autoload|reload|unload %(filename)"; char infolist_description[512], signal_name[128]; int length; @@ -162,7 +162,8 @@ script_init (struct t_weechat_plugin *weechat_plugin, if (string) { snprintf (string, length, "%s_script", weechat_plugin->name); - weechat_hook_completion (string, callback_completion, NULL); + weechat_hook_completion (string, N_("list of scripts"), + callback_completion, NULL); snprintf (infolist_description, sizeof (infolist_description), /* TRANSLATORS: %s is language (for example "perl") */ _("list of %s scripts"), weechat_plugin->name); diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index fc59def73..60d47398e 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -3765,7 +3765,7 @@ weechat_tcl_api_hook_completion (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *objp; - char *result, *completion, *function; + char *result, *completion, *description, *function; int i; /* make C compiler happy */ @@ -3777,17 +3777,19 @@ weechat_tcl_api_hook_completion (ClientData clientData, Tcl_Interp *interp, TCL_RETURN_EMPTY; } - if (objc < 3) + if (objc < 4) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_completion"); TCL_RETURN_EMPTY; } completion = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); + description = Tcl_GetStringFromObj (objv[2], &i); + function = Tcl_GetStringFromObj (objv[3], &i); result = script_ptr2str (script_api_hook_completion (weechat_tcl_plugin, tcl_current_script, completion, + description, &weechat_tcl_api_hook_completion_cb, function)); diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index fa246f757..c2a1129b4 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -429,6 +429,7 @@ struct t_weechat_plugin void *callback_data); struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin, const char *completion_item, + const char *description, int (*callback)(void *data, const char *completion_item, struct t_gui_buffer *buffer, @@ -972,9 +973,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); #define weechat_hook_config(__option, __callback, __data) \ weechat_plugin->hook_config(weechat_plugin, __option, __callback, \ __data) -#define weechat_hook_completion(__completion, __callback, __data) \ +#define weechat_hook_completion(__completion, __description, \ + __callback, __data) \ weechat_plugin->hook_completion(weechat_plugin, __completion, \ - __callback, __data) + __description, __callback, __data) #define weechat_hook_completion_list_add(__completion, __word, \ __nick_completion, __where) \ weechat_plugin->hook_completion_list_add(__completion, __word, \ diff --git a/src/plugins/xfer/xfer-completion.c b/src/plugins/xfer/xfer-completion.c index d0f36b3ca..639fe13dd 100644 --- a/src/plugins/xfer/xfer-completion.c +++ b/src/plugins/xfer/xfer-completion.c @@ -69,5 +69,6 @@ void xfer_completion_init () { weechat_hook_completion ("nick", + N_("nicks of DCC chat"), &xfer_completion_nick_cb, NULL); }