summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-12 03:30:57 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-12 03:30:57 -0400
commitc328b1b3b2575ce27ce5bfc4d901a7e011d010a8 (patch)
treeacf909a9b61c5654d6a965e2cf2a1cb3ba1a97f2
parentc8cd2c468e202f07af187590dcdc07935b6918f6 (diff)
downloadfork-ledger-c328b1b3b2575ce27ce5bfc4d901a7e011d010a8.tar.gz
fork-ledger-c328b1b3b2575ce27ce5bfc4d901a7e011d010a8.tar.bz2
fork-ledger-c328b1b3b2575ce27ce5bfc4d901a7e011d010a8.zip
Turned on the "emacs" command and budgeting, though neither are tested yet.
-rw-r--r--src/report.cc7
-rw-r--r--src/report.h7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/report.cc b/src/report.cc
index 7d8353d9..9da1c357 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -34,11 +34,13 @@
#include "filters.h"
#include "chain.h"
#include "output.h"
+#include "emacs.h"
#include "precmd.h"
namespace ledger {
-report_t::report_t(session_t& _session) : session(_session)
+report_t::report_t(session_t& _session)
+ : session(_session), budget_flags(BUDGET_NO_BUDGET)
{
// Setup default values for some of the option handlers
HANDLER(date_format_).on("%y-%b-%d");
@@ -524,7 +526,8 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
else if (is_eq(p, "entry"))
return WRAP_FUNCTOR(entry_command);
else if (is_eq(p, "emacs"))
- return NULL; // jww (2009-02-07): NYI
+ return WRAP_FUNCTOR
+ (reporter<>(new format_emacs_xacts(output_stream), *this));
break;
case 'p':
diff --git a/src/report.h b/src/report.h
index 15ee82c6..96965b16 100644
--- a/src/report.h
+++ b/src/report.h
@@ -108,7 +108,14 @@ public:
session_t& session;
output_stream_t output_stream;
+#define BUDGET_NO_BUDGET 0x00
+#define BUDGET_BUDGETED 0x01
+#define BUDGET_UNBUDGETED 0x02
+
+ uint_least8_t budget_flags;
+
explicit report_t(session_t& _session);
+
virtual ~report_t() {
output_stream.close();
}