From c45c8cee355a22bfa9c7eb87f05537aa7458288a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 7 Jul 2024 05:11:10 -0400 Subject: [PATCH] tweak(beancount): +beancount/balance w/ prefix arg Without the prefix arg, it will only display the balance of Assets and Liabilities. With it, the balance of all accounts will be shown. --- modules/lang/beancount/autoload.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/lang/beancount/autoload.el b/modules/lang/beancount/autoload.el index 599620ca3..5b2729f67 100644 --- a/modules/lang/beancount/autoload.el +++ b/modules/lang/beancount/autoload.el @@ -120,11 +120,13 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order." (defvar compilation-read-command) ;;;###autoload -(defun +beancount/balance () +(defun +beancount/balance (&optional all-accounts) "Display a balance report with bean-report (bean-report bal)." - (interactive) - (let (compilation-read-command) - (beancount--run "bean-report" buffer-file-name "bal"))) + (interactive "P") + (let ((args (unless all-accounts '("-e" "Assets|Liabilities"))) + compilation-read-command + current-prefix-arg) + (apply #'beancount--run "bean-report" buffer-file-name "balances" args))) ;;;###autoload (defun +beancount/clone-transaction ()