aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-11-04 18:23:03 +0000
committerTom Feist <shabble@metavore.org>2010-11-04 18:23:03 +0000
commit687601b7a9c26c7d5739255e86271b501f0f73e3 (patch)
tree09fe92b8b3ed8420f6b4167fa9f1ca4a8e57d3e9
parentadded input overlay script, still wip (diff)
downloadirssi-scripts-687601b7a9c26c7d5739255e86271b501f0f73e3.tar.gz
irssi-scripts-687601b7a9c26c7d5739255e86271b501f0f73e3.zip
make hist_search attempt to load uberprompt if it isn't already. If that fails,
then die
-rw-r--r--history-search/rl_history_search.pl18
1 files changed, 15 insertions, 3 deletions
diff --git a/history-search/rl_history_search.pl b/history-search/rl_history_search.pl
index eebb6c7..e6781db 100644
--- a/history-search/rl_history_search.pl
+++ b/history-search/rl_history_search.pl
@@ -91,12 +91,24 @@ sub script_is_loaded {
}
unless (script_is_loaded('uberprompt')) {
- die "This script requires 'uberprompt.pl' in order to work. "
- . "Please load it and try again";
-} else {
+ print "This script requires 'uberprompt.pl' in order to work. "
+ . "Attempting to load it now...";
+ Irssi::signal_add('script error', \&load_uberprompt_failed);
+ Irssi::command("script load uberprompt.pl");
+ unless(script_is_loaded('uberprompt')) {
+ load_uberprompt_failed("File does not exist");
+ }
history_init();
}
+sub load_uberprompt_failed {
+ Irssi::sigal_remove('script error', \&load_prompt_failed);
+ print "Script could not be loaded. Script cannot continue. "
+ . "Check you have uberprompt.pl installed in your path and "
+ . "try again.";
+ die "Script Load Failed: " . join(" ", @_);
+}
+
sub history_init {
Irssi::settings_add_bool('history_search', 'histsearch_debug', 0);