summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README-1ST14
-rw-r--r--doc/ledger3.texi8
-rw-r--r--lisp/CMakeLists.txt38
-rw-r--r--lisp/ledger-xact.el4
-rw-r--r--src/amount.cc10
-rw-r--r--src/journal.cc2
-rw-r--r--test/input/drewr3.dat11
7 files changed, 32 insertions, 55 deletions
diff --git a/README-1ST b/README-1ST
index 1a516353..21a50ea9 100644
--- a/README-1ST
+++ b/README-1ST
@@ -11,22 +11,10 @@ almost certainly going to run into problems. In future, you can run
'acprep update' again and again, and it will keep you updated to the
very latest version.
-I further recommend building both debug and optimized versions of Ledger, in a
-subdirectory of your source tree named 'build' (which acprep will manage for
-you, you simply need to create it):
+Now install it:
- $ mkdir build
- $ ./acprep opt make
- $ ./acprep debug make
-
-Now install the optimized version:
-
- $ cd build/ledger/opt
$ sudo make install
-but know that you have 'build/ledger/debug' available for testing and
-for more useful bug reports.
-
===============================================================================
COMMON CONFIGURE/BUILD PROBLEMS
===============================================================================
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index 0e22aad6..83d0368f 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -1422,7 +1422,7 @@ increase compatibility with other text manipulation programs and
methods four additional comment characters are valid if used at the
beginning of a line: @samp{#}, @samp{|}, and @samp{*} and @samp{%}.
-Block comments can be made by use @code{@!comment} ... @code{@!end
+Block comments can be made by use @code{comment} ... @code{end
comment}.
@smallexample
@@ -1432,10 +1432,10 @@ comment}.
| and this,
* and this.
-!comment
+comment
This is a block comment with
multiple lines
-!end comment
+end comment
@end smallexample
There are several forms of comments within a transaction, for example:
@@ -2000,7 +2000,7 @@ the account directive. For example:
@smallexample
apply account Personal
2011/11/15 Supermarket
- Expenses:Groceries
+ Expenses:Groceries $ 50.00
Assets:Checking
@end smallexample
diff --git a/lisp/CMakeLists.txt b/lisp/CMakeLists.txt
index 2258fd5d..33fe6f14 100644
--- a/lisp/CMakeLists.txt
+++ b/lisp/CMakeLists.txt
@@ -1,23 +1,21 @@
set(EMACS_LISP_SOURCES
- ldg-commodities.el
- ldg-complete.el
- ldg-exec.el
- ldg-fonts.el
- ldg-init.el
- ldg-mode.el
- ldg-new.el
- ldg-occur.el
- ldg-post.el
- ldg-reconcile.el
- ldg-regex.el
- ldg-report.el
- ldg-sort.el
- ldg-state.el
- ldg-test.el
- ldg-texi.el
- ldg-xact.el
- ldg-context.el
- ldg-schedule.el)
+ ledger-commodities.el
+ ledger-complete.el
+ ledger-exec.el
+ ledger-fonts.el
+ ledger-init.el
+ ledger-mode.el
+ ledger-occur.el
+ ledger-post.el
+ ledger-reconcile.el
+ ledger-regex.el
+ ledger-report.el
+ ledger-schedule.el
+ ledger-sort.el
+ ledger-state.el
+ ledger-test.el
+ ledger-texi.el
+ ledger-xact.el)
# find emacs and complain if not found
find_program(EMACS_EXECUTABLE emacs)
@@ -30,7 +28,7 @@ macro(add_emacs_lisp_target el)
OUTPUT ${el}c
COMMAND ${EMACS_EXECUTABLE}
-L ${CMAKE_CURRENT_BINARY_DIR}
- -l ${CMAKE_CURRENT_BINARY_DIR}/ldg-regex.el
+ -l ${CMAKE_CURRENT_BINARY_DIR}/ledger-regex.el
-batch -f batch-byte-compile
${CMAKE_CURRENT_BINARY_DIR}/${el}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}
diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el
index fac040e6..7f2200a4 100644
--- a/lisp/ledger-xact.el
+++ b/lisp/ledger-xact.el
@@ -150,7 +150,9 @@ MOMENT is an encoded date"
(backward-paragraph 2)
(re-search-forward ledger-iso-date-regexp)
(replace-match date)
- (ledger-next-amount)))
+ (ledger-next-amount)
+ (if (re-search-forward "[-0-9]")
+ (goto-char (match-beginning 0)))))
(defun ledger-delete-current-transaction (pos)
"Delete the transaction surrounging point."
diff --git a/src/amount.cc b/src/amount.cc
index 4fe73546..6ff2f4dd 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -196,8 +196,8 @@ namespace {
for (const char * p = buf; *p; p++) {
if (*p == '.') {
- if (commodity_t::time_colon_by_default ||
- (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON)))
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && (commodity_t::time_colon_by_default ||
+ (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON))))
out << ':';
else if (commodity_t::decimal_comma_by_default ||
(comm && comm->has_flags(COMMODITY_STYLE_DECIMAL_COMMA)))
@@ -213,8 +213,8 @@ namespace {
out << *p;
if (integer_digits > 3 && --integer_digits % 3 == 0) {
- if (commodity_t::time_colon_by_default ||
- (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON)))
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && (commodity_t::time_colon_by_default ||
+ (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON))))
out << ':';
else if (commodity_t::decimal_comma_by_default ||
(comm && comm->has_flags(COMMODITY_STYLE_DECIMAL_COMMA)))
@@ -744,7 +744,7 @@ void amount_t::in_place_unreduce()
}
if (shifted) {
- if ("h" == comm->symbol() && commodity_t::time_colon_by_default) {
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && commodity_t::time_colon_by_default) {
amount_t floored = tmp.floored();
amount_t precision = tmp - floored;
if (precision < 0.0) {
diff --git a/src/journal.cc b/src/journal.cc
index 3e2ecbea..7eeaabe8 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -151,7 +151,7 @@ account_t * journal_t::register_account(const string& name, post_t * post,
// the payee indicates an account that should be used.
if (result->name == _("Unknown")) {
foreach (account_mapping_t& value, payees_for_unknown_accounts) {
- if (value.first.match(post->xact->payee)) {
+ if (post && value.first.match(post->xact->payee)) {
result = value.second;
break;
}
diff --git a/test/input/drewr3.dat b/test/input/drewr3.dat
index e72ccd70..0e16466b 100644
--- a/test/input/drewr3.dat
+++ b/test/input/drewr3.dat
@@ -69,15 +69,4 @@ end tag
Income:Sales
end tag
-apply account Expenses
-bucket Assets:Checking
-2011/04/25 Tom's Used Cars
- Auto $ 5,500.00
- ; :nobudget:
-
-end account
-apply payee Amazon.com B.*k Store
-
-2011/04/27 Book Store
- Books $20.00