From 65a6ee85146c34a8f3f71354ff35159f93810adc Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Wed, 5 Jan 2011 11:05:45 +1100 Subject: Added support for tab completion. I believe this patch will work with your original setup too :) --- auto-server/auto_server.pl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index 7054664..a9f6645 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -55,7 +55,7 @@ our %IRSSI = ( license => 'Public Domain', ); -my $channel_map; +my $channel_map = {}; my @hack_channels; my $pending_joins; @@ -104,6 +104,7 @@ sub haxy_print_hook { sub parse_channel_map { #my $data = Irssi::settings_get_str('joinplus_server_maps'); + unbind_completion(); my $data = retrieve_channels(); my @items = split /\s+/, $data; if (@items % 2 == 0) { @@ -113,6 +114,19 @@ sub parse_channel_map { $channel_map = {}; } _debug_print Dumper($channel_map); + bind_completion(); +} + +sub bind_completion { + foreach(%$channel_map) { + Irssi::command_bind("join+ $_", \&join_plus); + } +} + +sub unbind_completion { + foreach(%$channel_map) { + Irssi::command_unbind("join+ $_", \&join_plus); + } } sub join_plus { -- cgit v1.2.3 From be164408bab4128c4e67b6ac2e0f0183702c1790 Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Fri, 7 Jan 2011 14:13:41 +1100 Subject: - is a valid character in a channel name. --- auto-server/auto_server.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index a9f6645..447a131 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -135,7 +135,7 @@ sub join_plus { # parse out channel name from args: my $channel; - if ($args =~ m/^(#?[#a-zA-Z0-9]+)/) { + if ($args =~ m/^(#?[#a-zA-Z0-9-]+)/) { $channel = $1; _debug_print ("Channel is: $channel"); } -- cgit v1.2.3 From 8d4fe58ee09b7f5d00ee0c1a6e122a1bcff7ca4e Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sat, 8 Jan 2011 20:00:20 +0000 Subject: moved docs/ to https://github.com/shabble/irssi-docs --- docs/General/Formats.pod | 147 - docs/General/Guide.pod | 370 - docs/General/Internals.pod | 48 - docs/General/Signals.pod | 2464 ------ docs/Irssi.pod | 1109 --- docs/Irssi/Channel.pod | 86 - docs/Irssi/Chatnet.pod | 26 - docs/Irssi/Command.pod | 12 - docs/Irssi/Ignore.pod | 27 - docs/Irssi/Irc.pod | 51 - docs/Irssi/Irc/Ban.pod | 15 - docs/Irssi/Irc/Channel.pod | 16 - docs/Irssi/Irc/Client.pod | 21 - docs/Irssi/Irc/Dcc.pod | 79 - docs/Irssi/Irc/Notifylist.pod | 23 - docs/Irssi/Irc/Server.pod | 26 - docs/Irssi/Log.pod | 55 - docs/Irssi/Logitem.pod | 16 - docs/Irssi/Nick.pod | 25 - docs/Irssi/Query.pod | 30 - docs/Irssi/Rawlog.pod | 48 - docs/Irssi/Reconnect.pod | 20 - docs/Irssi/Script.pod | 10 - docs/Irssi/Server.pod | 149 - docs/Irssi/TextUI.pod | 12 - docs/Irssi/TextUI/Line.pod | 16 - docs/Irssi/TextUI/LineCache.pod | 3 - docs/Irssi/TextUI/LineInfo.pod | 3 - docs/Irssi/TextUI/MainWindow.pod | 3 - docs/Irssi/TextUI/StatusbarItem.pod | 29 - docs/Irssi/TextUI/TextBufferView.pod | 26 - docs/Irssi/TextUI/Textbuffer.pod | 3 - docs/Irssi/UI.pod | 13 - docs/Irssi/UI/Process.pod | 25 - docs/Irssi/UI/Server.pod | 13 - docs/Irssi/UI/TextDest.pod | 11 - docs/Irssi/UI/Theme.pod | 169 - docs/Irssi/UI/Window.pod | 167 - docs/Irssi/Windowitem.pod | 78 - docs/TODO | 63 - docs/allsigs-clean.txt | 379 - docs/allsigs-uniq.txt | 358 - docs/allsigs.txt | 737 -- docs/analyse-irssi.pl | 35 - docs/buildpod.pl | 102 - docs/buildsig2.pl | 140 - docs/buildsignals.pl | 239 - docs/cmpusers.pl | 301 - docs/complete-signal-list.txt | 379 - docs/msglevels.txt | 58 - docs/parse_formats.pl | 23 - docs/parse_xsfuncs.pl | 76 - docs/perl.txt | 437 -- docs/podstyle.css | 107 - docs/sigextract.pl | 24 - docs/siglist.txt | 12255 ----------------------------- docs/signals.txt | 257 - docs/sigtree.pl | 13918 --------------------------------- docs/xsfuncs.txt | 347 - docs/xsfuncs_args.txt | 320 - 60 files changed, 35999 deletions(-) delete mode 100644 docs/General/Formats.pod delete mode 100644 docs/General/Guide.pod delete mode 100644 docs/General/Internals.pod delete mode 100644 docs/General/Signals.pod delete mode 100644 docs/Irssi.pod delete mode 100644 docs/Irssi/Channel.pod delete mode 100644 docs/Irssi/Chatnet.pod delete mode 100644 docs/Irssi/Command.pod delete mode 100644 docs/Irssi/Ignore.pod delete mode 100644 docs/Irssi/Irc.pod delete mode 100644 docs/Irssi/Irc/Ban.pod delete mode 100644 docs/Irssi/Irc/Channel.pod delete mode 100644 docs/Irssi/Irc/Client.pod delete mode 100644 docs/Irssi/Irc/Dcc.pod delete mode 100644 docs/Irssi/Irc/Notifylist.pod delete mode 100644 docs/Irssi/Irc/Server.pod delete mode 100644 docs/Irssi/Log.pod delete mode 100644 docs/Irssi/Logitem.pod delete mode 100644 docs/Irssi/Nick.pod delete mode 100644 docs/Irssi/Query.pod delete mode 100644 docs/Irssi/Rawlog.pod delete mode 100644 docs/Irssi/Reconnect.pod delete mode 100644 docs/Irssi/Script.pod delete mode 100644 docs/Irssi/Server.pod delete mode 100644 docs/Irssi/TextUI.pod delete mode 100644 docs/Irssi/TextUI/Line.pod delete mode 100644 docs/Irssi/TextUI/LineCache.pod delete mode 100644 docs/Irssi/TextUI/LineInfo.pod delete mode 100644 docs/Irssi/TextUI/MainWindow.pod delete mode 100644 docs/Irssi/TextUI/StatusbarItem.pod delete mode 100644 docs/Irssi/TextUI/TextBufferView.pod delete mode 100644 docs/Irssi/TextUI/Textbuffer.pod delete mode 100644 docs/Irssi/UI.pod delete mode 100644 docs/Irssi/UI/Process.pod delete mode 100644 docs/Irssi/UI/Server.pod delete mode 100644 docs/Irssi/UI/TextDest.pod delete mode 100644 docs/Irssi/UI/Theme.pod delete mode 100644 docs/Irssi/UI/Window.pod delete mode 100644 docs/Irssi/Windowitem.pod delete mode 100644 docs/TODO delete mode 100644 docs/allsigs-clean.txt delete mode 100644 docs/allsigs-uniq.txt delete mode 100644 docs/allsigs.txt delete mode 100755 docs/analyse-irssi.pl delete mode 100755 docs/buildpod.pl delete mode 100755 docs/buildsig2.pl delete mode 100755 docs/buildsignals.pl delete mode 100644 docs/cmpusers.pl delete mode 100644 docs/complete-signal-list.txt delete mode 100644 docs/msglevels.txt delete mode 100755 docs/parse_formats.pl delete mode 100755 docs/parse_xsfuncs.pl delete mode 100644 docs/perl.txt delete mode 100644 docs/podstyle.css delete mode 100755 docs/sigextract.pl delete mode 100644 docs/siglist.txt delete mode 100644 docs/signals.txt delete mode 100644 docs/sigtree.pl delete mode 100644 docs/xsfuncs.txt delete mode 100644 docs/xsfuncs_args.txt diff --git a/docs/General/Formats.pod b/docs/General/Formats.pod deleted file mode 100644 index 0aaca37..0000000 --- a/docs/General/Formats.pod +++ /dev/null @@ -1,147 +0,0 @@ -__END__ - -=head1 NAME - -Formats - -=head1 DESCRIPTION - -I - -=head1 COLOURS - -Irssi's colors that you can use in text formats, hilights, etc: - - C1 C2 C3 Text Colour (C1) Text Colour (C2) Background (C3) - -------------------------------------------------------------------------- - %k %K %0 black dark grey black - %r %R %1 red bold red red - %g %G %2 green bold green green - %y %Y %3 yellow bold yellow yellow - %b %B %4 blue bold blue blue - %m %M %5 magenta bold magenta magenta - %p %P magenta (think: purple) - %c %C %6 cyan bold cyan cyan - %w %W %7 white bold white white - - %n %N Changes the color to "default color", removing - all other coloring and formatting. %N is always - the terminal's default color. %n is usually too, - except in themes it changes to "previous color", - ie. hello = "%Rhello%n" and "%G{hello} world" - would print hello in red, and %n would turn back - into %G making world green. - - %F Blinking on/off (think: flash) - %U Underline on/off - %8 Reverse on/off - %9 %_ Bold on/off - %: Insert newline - %| Marks the indentation position - %# Monospace font on/off (useful with lists and GUI) - %% A single % - - -=head1 VARIABLE SYNTAX - -Irssi supports a number of reserved, dynamic variables, sometimes -referred to as I. They are special in that the client is -constantly updating their values automatically. There are also -numerous variable modifiers available. - - Modifier Description - ------------------------------------------------------------------------ - $variable A normal variable, expanding to the first match of: - | 1) an internal SET variable - | 2) an environment variable - $[num]variable Expands to the variables value, with 'num' width. If - | the number is negative, the value is right-aligned. - | The value is padded to meet the width with the - | character given after number (default is space). - | The value is truncated to specified width unless - | '!' character precedes the number. If '.' character - | precedes the number the value isn't padded, just - | truncated. - $#variable Expands to the number of words in $variable. If $variable - | is omitted, it assumes $* - $@variable Expands to the number of characters in $variable. if - | $variable is omitted, it assumes $* - $($subvariable) This is somewhat similar to a pointer, in that the - | value of $subvar is taken as the name of the - | variable to expand to. Nesting is allowed. - ${expression} Permits the value to be embedded in another string - | unambiguously. - $!history! Expands to a matching entry in the client's command - | history, wildcards allowed. - -B - -=head1 ALIAS AND FORMAT TEMPLATE ARGUMENTS - -Whenever an alias is called, these expandos are set to the arguments passed -to it. If none of these expandos are used in the alias, or the C<$()> form -shown above, any arguments passed will automatically be appended to the last -command in the alias. - - Expando Description - ------------------------------------------------------------------------ - $* expands to all arguments passed to an alias - $n expands to argument 'n' passed to an alias (counting from zero) - $n-m expands to arguments 'n' through 'm' passed to an alias - $n- expands to all arguments from 'n' on passed to an alias - $-m expands to all arguments up to 'm' passed to an alias - $~ expands to the last argument passed to an alias - -=head1 EXPANDOS (SPECIAL VARIABLES) - -These variables are set and updated dynamically by the client. The case of -C<$A .. $Z> is important. - - Variable Description - ------------------------------------------------------------------------ - $, last person who sent you a MSG - $. last person to whom you sent a MSG - $: last person to join a channel you are on - $; last person to send a public message to a channel you are on - $A text of your AWAY message, if any - $B body of last MSG you sent - $C current channel - $D last person that NOTIFY detected a signon for - $E idle time - $F time client was started, $time() format - $H current server numeric being processed - $I channel you were last INVITEd to - $J client version text string - $K current value of CMDCHARS - $k first character in CMDCHARS - $L current contents of the input line - $M modes of current channel, if any - $N current nickname - $O value of STATUS_OPER if you are an irc operator - $P if you are a channel operator in $C, expands to a '@' - $Q nickname of whomever you are QUERYing - $R version of current server - $S current server name - $T target of current input (channel or nick of query) - $U value of cutbuffer - $V client release date (format YYYYMMDD) - $W current working directory - $X your /userhost $N address (user@host) - $Y value of REALNAME - $Z time of day (hh:mm, can be changed with /SET timestamp_format) - $$ a literal '$' - - $versiontime prints time of the irssi version in HHMM format - $sysname system name (eg. Linux) - $sysrelease system release (eg. 2.2.18) - $sysarch system architecture (eg. i686) - $topic channel topic - $usermode user mode - $cumode own channel user mode - $cumode_space like $cumode, but gives space if there's no mode. - $tag server tag - $chatnet chat network of server - $winref window reference number - $winname window name - $itemname like $T, but use item's visible_name which may be - different (eg. $T = !12345chan, $itemname = !chan) diff --git a/docs/General/Guide.pod b/docs/General/Guide.pod deleted file mode 100644 index a3cfe38..0000000 --- a/docs/General/Guide.pod +++ /dev/null @@ -1,370 +0,0 @@ -__END__ - -=head1 NAME - -Guide To Irssi Scripting. - -=head1 DESCRIPTION - -This page presents a bunch of additional information about scripting for Irssi -that doesn't fit well anywhere else. It contains useful tips, common pitfalls, -and a bunch of other handy things. At least, I hope so. - -=head1 LOADING AND UNLOADING SCRIPTS - -=head2 File Locations - -Packaged Irssi script files are usually placed in F, -but custom scripts or those required by a single user can be placed in -F<~/.irssi/scripts/>. - -=head3 Autorunning Scripts - -If you require a script be run when Irssi starts, you can place the file (or -better, create a symlink to it) into F<~/.irssi/scripts/autorun/>. - -Alternatively, if you want more control over the order in which scripts are -autoloaded, you can place - - SCRIPT LOAD script1 - SCRIPT LOAD script2 - SCRIPT LOAD script3 - -into your F<~/.irssi/startup> file. - -I on Freenode/#irssi>. - -=head2 Testing - -=for comment B - -=head3 C - -The C>. A default Irssi -configuration also provides the C alias as an alternative to C. - -Loaded scripts will exist in the Irssi namespace as: -CnameE>>, where I is the filename stripped of its -F<.pl> extension. - -=head2 Unloading - -A script can be unloaded via the C> command. The name is -typically the script filename without the F<.pl> extension, so F -becomes C. - -As part of the unloading process, if the script contains a - - sub UNLOAD { - ... - } - -function, it will be run just before the script is unloaded and all variables -destroyed. This can be used to clean up any temporary files, shut down any -network connections or processes, and restore any Irssi modifications made. - -=head1 ANATOMY OF A SCRIPT - -In this section, we develop a very simplistic script and look at the -necessary code. - -B This section has considerable overlap with L, which you may also -wish to read. - -B - -=head2 Preamble - -All scripts should contain a header as follows: - - use strict; - use warnings; - - use vars qw($VERSION %IRSSI); - use Irssi; - - $VERSION = '1.00'; - %IRSSI = ( - authors => 'Author Name(s)', - contact => 'author_email@example.com', - name => 'Script Title', - description => 'Longer script description ', - license => 'Public Domain', - ); - -The first two lines are optional, but strongly advised. They provide far greater -error checking and diagnostics should you make a mistake in your code. - -The C defines two global variables, which are then -set below to the appropriate values. - -C tells the script to make the various L support functions available. -Additional parameters passed here with C can be used to import functions into -the current script namespace. - - -=head1 COMMONLY SCRIPTED TASKS - -=head2 Modifying an input line before sending - -B - -=head2 Responding to a public message - -B - -=head2 Responding to a private message - -B - -=head1 USEFUL THINGS - - -=head2 Dealing with Blocking IO - -B on SIO> - fork and use pipes to communicate. Also -remember to pidwait the child> - - -=head2 Getting the Response Value of a Remote Command - -B - -=head2 Getting the Response Value of a Local Command - -B - -There is no simple way to achieve this. The data backing most common activities -can be extracted through other API calls, but there are some exceptions. - -Maybe, look up the format, intercept gui print text, try to match it against -what you're expecting? - -Can this be generalised at all? - -=head2 Sharing Code Between Scripts - -There are 2 main ways for scripts to communicate, either via emitting and -handling Irssi signals, or by calling functions from one another directly. - -=head3 Using Signals - -In order to use custom signals, they must first be registered with Irssi. -During registration, a list of the parameters must also be specified. Once specified, -it cannot be changed without restarting Irssi, so be warned. - -After registration, your script can simply listen for signals with -L, or generate them for -others to handle with L - -For example: - -B - -=head3 Using Functions - -Because scripts exist in a well-defined namespace of C, -it is possible to manipulate the perl symbol table to call functions directly on them, -assuming they are loaded. - -Because the following code depends on I, it is necessary to -tell Perl to allow them, despite normally being prohibited by C. -The C line takes care of this, and reenables them at the end -of the snippet. - - no strict 'refs'; - if (defined %{ 'Irssi::Script::SOMEPACKAGE::' }) { - if (defined &{'Irssi::Script::SOMEPACKAGE::SOME_FUNC'} ) { - (&{'Irssi::Script::SOMEPAKAGE::SOME_FUNC'}(@args)); - } else { - print("Err: can't find Irssi::Script::SOMEPACKAGE::SOME_FUNC"); - } - } - use strict 'refs'; - -Here, C is the name of the script package which contains the -function you want to call, and C is the name of the function within -it you wish to call. The first 2 C lines take care of ensuring -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>. - -=head2 If In Doubt, Dump! - -C is an extremely good way to inspect Irssi internals if you're -looking for an undocumented feature. - -The C alias by L provides an easy way to -check object fields. - -Dump perl object (e.g. C): - - /alias DUMP script exec use Data::Dumper\; print Data::Dumper->new([\\$0-])->Dump - -=head2 Making Scripts Act Native - -An important part of creating a good script is to make it behave as though it -were a part of Irssi. Adhering to some of the standard conventions can make this -easier. - -=head3 Provide Help - -Scripts commonly store information about how to use them in comments at the top -of their file. Whilst better than no documentation at all, a preferable approach -is to allow that help to be accessed from within Irssi itself, using the C -command. - - my $help = "this is help for b"; - - Irssi::command_bind('help', sub { - if ($_[0] eq 'test_b') { - Irssi::print($help, MSGLEVEL_CLIENTCRAP); - Irssi::signal_stop; - } - } - ); - -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, -subcommands and even certain arguments. Using the subcommands processing feature -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 - -Many scripts require the setting of various parameters to affect how they behave. -One approach is to require the user to directly edit the script file, but this -is less than ideal for a number of reasons. Firstly, it is easy to introduce -errors into a script by accidentally deleting closing quotes or semicolons. -Secondly, it has no effect until the script is reloaded, leading to confusion. - -A much better alternative is to use Irssi's inbuilt settings mechanism to allow -users to set these parameters from within Irssi, as well as to C their -settings for subsequent invocations. - -B - -B - -B - -=head3 Use Subcommands to Group Script Functionality - -A common theme in Irssi scripts is to define commands with a prefix, such as -C, C, etc. This helps to avoid accidentally clobbering -native commands and those defined by other scripts, but is a problem better solved -with I. - -Subcommands allow you to bind commands such as C and C. -Completions are automatically handled for both the primary command, and any -subcommands contained within it. - -The following example demonstrates how to use subcommands from within a script: - - Irssi::command_bind("foo bar", \&subcmd_bar); - Irssi::command_bind("foo", \&subcmd_handler); - - sub subcmd_handler { - my ($data, $server, $item) = @_; - $data =~ s/\s+$//g; # strip trailing whitespace. - Irssi::command_runsub('foo', $data, $server, $item); - } - - sub subcmd_bar { - my ($args) = @_; - print "subcommand called with: $args"; - } - -=head1 AUTHOR & THANKS - -This page was written by Tom Feist C, but draws -on the help of many many people. - -The denizens of Freenode/#irssi have been particularly helpful, especially -C and C. - -To report bugs or suggestions, email me at the address before, or come talk to -me in C<#irssi> on C. - -=head1 OTHER RESOURCES - -The documentation assembled here and elsewhere on this site has been drawn from -many different places, and a lot of valuable information is available from the -following sites. - - -=over - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=back diff --git a/docs/General/Internals.pod b/docs/General/Internals.pod deleted file mode 100644 index c364dd5..0000000 --- a/docs/General/Internals.pod +++ /dev/null @@ -1,48 +0,0 @@ -__END__ - -=head1 Random Notes on Irssi Internals. - - -=head2 Display Output - -Irssi has to deal with a whole bunch of things between a script print() and actually -putting it on the screen. - -Some of these things are: - -=over 4 - -=item Message Levels - -=item Abstract Replacements - -=item Theme formats - -=item Module (C) formats - -=back - -==head3 Message Levels - -Message levels are defined in F and some -support functions in F - -We have: - -=over 4 - -=item C - -Special cases: C both return MSGLEVEL_ALL, and C returns 0. -The remainder are looked up in a big static string array by name to -find the appropriate numeric level. Partial matches are permitted as -long as they are unambigious. - - -=item C - -=item C - -=item C - - diff --git a/docs/General/Signals.pod b/docs/General/Signals.pod deleted file mode 100644 index 2c83262..0000000 --- a/docs/General/Signals.pod +++ /dev/null @@ -1,2464 +0,0 @@ -__END__ - -=head1 NAME - -Irssi Signal Documentation - -=head1 DESCRIPTION - -Perl POD documentation based on the doc/signals.txt documentation supplied with -Irssi. - -=head1 USING SIGNALS - -See L - -=begin irssi_signal_types - -START OF SIGNAL TYPES - -=over - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - - - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - - -=item C C - -=item C C - -=item C C - - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - -=item C C - - - -=item C C - -=back - -END OF SIGNAL TYPES - -=end irssi_signal_types - -=head1 SIGNAL DEFINITIONS - -The following signals are categorised as in the original documentation, but -have been revised to note Perl variable types and class names. - -Arguments are passed to signal handlers in the usual way, via C<@_>. - -=for irssi_signal_defs START OF SIGNAL DEFINITIONS - -=head2 Core - -=over 4 - -=item C<"gui exit"> - -=over - -=item I - -=back - -=item C<"gui dialog"> - -=over - -=item string C<$type> - -=item string C<$text> - -=back - -=item C<"send command"> - -=over - -=item string C<$command>, - -=item L C<$server>, - -=item L C<$window_item> - -=back - -This is sent when a command is entered via the GUI, or by scripts via L. - -=back - -=head3 F: - -B - -=over 4 - -=item C<"chat protocol created"> - -=over - -=item CHAT_PROTOCOL_REC C<$protocol> - -=back - -=item C<"chat protocol updated"> - -=over - -=item CHAT_PROTOCOL_REC C<$protocol> - -=back - -=item C<"chat protocol destroyed"> - -=over - -=item CHAT_PROTOCOL_REC C<$protocol> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"channel created"> - -=over - -=item L C<$channel> - -=item int C<$automatic> - -=back - -=item C<"channel destroyed"> - -=over - -=item L C<$channel> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"chatnet created"> - -=over - -=item CHATNET_REC C<$chatnet> - -=back - -=item C<"chatnet destroyed"> - -=over - -=item CHATNET_REC C<$chatnet> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"commandlist new"> - -=over - -=item L C<$cmd> - -=back - -=item C<"commandlist remove"> - -=over - -=item L C<$cmd> - -=back - -=item C<"error command"> - -=over - -=item int C<$err> - -=item string C<$cmd> - -=back - -=item C<"send command"> - -=over - -=item string C<$args> - -=item L C<$server> - -=item L C<$witem> - -=back - -=item C<"send text"> - -=over - -=item string C<$line> - -=item L C<$server> - -=item L C<$witem> - -=back - -=item C<"command "> - -=over - -=item string C<$args> - -=item L C<$server> - -=item L C<$witem> - -=back - -B - -=item C<"default command"> - -=over - -=item string C<$args> - -=item L C<$server> - -=item L C<$witem> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"ignore created"> - -=over - -=item L C<$ignore> - -=back - -=item C<"ignore destroyed"> - -=over - -=item L C<$ignore> - -=back - -=item C<"ignore changed"> - -=over - -=item L C<$ignore> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"log new"> - -=over - -=item L C<$log> - -=back - -=item C<"log remove"> - -=over - -=item L C<$log> - -=back - -=item C<"log create failed"> - -=over - -=item L C<$log> - -=back - -=item C<"log locked"> - -=over - -=item L C<$log> - -=back - -=item C<"log started"> - -=over - -=item L C<$log> - -=back - -=item C<"log stopped"> - -=over - -=item L C<$log> - -=back - -=item C<"log rotated"> - -=over - -=item L C<$log> - -=back - -=item C<"log written"> - -=over - -=item L C<$log> - -=item string C<$line> - -=back - -=back - -=head3 F: - -B - -=over 4 - -=item C<"module loaded"> - -=over - -=item MODULE_REC C<$module> - -=item MODULE_FILE_REC C<$module_file> - -=back - -=item C<"module unloaded"> - -=over - -=item MODULE_REC C<$module> - -=item MODULE_FILE_REC C<$module_file> - -=back - -=item C<"module error"> - -=over - -=item int C<$error> - -=item string C<$text> - -=item string C<$root_module> - -=item string C<$sub_module> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"nicklist new"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=back - -=item C<"nicklist remove"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=back - -=item C<"nicklist changed"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=item string C<$old_nick> - -=back - -=item C<"nicklist host changed"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=back - -=item C<"nicklist gone changed"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=back - -=item C<"nicklist serverop changed"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"pidwait"> - -=over - -=item int C<$pid> - -=item int C<$status> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"query created"> - -=over - -=item L C<$query> - -=item int C<$automatic> - -=back - -=item C<"query destroyed"> - -=over - -=item L C<$query> - -=back - -=item C<"query nick changed"> - -=over - -=item L C<$query> - -=item string C<$original_nick> - -=back - -=item C<"window item name changed"> - -=over - -=item L C<$witem> - -=back - -=item C<"query address changed"> - -=over - -=item L C<$query> - -=back - -=item C<"query server changed"> - -=over - -=item L C<$query> - -=item L C<$server> - -=back - -=back - - -=head3 F: - -=over 4 - -=item C<"rawlog"> - -=over - -=item L C<$raw_log> - -=item string C<$data> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"server looking"> - -=over - -=item L C<$server> - -=back - -=item C<"server connected"> - -=over - -=item L C<$server> - -=back - - -=item C<"server connecting"> - -=over - -=item L C<$server> - -=item ulongptr C<$ip> - -=back - -=item C<"server connect failed"> - -=over - -=item L C<$server> - -=back - -=item C<"server disconnected"> - -=over - -=item L C<$server> - -=back - -=item C<"server quit"> - -=over - -=item L C<$server> - -=item string C<$message> - -=back - -=item C<"server sendmsg"> - -=over - -=item L C<$server> - -=item string C<$target> - -=item string C<$message> - -=item int C<$target_type> - -=back - -=back - -=head3 F: - -=over 4 - -=item C<"setup changed"> - -=over - -=item I - -=back - -=item C<"setup reread"> - -=over - -=item string C<$fname> - -=back - -=item C<"setup saved"> - -=over - -=item string C<$fname> - -=item int C<$autosaved> - -=back - -=back - -=head2 IRC Core - -=head3 F: - -=over 4 - -=item C<"ban type changed"> - -=over - -=item string C<$bantype> - -=back - -=back - -=head3 F, F: - -B - -=over 4 - -=item C<"channel joined"> - -=over - -=item L C<$channel> - -=back - -=item C<"channel wholist"> - -=over - -=item L C<$channel> - -=back - -=item C<"channel sync"> - -=over - -=item L C<$channel> - -=back - -=item C<"channel topic changed"> - -=over - -=item L C<$channel> - -=back - -=back - -=head3 F: - -=over - -=item C<"ctcp msg"> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"ctcp msg "> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"default ctcp msg"> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"ctcp reply"> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"ctcp reply "> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"default ctcp reply"> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=item C<"ctcp action"> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$nick> - -=item string C<$addr> - -=item string C<$target> - -=back - -=back - -=head3 F: - -=over - -=item C<"awaylog show"> - -=over - -=item L C<$log> - -=item int C<$away_msgs> - -=item int C<$filepos> - -=back - -=back - -=head3 F: - -=over - -=item C<"server nick changed"> - -=over - -=item L C<$server> - -=back - -=back - -=head3 F: - -=over - -=item C<"event connected"> - -=over - -=item L C<$server> - -=back - -=back - -=head3 F: - -=over - -=item C<"server event"> - -=over - -=item L C<$server> - -=item string C<$data> - -=item string C<$sender_nick> - -=item string C<$sender_addr> - -=back - -=item C<"event "> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$sender_nick> - -=item string C<$sender_addr> - -=back - -=item C<"default event"> - -=over - -=item L C<$server> - -=item string C<$data> - -=item string C<$sender_nick> - -=item string C<$sender_addr> - -=back - -=item C<"whois default event"> - -=over - -=item L C<$server> - -=item string C<$data> - -=item string C<$sender_nick> - -=item string C<$sender_addr> - -=back - -=item C<"server incoming"> - -=over - -=item L C<$server> - -=item string C<$data> - -=back - -=item C<"redir "> - -=over - -=item L C<$server> - -=item string C<$args> - -=item string C<$sender_nick> - -=item string C<$sender_addr> - -=back - -=back - -=head3 F: - -=over - -=item C<"server lag"> - -=over - -=item L C<$server> - -=back - -=item C<"server lag disconnect"> - -=over - -=item L C<$server> - -=back - -=back - -=head3 F: - -=over - -=item C<"massjoin"> - -=over - -=item L C<$channel> - -=item List of L C<@nicks> - -B - -=back - -=back - -=head3 F: - -=over - -=item C<"ban new"> - -=over - -=item L C<$channel> - -=item L C<$ban> - -=back - -=item C<"ban remove"> - -=over - -=item L C<$channel> - -=item L C<$ban> - -=item string C<$set_by> - -=back - -=back - -=head3 F: - -=over - -=item C<"channel mode changed"> - -=over - -=item L C<$channel> - -=item string C<$set_by> - -=back - -=item C<"nick mode changed"> - -=over - -=item L C<$channel> - -=item L C<$nick> - -=item string C<$set_by> - -=item string C<$mode> - -=item string C<$type> - -=back - -=item C<"user mode changed"> - -=over - -=item L C<$server> - -=item string C<$old_mode> - -=back - -=item C<"away mode changed"> - -=over - -=item L C<$server> - -=back - -=back - -=head3 F: - -=over - -=item C<"netsplit server new"> - -=over - -=item L C<$server> - -=item L C<$netsplit_server> - -=back - -=item C<"netsplit server remove"> - -=over - -=item L C<$server> - -=item L C<$netsplit_server> - -=back - -=item C<"netsplit new"> - -=over - -=item L C<$netsplit> - -=back - -=item C<"netsplit remove"> - -=over - -=item L C<$netsplit> - -=back - -=back - -=head2 IRC Modules - - -=head3 F: - -=over - -=item C<"dcc ctcp "> - -=over - -=item string C<$args> - -=item L C<$dcc> - -=back - -=item C<"default dcc ctcp"> - -=over - -=item string C<$args> - -=item L C<$dcc> - -=back - -=item C<"dcc unknown ctcp"> - -=over - -=item string C<$args> - -=item string C<$sender> - -=item string C<$send_addr> - -=back - -=item C<"dcc reply "> - -=over - -=item string C<$args> - -=item L C<$dcc> - -=back - -=item C<"default dcc reply"> - -=over - -=item string C<$args> - -=item L C<$dcc> - -=back - -=item C<"dcc unknown reply"> - -=over - -=item string C<$args> - -=item string C<$sender> - -=item string C<$send_addr> - -=back - -=item C<"dcc chat message"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"dcc created"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc destroyed"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc connected"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc rejecting"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc closed"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc request"> - -=over - -=item L C<$dcc> - -=item string C<$send_addr> - -=back - -=item C<"dcc request send"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc chat message"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"dcc transfer update"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc get receive"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc error connect"> - -=over - -=item L C<$dcc> - -=back - -=item C<"dcc error file create"> - -=over - -=item L C<$dcc> - -=item string C<$filename> - -=back - -=item C<"dcc error file open"> - -=over - -=item string C<$nick> - -=item string C<$filename> - -=item int C<$errno> - -=back - -=item C<"dcc error get not found"> - -=over - -=item string C<$nick> - -=back - -=item C<"dcc error send exists"> - -=over - -=item string C<$nick> - -=item string C<$filename> - -=back - -=item C<"dcc error unknown type"> - -=over - -=item string C<$type> - -=back - -=item C<"dcc error close not found"> - -=over - -=item string C<$type> - -=item string C<$nick> - -=item string C<$filename> - -=back - -=back - -=head3 F: - -=over - -=item C<"autoignore new"> - -=over - -=item L C<$server> - -=item L C<$autoignore> - -=back - -=item C<"autoignore remove"> - -=over - -=item L C<$server> - -=item L C<$autoignore> - -=back - -=back - -=head3 F: - -=over - -=item C<"flood"> - -=over - -=item L C<$server> - -=item string C<$nick> - -=item string C<$host> - -=item int C<$level> - -=item string C<$target> - -=back - -=back - -=head3 F: - -=over - -=item C<"notifylist new"> - -=over - -=item L C<$notify_list> - -=back - -=item C<"notifylist remove"> - -=over - -=item L C<$notify_list> - -=back - -=item C<"notifylist joined"> - -=over - -=item L C<$server> - -=item string C<$nick> - -=item string C<$user> - -=item string C<$host> - -=item string C<$real_name> - -=item string C<$away_message> - -=back - -=item C<"notifylist away changed"> - -=over - -=item L C<$server> - -=item string C<$nick> - -=item string C<$user> - -=item string C<$host> - -=item string C<$real_name> - -=item string C<$away_message> - -=back - -=item C<"notifylist left"> - -=over - -=item L C<$server> - -=item string C<$nick> - -=item string C<$user> - -=item string C<$host> - -=item string C<$real_name> - -=item string C<$away_message> - -=back - -=back - -=head3 F: - -=over - -=item C<"proxy client connected"> - -=over - -=item L C<$client> - -=back - -=item C<"proxy client disconnected"> - -=over - -=item L C<$client> - -=back - -=item C<"proxy client command"> - -=over - -=item L C<$client> - -=item string C<$args> - -=item string C<$data> - -=back - -=item C<"proxy client dump"> - -=over - -=item L C<$client> - -=item string C<$data> - -=back - -=back - -=head2 Display (FE) Common - -B - -=over - -=item C<"gui print text"> - -=over - -=item L C<$window> - -=item int C<$fg> - -=item int C<$bg> - -=item int C<$flags> - -=item string C<$text> - -=item L C<$text_dest> - -=back - -This signal is called multiple times for a given print operation, in a fashion -similar to run-length coding. A single line of printed output which varies in -colour may emit this signal multiple times, once for each colour change. The -C<$fg>, C<$bg>, and C<$flags> contain the formatting information for C<$text>. - - -=item C<"gui print text finished"> - -=over - -=item L C<$window> - -=back - -(Can be used to determine when all C<"gui print text">s are sent (not required)) - -=back - - -B - -=head3 F: - -=over - -=item C<"complete word"> - -=over - -=item arrayref of strings C<$strings_ref> - -An arrayref which can be modified to add additional completion candidates. - -For example: - - push @$strings_ref, "another_candidate"; - -=item L C<$window> - -=item string C<$word> - -The prefix of the word currently being typed. - -=item string C<$linestart> - -The contents of the input line up to (but not including) the current -word prefix C<$word>. - -=item int C<$want_space> - -A scalar reference which can be set to indicate if tab completion of these -candidates should be appended with a space. - -=back - -=back - -=head3 F: - -=over - -=item C<"irssi init read settings"> - -=over - -=item I - -=back - -=back - -=head3 F: - -=over - -=item C<"exec new"> - -=over - -=item L C<$process> - -=back - -=item C<"exec remove"> - -=over - -=item L C<$process> - -=item int C<$status> - -=back - -=item C<"exec input"> - -=over - -=item L C<$process> - -=item string C<$text> - -=back - -=back - -=head3 F: - -=over - -=item C<"message public"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$target> - -=back - -=item C<"message private"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$nick> - -=item string C<$address> - -=back - -=item C<"message own_public"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$target> - -=back - -=item C<"message own_private"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$target> - -=item string C<$original_target> - -=back - -=item C<"message join"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$nick> - -=item string C<$address> - -=back - -=item C<"message part"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$reason> - -=back - -=item C<"message quit"> - -=over - -=item L C<$server> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$reason> - -=back - -=item C<"message kick"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$nick> - -=item string C<$kicker> - -=item string C<$address> - -=item string C<$reason> - -=back - -=item C<"message nick"> - -=over - -=item L C<$server> - -=item string C<$new_nick> - -=item string C<$old_nick> - -=item string C<$address> - -=back - -=item C<"message own_nick"> - -=over - -=item L C<$server> - -=item string C<$new_nick> - -=item string C<$old_nick> - -=item string C<$address> - -=back - -=item C<"message invite"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$nick> - -=item string C<$address> - -=back - -=item C<"message topic"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$topic> - -=item string C<$nick> - -=item string C<$address> - -=back - -=back - -=head3 F: - -=over - -=item C<"keyinfo created"> - -=over - -=item L C<$key_info> - -=back - -=item C<"keyinfo destroyed"> - -=over - -=item L C<$key_info> - -=back - -=back - -=head3 F: - -=over - -=item C<"print text"> - -=over - -=item L C<$text_dest> - -=item string C<$text> - -=item string C<$stripped_text> - -=back - -=back - -=head3 F: - -=over - -=item C<"theme created"> - -=over - -=item L C<$theme> - -=back - -=item C<"theme destroyed"> - -=over - -=item L C<$theme> - -=back - -=back - -=head3 F: - -=over - -=item C<"window hilight"> - -=over - -=item L C<$window> - -=back - -=item C<"window dehilight"> - -=over - -=item L C<$window> - -=back - -=item C<"window activity"> - -=over - -=item L C<$window> - -=item int C<$old_level> - -=back - -=item C<"window item hilight"> - -=over - -=item L C<$window_item> - -=back - -=item C<"window item activity"> - -=over - -=item L C<$window_item> - -=item int C<$old_level> - -=back - -=back - -=head3 F: - -=over - -=item C<"window item new"> - -=over - -=item L C<$window> - -=item L C<$window_item> - -=back - -=item C<"window item remove"> - -=over - -=item L C<$window> - -=item L C<$window_item> - -=back - -=item C<"window item moved"> - -B - -=over - -=item L C<$window_from> - -=item L C<$window_item> - -=item L C<$window_to> - -=back - -=item C<"window item changed"> - -=over - -=item L C<$window> - -=item L C<$window_item> - -=back - -=item C<"window item server changed"> - -=over - -=item L C<$window> - -=item L C<$window_item> - -=back - -=back - -=head3 F: - -=over - -=item C<"window created"> - -=over - -=item L C<$window> - -=back - -=item C<"window destroyed"> - -=over - -=item L C<$window> - -=back - -=item C<"window changed"> - -=over - -=item L C<$window> - -=item L C<$old_window> - -=back - -B - -=item C<"window changed automatic"> - -=over - -=item L C<$window> - -=back - -=item C<"window server changed"> - -=over - -=item L C<$window> - -=item L C<$server> - -=back - -=item C<"window refnum changed"> - -=over - -=item L C<$window> - -=item int C<$old_refnum> - -=back - -=item C<"window name changed"> - -=over - -=item L C<$window> - -=back - -=item C<"window history changed"> - -=over - -=item L C<$window> - -=item string C<$old_name> - -=back - -=item C<"window level changed"> - -=over - -=item L C<$window> - -=back - -=back - -=head2 Display (FE) IRC - -=head3 F: - -=over - -=item C<"default event numeric"> - -=over - -=item L C<$server> - -=item string C<$data> - -=item string C<$nick> - -=item string C<$address> - -=back - -=back - -=head3 F: - -=over - -=item C<"message irc op_public"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$target> - -=back - -=item C<"message irc own_wall"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$target> - -=back - -=item C<"message irc own_action"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$target> - -=back - -=item C<"message irc action"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$target> - -=back - -=item C<"message irc own_notice"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$target> - -=back - -=item C<"message irc notice"> - -=over - -=item L C<$server> - -=item string C<$msg> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$target> - -=back - -=item C<"message irc own_ctcp"> - -=over - -=item L C<$server> - -=item string C<$cmd> - -=item string C<$data> - -=item string C<$target> - -=back - -=item C<"message irc ctcp"> - -=over - -=item L C<$server> - -=item string C<$cmd> - -=item string C<$data> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$target> - -=back - -=back - -=head3 F: - -=over - -=item C<"message irc mode"> - -=over - -=item L C<$server> - -=item string C<$channel> - -=item string C<$nick> - -=item string C<$address> - -=item string C<$mode> - -=back - -=back - -=head3 F: - -=over - -=item C<"message dcc own"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"message dcc own_action"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"message dcc own_ctcp"> - -=over - -=item L C<$dcc> - -=item string C<$cmd> - -=item string C<$data> - -=back - -=item C<"message dcc"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"message dcc action"> - -=over - -=item L C<$dcc> - -=item string C<$msg> - -=back - -=item C<"message dcc ctcp"> - -=over - -=item L C<$dcc> - -=item string C<$cmd> - -=item string C<$data> - -=back - -=back - -=head2 Display (FE) Text - -=head3 F: - -=over 4 - -=item C<"gui key pressed"> - -=over - -=item int C<$key> - -=back - -Notes: - -Ordinary keys C are their ordinal (ascii) equivalents. - -Ctrl-key begins at 1 (C), but skips 13?, C and C both give the same -as C (10). Tab and C are equivalent (9). C does not appear to send -an observable sequence. - -C sends 127. - -CkeyE> sends a 27 (ESC) followed by the original key value. - -Arrow keys send usual meta-stuff (C<\e[I>). - -B - -=back - -=head3 F: - -=over 4 - -=item C<"beep"> - -=over - -=item I - -=back - -=back - -=head2 Perl Scripting - -=over 4 - -=item C<"script error"> - -=over - -=item L C<$script> - -=item string C<$error_msg> - -=back - -=back - -=for irssi_signal_defs END OF SIGNAL DEFINITIONS - -=head1 SIGNAL AUTO-GENERATION - -This file is used to auto-generate the signal definitions used by Irssi, and hence -must be edited in order to add new signals. - -=head2 Format - - diff --git a/docs/Irssi.pod b/docs/Irssi.pod deleted file mode 100644 index f5d72b7..0000000 --- a/docs/Irssi.pod +++ /dev/null @@ -1,1109 +0,0 @@ -__END__ - -=head1 NAME - -Irssi - -=head1 DESCRIPTION - -L is a console based fullscreen IRC client. It is -written in the C programming language, and can be modified through both -I -- dynamically loadable compiled libraries -- and I, written -in L. - -Modules are not covered in this documentation, other than to note that Perl -scripting support itself may be compiled as a module rather than built directly -into Irssi. The C command can be used from within Irssi to check if Perl -support is available. If not, refer to the F file for how to recompile -irssi. - -The C package is the basis of Perl scripting in Irssi. It does not export any -functions by default, and requires that all function-calls be fully qualified with the -C> prefix. See L for alternatives. - -=head1 CLASSES - -This documentation has been split into a number of pages, each documenting a -particular class or pseudo-class. The following list contains all of these -additional pages. - -B - -=over 4 - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=item L - -=back - - -=head1 EXPORTS - -Nothing by default, but passing a list of function names when Cing the module -will import them into the current namespace. - -For example: - - use Irssi qw/signal_emit signal_add .../; - -=head1 METHODS - -=head2 Accessors - -=head3 C - -C - -returns the currently active L - -=head3 C - -C - -returns the currently active L in active window. - -=head3 C - -C -returns a list of all L. - -When called in scalar context C, only the first -window is returned. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - -=head3 C - -returns a list of all L. - - -=head2 File Accessors - -=head3 C - -Indicates if Irssi has been started with a GUI frontend. - -Return values are: - -=over - -=item C - C<0> - -=item C - C<1> - -=item C - C<2> - -=item C - C<3> - -=item C - C<4> - -=item C - C<5> - -=back - -The symbolic constants listed above can be accessed from scripts as follows: - - my $is_text = Irssi::get_gui == Irssi::IRSSI_GUI_TEXT; - -=head3 C - -Returns a string containing the absolute location of the binary that this -instance of Irssi was invoked from. - -=head3 C - -Returns a string containing the absolute location of the config file that was -specified or defaulted to when Irssi started up. Can be modified at startup -using the C<--config=> commandline option, or defaults to F<~/.irssi/config>. - -=head3 C - -Returns a string containing the absolute location of the base directory that was -specified or defaulted to when Irssi started up. Can be modified at startup -using the C<--home=> commandline option, or defaults to F<~/.irssi/>. - -=head2 Signals - -See also L - -Irssi is pretty much based on sending and handling different signals. -Like when you receive a message from server, say: - -C<:nick!user@there.org PRIVMSG you :blahblah> - -Irssi will first send a signal: - -C<"server incoming", SERVER_REC, "nick!user@there PRIVMSG ..."> - -You probably don't want to use this signal. Default handler for this -signal interprets the header and sends a signal: - -C<"server event", Irssi::Server, "PRIVMSG ...", "nick", "user@there.org"> - -You probably don't want to use this either, since this signal's default -handler parses the event string and sends a signal: - -C<"event privmsg", Irssi::Server, "you :blahblah", "nick", "user@there.org"> - -You can at any point grab the signal, do whatever you want to do with -it and optionally stop it from going any further by calling -L - -For example: - - sub event_privmsg { - # $data = "nick/#channel :text" - my ($server, $data, $nick, $address) = @_; - my ($target, $text) = split(/ :/, $data, 2); - - Irssi::signal_stop() if ($text =~ /free.*porn/ || $nick =~ /idiot/); - } - - Irssi::signal_add("event privmsg", "event_privmsg"); - -This will hide all public or private messages that match the regexp -C<"free.*porn"> or the sender's nick contain the word "idiot". Yes, you -could use /IGNORE instead for both of these C<:)> - -You can also use L if you wish to let the -Irssi's internal functions be run before yours. - -A list of signals that irssi sends can be found in the L -documentation. - - - - -=head3 Handling Signals - -=head4 C - -Bind C<$sig_name> to function C<$func>. The C<$func> argument may be either -a string containing the name of a function to call, or a coderef. - -For example: - - Irssi::signal_add("default command", sub { ... }); - - Irssi::signal_add("default command", "my_function"); - - Irssi::signal_add("default command", \&my_function); - -In all cases, the specified function will be passed arguments in C<@_> as specified -in L. - -=head4 C - -Bind C<$sig_name> to function C<$func>. Call C<$func> as soon as possible when -the signal is raised. - -=head4 C - -Bind C<$sig_name> to function C<$func>. Call C<$func> as late as possible (after -all other signal handlers). - -=head4 C - -Unbind C<$sig_name> from function C<$func>. -B coderef? What happens?> - - -=head3 Controlling Signal Propagation - -=head4 C - -Send a signal of type C<$sig_name>. Up to 6 parameters can be passed in C<@params>. - -=head4 C - -Propagate a currently emitted signal, but with different parameters. This only -needs to be called if you wish to change them, otherwise all subsequent handlers -will be invoked as normal. - -For example, we can intercept a public message and rewrite the content before -passing it on: - - Irssi::signal_add_first 'message public', - sub { - my ($server, $msg, @rest) = @_; - $msg =~ s/this/that/g; - Irssi::signal_continue($server, $msg, @rest); - }; - -Note that if you want to do this sort of rewriting, it is important to add your -handler using L to it is -called before the internal Irssi handlers which would usually consume it. - -B - -=head4 C - -Stop the signal that's currently being emitted, no other handlers after this one will -be called. - -=head4 C - -Stop the signal with name C<$sig_name> that is currently being emitted. - -=head3 Registering New Signals - -=head4 C - -Register parameter types for one or more signals. C<$hashref> must map one or -more signal names to references to arrays containing 0 to 6 type names. Some -recognized type names include int for integers, intptr for references to -integers and string for strings. For all standard signals see -F in the source code (this is generated by -F). - -For example: - - my $signal_config_hash = { "new signal" => [ qw/string string integer/ ] }; - Irssi::signal_register($signal_config_hash); - -Any signals that were already registered are unaffected. - -B Once registered, a signal cannot be unregistered without -restarting Irssi. B, including modifying the type signature. - -Registration is required to get any parameters to signals written in -Perl and to emit and continue signals from Perl. - -B - - -=head2 Commands - -See also L - -=head3 Registering Commands - -=head4 C - -Bind a command string C<$cmd> to call function C<$func>. C<$func> can be -either a string or coderef. C<$category> is an optional string specifying -the category to display the command in when C is used. - -When a command is invoked, either by the user typing C, the -handler function will be called. - -It will receive the following parameters, passed in C<@_>: - - my ($argument_string, $server_obj, $window_item_obj) = @_; - -The argument string must be processed by the handler to split it into -individual words if necessary. - -The L function can be -used to process options (beginning with a single dash), and will also return the -remainder of the string to be processed as desired. - -=head4 C - -Run subcommands for C<$cmd>. First word in C<$data> is parsed as -subcommand. C<$server> is L record for current -L C<$item>. - -Call command_runsub in handler function for C<$cmd> and bind -with: - - command_bind("$cmd $subcmd", subcmdfunc[, category]); - -See the L -for further details. - -=head4 C - -Unbind command C<$cmd> from function C<$func>. - -=head3 Invoking Commands - -=head4 C - -Run the command specified in C<$string> in the currently active context. - -B vs concatenating into the command string?> - -See also L - -=head3 Parsing Command Arguments - -=head4 C - -Set options for command C<$cmd> to C<$data>. C<$data> is a string of -space separated words which specify the options. Each word can be -optionally prefixed with one of the following character: - -=over 16 - -=item C<->: optional argument - -=item C<@>: optional numeric argument - -=item C<+>: required argument - -=back - -For example: - - my $argument_format = "+something -other -another @number"; - Irssi::command_set_options('mycmd', $argument_format); - -Thus, the command may be run as C. - -=head4 C - -Parse out options as specified by L for command C<$cmd>. A string containing the input received by the -command handler should be passed in as C<$data>. - -The return value is either C if an error occurred, or a list containing -two items. The first is a hashref mapping the option names to their -values. Optional arguments which were not present in the input will not be -included in the hash. - -The second item in the return list is a string containing the remainder of the input -after the arguments have been parsed out. - -For example: - - sub my_cmd_handler { - my ($command_args) = @_; - my @options_list = Irssi::command_parse_options "my_cmd", $command_args; - if (@options_list) { - my $options = $options_list->[0]; - my $arg_remainder = $options_list->[1]; - - if (exists $options->{other} && $options->{something} eq 'hello') { - - ... - - } - } - } - -=head2 Settings - -Settings are a way to permanently store values that your script may wish to use. -They are also easily manipulable by the user through the C command, making -them a good way to allow configuration of your script. - -The following list summarises the data types available: - -=over - -=item C - -A generic string type, which can contain arbitrary text. It is also commonly -used to build space-separated lists of entries. - -=item C - -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 -true. When acting on them externally, C and C are the usual terms used. - -=item C