From 5616936940e4bd5a987edda4f029ffa6265aaf48 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Fri, 23 Jul 2010 01:19:03 +0100 Subject: additional docs about some Irssi:: core funcs --- docs/Guide.pod | 29 +++++++++++++++++- docs/Irssi.pod | 63 +++++++++++++++++++------------------- docs/Signals.pod | 18 +++++++++-- history-search/irssi/config | 4 ++- history-search/irssi/default.theme | 2 +- 5 files changed, 79 insertions(+), 37 deletions(-) diff --git a/docs/Guide.pod b/docs/Guide.pod index 8f27823..9d52ed1 100644 --- a/docs/Guide.pod +++ b/docs/Guide.pod @@ -176,7 +176,7 @@ that the package and function exist, and generate an error otherwise. Other error handling is possible, including executing a C to load the necessary script and retry, but is not shown here. -I on Freenode/#irssi.> +I on Freenode/#irssi>. =head2 If In Doubt, Dump! @@ -219,6 +219,9 @@ This example demonstrates overriding the C command, and if the argument matches our command, print some custom help and prevent the internal Irssi help function from being called. Otherwise, it falls back to the default help. + +I on Freenode/#irssi>. + =head3 Use Tab Completion One of the great features of Irssi is the ability to complete commands, @@ -226,6 +229,30 @@ subcommands and even certain arguments. Using the subcommands processing featur described below automatically allows those subcommands to be tab-completed, but for more complex tasks, you can hook into the autocompletion system itself. +In order to create your own completions, you must intercept the C<"complete +word"> signal and return a list of completion candidates. + + sub do_complete { + my ($strings, $window, $word, $linestart, $want_space) = @_; + + # only provide these completions if the input line is otherwise empty. + return unless ($linestart eq '' && $word eq ''); + + # add the completion candidates + push @$strings, qw/foo bar baz bacon/; + + # indicate that we want to include a space after the completion + $$want_space = 1; + + # prevent internal Irssi completion from responding + Irssi::signal_stop; + } + + Irssi::signal_add_first('complete word', \&do_complete); + +I|http://scripts.irssi.org/scripts/complete_lastspoke.pl> +by Daenyth> =head3 Use Settings for Customisation diff --git a/docs/Irssi.pod b/docs/Irssi.pod index 3187763..49e83fa 100644 --- a/docs/Irssi.pod +++ b/docs/Irssi.pod @@ -65,7 +65,7 @@ B =item L -=item L +=item L =item L @@ -90,7 +90,7 @@ For example: C -returns the currently active L +returns the currently active L =head3 C @@ -100,7 +100,7 @@ returns the currently active L in active window. =head3 C -returns a list of all L. +returns a list of all L. =head3 C @@ -130,11 +130,6 @@ returns a list of all L. returns a list of all L. -=head3 C - -B -returns a list of all L - =head2 Signals See also L @@ -428,6 +423,8 @@ used to build space-separated lists of entries. An integer type. Integers must be whole numbers, but may also be negative or zero. +It is stored internally as a C, and has a range of +/- 2^31. + =item C A boolean type. In Perl terms, values are C<0> for false, and anything else for @@ -435,16 +432,32 @@ true. When acting on them externally, C and C are the usual terms used =item C