summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-05-06 09:04:04 -0700
committerCraig Earls <enderw88@gmail.com>2013-05-06 09:04:04 -0700
commit6b10e2e9096b42aa11be0b7aec0e8789974a277b (patch)
treeee9b4479f32bceaa3524fc25560e936a14cda7dd /lisp
parent3d531c08cde61ef1f1f0ce5c3c1a54d18bf3f019 (diff)
downloadfork-ledger-6b10e2e9096b42aa11be0b7aec0e8789974a277b.tar.gz
fork-ledger-6b10e2e9096b42aa11be0b7aec0e8789974a277b.tar.bz2
fork-ledger-6b10e2e9096b42aa11be0b7aec0e8789974a277b.zip
Ensure ledger-mode display balance can handle zero balance accounts.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/ldg-mode.el b/lisp/ldg-mode.el
index b6e4b7f1..c2e87d8e 100644
--- a/lisp/ldg-mode.el
+++ b/lisp/ldg-mode.el
@@ -63,7 +63,9 @@ And calculate the target-delta of the account being reconciled."
(buffer (current-buffer))
(balance (with-temp-buffer
(ledger-exec-ledger buffer (current-buffer) "cleared" account)
- (buffer-substring-no-properties (point-min) (1- (point-max))))))
+ (if (> (buffer-size) 0)
+ (buffer-substring-no-properties (point-min) (1- (point-max)))
+ (concat account " is empty.")))))
(when balance
(message balance))))