From 3447e0c1b9937fa9728c2b592bb717a23cadd6ee Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 8 Dec 2002 16:40:42 +0000 Subject: [PATCH] Updated from scripts.irssi.org git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3049 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- scripts/scriptassist.pl | 17 ++++++++--------- 1 file 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');