From 6b10e2e9096b42aa11be0b7aec0e8789974a277b Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Mon, 6 May 2013 09:04:04 -0700 Subject: Ensure ledger-mode display balance can handle zero balance accounts. --- lisp/ldg-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') 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)))) -- cgit v1.2.3