From 70344b82e70f454462f31daec05d79554804e8f8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 13 Feb 2009 05:24:28 -0400 Subject: Added a "reload" command, for use at the REPL Created a new function, session_t::reread_journal_files, which throws away all previous state data and reads in the same files again. This is needed to allow Emacs to communicate with Ledger via the REPL, so that it tell Ledger when it has made changes to the user's data file. --- src/global.cc | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/global.cc') diff --git a/src/global.cc b/src/global.cc index c012b17d..b2dc24fc 100644 --- a/src/global.cc +++ b/src/global.cc @@ -109,24 +109,6 @@ void global_scope_t::read_init() } } -void global_scope_t::read_journal_files() -{ - INFO_START(journal, "Read journal file"); - - string master_account; - if (session().HANDLED(account_)) - master_account = session().HANDLER(account_).str(); - - std::size_t count = session().read_data(master_account); - if (count == 0) - throw_(parse_error, "Failed to locate any journal entries; " - "did you specify a valid file with -f?"); - - INFO_FINISH(journal); - - INFO("Found " << count << " entries"); -} - char * global_scope_t::prompt_string() { static char prompt[32]; @@ -195,7 +177,7 @@ void global_scope_t::execute_command(strings_list args, bool at_repl) if (! is_precommand) { if (! at_repl) - read_journal_files(); + session().read_journal_files(); normalize_report_options(verb); } -- cgit v1.2.3