diff options
author | Timo Sirainen <cras@irssi.org> | 2002-12-08 16:40:42 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-12-08 16:40:42 +0000 |
commit | 3447e0c1b9937fa9728c2b592bb717a23cadd6ee (patch) | |
tree | d3f50be5bbf0d34da7d38d04ddb5b543ffc9bd8e /scripts | |
parent | 0152ec2d1965c358a9eedb2346165a3d44af3cde (diff) | |
download | irssi-3447e0c1b9937fa9728c2b592bb717a23cadd6ee.zip |
Updated from scripts.irssi.org
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3049 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/scriptassist.pl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/scriptassist.pl b/scripts/scriptassist.pl index 93c50075..946fae6a 100644 --- a/scripts/scriptassist.pl +++ b/scripts/scriptassist.pl @@ -979,21 +979,18 @@ sub toggle_autorun ($) { } } -sub sig_gui_print_text ($$$$$$) { - my ($win, $fg, $bg, $flags, $text, $dest) = @_; - return if $flags > 1; +sub sig_script_error ($$) { + my ($script, $msg) = @_; return unless Irssi::settings_get_bool('scriptassist_catch_script_errors'); - if ($text =~ /Can't locate (.*?)\.pm in \@INC \(\@INC contains:(.*?) at/) { + if ($msg =~ /Can't locate (.*?)\.pm in \@INC \(\@INC contains:(.*?) at/) { my $module = $1; $module =~ s/\//::/g; - my $time; - $time = Irssi::timeout_add(10, \&missing_module, [$module, \$time]); + missing_module($module); } } sub missing_module ($$) { - my ($module, $time) = @{ $_[0] }; - Irssi::timeout_remove($$time); + my ($module) = @_; my $text; $text .= "The perl module %9".$module."%9 is missing on your system.\n"; $text .= "Please ask your administrator about it.\n"; @@ -1087,7 +1084,9 @@ Irssi::settings_add_bool($IRSSI{name}, 'scriptassist_integrate', 1); Irssi::signal_add_first('complete word', \&sig_complete); Irssi::signal_add_first('command script load', \&sig_command_script_load); Irssi::signal_add_first('command script unload', \&sig_command_script_load); -Irssi::signal_add_last('gui print text', \&sig_gui_print_text); + +Irssi::signal_register({ 'script error' => [ 'Irssi::Script', 'string' ] }); +Irssi::signal_add_last('script error', \&sig_script_error); Irssi::command_bind('scriptassist', 'cmd_scripassist'); |