diff options
Diffstat (limited to 'emacs.cc')
-rw-r--r-- | emacs.cc | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -5,7 +5,7 @@ namespace ledger { void format_emacs_transactions::write_entry(entry_t& entry) { int idx = entry.src_idx; - for (strings_list::iterator i = entry.journal->sources.begin(); + for (paths_list::const_iterator i = entry.journal->sources.begin(); i != entry.journal->sources.end(); i++) if (! idx--) { @@ -15,13 +15,15 @@ void format_emacs_transactions::write_entry(entry_t& entry) out << (((unsigned long)entry.beg_line) + 1) << " "; - std::time_t date = entry.date().when; + tm when = boost::posix_time::to_tm(entry.date()); + std::time_t date = std::mktime(&when); // jww (2008-04-20): Is this GMT or local? + out << "(" << (date / 65536) << " " << (date % 65536) << " 0) "; - if (entry.code.empty()) + if (! entry.code) out << "nil "; else - out << "\"" << entry.code << "\" "; + out << "\"" << *entry.code << "\" "; if (entry.payee.empty()) out << "nil"; @@ -65,10 +67,8 @@ void format_emacs_transactions::operator()(transaction_t& xact) if (xact.cost) out << " \"" << *xact.cost << "\""; - else if (! xact.note.empty()) - out << " nil"; - if (! xact.note.empty()) - out << " \"" << xact.note << "\""; + if (xact.note) + out << " \"" << *xact.note << "\""; out << ")"; last_entry = xact.entry; |