From 2b64353160c3f364267c2228cc9c649e58e2008f Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Mon, 20 Sep 2010 19:48:26 +0100 Subject: added a warning message to prompt_info indicating that the user hasn't modified their prompt theme to include the necessary expando. --- prompt_info/prompt_info.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'prompt_info') diff --git a/prompt_info/prompt_info.pl b/prompt_info/prompt_info.pl index 342b62c..260a9f8 100644 --- a/prompt_info/prompt_info.pl +++ b/prompt_info/prompt_info.pl @@ -76,7 +76,18 @@ sub prompt_additional_cmd { Irssi::signal_emit('change prompt', $str); } +test_abstract_setup(); Irssi::signal_register({'change prompt' => [qw/string/]}); Irssi::signal_add('change prompt' => \&handle_change_prompt_sig); Irssi::command_bind('set_prompt' => \&prompt_additional_cmd); + +sub test_abstract_setup { + my $theme = Irssi::current_theme(); + my $prompt = $theme->format_expand('{prompt}', 0); + if ($prompt !~ m/\$prompt_additional/) { + print "Prompt_Info: It looks like you haven't modified your theme" + . " include the \$prompt_additional expando. You will not see" + . " any prompt info messages until you do."; + } +} -- cgit v1.2.3