From 24e48ff237a5f200ed3e36a660ee920583ab49ca Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 22 Aug 2010 17:13:35 +0100 Subject: moved some stuff into General, and started to modify buildpod.pl to render a better index page. --- docs/Formats.pod | 147 --- docs/General/Formats.pod | 147 +++ docs/General/Guide.pod | 346 +++++++ docs/General/Signals.pod | 2458 ++++++++++++++++++++++++++++++++++++++++++++++ docs/Guide.pod | 346 ------- docs/Irssi/UI/Theme.pod | 6 +- docs/Signals.pod | 2458 ---------------------------------------------- docs/buildpod.pl | 87 +- docs/podstyle.css | 139 +++ test/irssi/config | 12 +- 10 files changed, 3182 insertions(+), 2964 deletions(-) delete mode 100644 docs/Formats.pod create mode 100644 docs/General/Formats.pod create mode 100644 docs/General/Guide.pod create mode 100644 docs/General/Signals.pod delete mode 100644 docs/Guide.pod delete mode 100644 docs/Signals.pod create mode 100644 docs/podstyle.css diff --git a/docs/Formats.pod b/docs/Formats.pod deleted file mode 100644 index 0aaca37..0000000 --- a/docs/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/Formats.pod b/docs/General/Formats.pod new file mode 100644 index 0000000..0aaca37 --- /dev/null +++ b/docs/General/Formats.pod @@ -0,0 +1,147 @@ +__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 new file mode 100644 index 0000000..3a9f43f --- /dev/null +++ b/docs/General/Guide.pod @@ -0,0 +1,346 @@ +__END__ + +=head1 NAME + +Guide To Irssi Scripting. + +=head1 DESCRIPTION + +=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/>. + +=head2 Testing + +=for comment B + +=head3 C + +B + +B + +B + +=head2 Loading + +Scripts are loaded via 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 should be used in B perl scripts, not just Irssi. 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/Signals.pod b/docs/General/Signals.pod new file mode 100644 index 0000000..f12dd7f --- /dev/null +++ b/docs/General/Signals.pod @@ -0,0 +1,2458 @@ +__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 C, + +=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 + +=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 + +=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/Guide.pod b/docs/Guide.pod deleted file mode 100644 index 3a9f43f..0000000 --- a/docs/Guide.pod +++ /dev/null @@ -1,346 +0,0 @@ -__END__ - -=head1 NAME - -Guide To Irssi Scripting. - -=head1 DESCRIPTION - -=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/>. - -=head2 Testing - -=for comment B - -=head3 C - -B - -B - -B - -=head2 Loading - -Scripts are loaded via 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 should be used in B perl scripts, not just Irssi. 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/Irssi/UI/Theme.pod b/docs/Irssi/UI/Theme.pod index 1df1ada..323e6b3 100644 --- a/docs/Irssi/UI/Theme.pod +++ b/docs/Irssi/UI/Theme.pod @@ -8,11 +8,11 @@ Irssi::UI::Theme =head1 METHODS -=head2 C +=head2 C I -=head2 C +=head2 C I @@ -49,7 +49,7 @@ The actual mechanism used by Irssi to print text into the client involves a certain amount of indirection, which allows themes to reformat messages in various ways before they are displayed. - +The overall structure of these The real text formats that irssi uses are the ones you can find with /FORMAT command. Back in the old days all the colors and texts were mixed diff --git a/docs/Signals.pod b/docs/Signals.pod deleted file mode 100644 index f12dd7f..0000000 --- a/docs/Signals.pod +++ /dev/null @@ -1,2458 +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 C, - -=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 - -=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 - -=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/buildpod.pl b/docs/buildpod.pl index 816b6e0..ce2b2aa 100755 --- a/docs/buildpod.pl +++ b/docs/buildpod.pl @@ -3,15 +3,88 @@ use strict; use warnings; -use Pod::Simple::HTMLBatch; -use File::Find; +package Pod::Simple::HTMLBatch::Custom; +use base qw/Pod::Simple::HTMLBatch/; + +use vars qw/$VERSION/; + +$VERSION = '0.01'; +sub esc { + return Pod::Simple::HTMLBatch::esc(@_); +} + +sub new { + print "Hello!\n"; + my $self = shift; + my $obj = $self->SUPER::new(@_); + + $obj->add_css('podstyle.css', 1); + $obj->css_flurry(0); + $obj->javascript_flurry(0); + + + my @index_header = ("\n", + "\n", + "Irssi Scripting Documentation\n", + "\n", + "

Irssi Scripting Documentation

\n", + ); + + $obj->contents_page_start(join("", @index_header)); + + + my $index_footer = sprintf("\n\n

Generated " + . "by %s v%s under Perl v%s\n
At %s GMT" + . ", which is %s local time.

\n\n\n", + esc(ref($obj), $VERSION, + $], scalar(gmtime), scalar(localtime))); + + + my @copyright = ( + "

Much of the content on these pages is taken", + " from original Irssi documentation, and is Copyright", + " © 2000-2010 The Irssi project.
", + " Formatting and additional documentation by Tom Feist", + " shabble+irssi\@metavore.org", + "

"); + + $obj->contents_page_end($index_footer . join("", @copyright)); + + return $obj; +} + + + +sub _write_contents_middle { + my($self, $Contents, $outfile, $toplevel2submodules, $toplevel_form_freq) = @_; + + foreach my $t (sort keys %$toplevel2submodules) { + my @downlines = sort {$a->[-1] cmp $b->[-1]} + @{ $toplevel2submodules->{$t} }; + + printf $Contents qq[
%s
\n
\n], + esc( $t, $toplevel_form_freq->{$t} ) ; + + my($path, $name); + foreach my $e (@downlines) { + $name = $e->[0]; + $path = join( "/", '.', esc( @{$e->[3]} ) ) + . ($POD::Simple::HTMLBatch::HTML_EXTENSION + || $Pod::Simple::HTML::HTML_EXTENSION); + print $Contents qq{ }, esc($name), "
\n"; + } + print $Contents "
\n\n"; + } + return 1; +} + +1; + +package main; my $output_dir = "../../tmp/shab-irssi-scripts/docs/"; -my $batchconv = Pod::Simple::HTMLBatch->new; -$batchconv->add_css('podstyle.css', 1); -$batchconv->css_flurry(0); -$batchconv->javascript_flurry(0); +my $batchconv = Pod::Simple::HTMLBatch::Custom->new; -$batchconv->batch_convert( [qw/./], $output_dir ); +$batchconv->batch_convert([qw/./], $output_dir); diff --git a/docs/podstyle.css b/docs/podstyle.css new file mode 100644 index 0000000..79dbc1d --- /dev/null +++ b/docs/podstyle.css @@ -0,0 +1,139 @@ +/* This file is autogenerated. Do not edit. 110n=black_with_blue_on_white */ + +/* For accessibility reasons, never specify text sizes in px/pt/pc/in/cm/mm */ + +@media all { .hide { display: none; } } + +@media print { + .noprint, div.indexgroup, .backlinktop, .backlinkbottom { display: none } + + * { + border-color: black !important; + color: black !important; + background-color: transparent !important; + background-image: none !important; + } + + dl.superindex > dd { + word-spacing: .6em; + } +} + +@media aural, braille, embossed { + div.indexgroup { display: none; } /* Too noisy, don't you think? */ + dl.superindex > dt:before { content: "Group "; } + dl.superindex > dt:after { content: " contains:"; } + .backlinktop a:before { content: "Back to contents"; } + .backlinkbottom a:before { content: "Back to contents"; } +} + +@media aural { + dl.superindex > dt { pause-before: 600ms; } +} + +@media screen, tty, tv, projection { + .noscreen { display: none; } + + a:link { color: #7070ff; text-decoration: underline; } + a:visited { color: #e030ff; text-decoration: underline; } + a:active { color: #800000; text-decoration: underline; } + body.contentspage a { text-decoration: none; } + a.u { color: #000 !important; text-decoration: none; } + + body.pod { + margin: 0 5px; + color: #000; + background-color: #fff; + } + + .pod pre { + background: #eeeeee; + border: 1px solid #888888; + color: black; + padding: 1em; + white-space: pre; + } + + body.pod h1, body.pod h2, body.pod h3, body.pod h4 { + font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; + font-weight: normal; + margin-top: 1.2em; + margin-bottom: .1em; + border-top: medium solid transparent; + /* margin-left: -5px; border-left: 2px #7070ff solid; padding-left: 3px; */ + } + + body.pod h1 { border-top-color: #55f; } + body.pod h2 { border-top-color: #77f; } + body.pod h3 { border-top-color: #bbf; } + body.pod h4 { border-top-color: #eef; } + + p.backlinktop + h1 { border-top: none; margin-top: 0em; } + p.backlinktop + h2 { border-top: none; margin-top: 0em; } + p.backlinktop + h3 { border-top: none; margin-top: 0em; } + p.backlinktop + h4 { border-top: none; margin-top: 0em; } + + body.pod dt { + font-size: 105%; /* just a wee bit more than normal */ + } + + .indexgroup { font-size: 80%; } + + .backlinktop, .backlinkbottom { + margin-left: -5px; + margin-right: -5px; + background-color: #bbf; + border-top: medium solid #aaf; + border-bottom: medium solid #aaf; + } + + .backlinktop a, .backlinkbottom a { + text-decoration: none; + color: #77f; + background-color: #fff; + border: medium solid #22f; + } + .backlinkbottom { margin-bottom: 0; padding-bottom: 0; } + .backlinktop { margin-top: 0; padding-top: 0; } + + body.contentspage { + color: #000; + background-color: #fff; + } + + body.contentspage h1 { + color: #22f; + margin-left: 1em; + margin-right: 1em; + text-indent: -.9em; + font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; + font-weight: normal; + border-top: medium solid #000; + border-bottom: medium solid #000; + text-align: center; + } + + dl.superindex > dt { + font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; + font-weight: normal; + font-size: 90%; + margin-top: .45em; + /* margin-bottom: -.15em; */ + } + dl.superindex > dd { + word-spacing: .6em; /* most important rule here! */ + } + dl.superindex > a:link { + text-decoration: none; + color: #000; + } + + .contentsfooty { + border-top: medium solid #666; + font-size: 90%; + } + +} + +/* The End */ + diff --git a/test/irssi/config b/test/irssi/config index 620c7e3..b06a8a3 100644 --- a/test/irssi/config +++ b/test/irssi/config @@ -154,7 +154,7 @@ aliases = { et = "/script unload expando_test.pl; /script load expando_test"; se = "script exec"; detach = "eval exec - screen -X detach"; - xxx = "/dump Irssi::UI::bindings()"; + xxx = "/dump Irssi::bindings()"; showbind = "/script exec \\%foo = Irssi::UI::bindings()\\; print \\$foo{\"\\\\$0\"}\\;"; }; @@ -272,7 +272,11 @@ settings = { timestamp_format = "%+"; }; "fe-text" = { actlist_sort = "refnum"; indent = "1"; }; - "perl/core/scripts" = { autoinstall_custom_prompt = "yes"; }; + "perl/core/scripts" = { + autoinstall_custom_prompt = "yes"; + mass_hilight_action = "/echo $nick"; + mass_hilight_threshold = "0"; + }; "fe-common/core" = { bell_beeps = "yes"; }; }; keyboard = ( @@ -283,5 +287,7 @@ keyboard = ( }, { key = "meta-x"; id = "command"; data = "history_search "; }, { key = "^Z"; id = "command"; data = "echo moo"; }, - { key = "^R"; id = "command"; data = "history_search_start "; } + { key = "^R"; id = "command"; data = "history_search_start "; }, + { key = "meta-h"; id = "command"; data = "echo moo /echo moo"; }, + { key = "meta-q"; id = "command"; data = " "; } ); -- cgit v1.2.3