From fb8d5404229cd5fd6b67d7b498b0f05b12cb509f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 30 Sep 2021 14:51:42 +0200 Subject: [PATCH] refactor!(beancount): disable explicit currency BREAKING CHANGE: If `beancount-electric-currency` is non-nil, the currency is appended to transactions, falling back to the ledger's "operating_currency" option, even in cases where a currency was not explicitly needed (e.g. only one currency specified for an account). After receiving input from beancount-mode's author, I reconsidered its utility and decided to remove it. Ref beancount/beancount-mode#19 --- modules/lang/beancount/config.el | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/modules/lang/beancount/config.el b/modules/lang/beancount/config.el index afa549f4b..a72474f5d 100644 --- a/modules/lang/beancount/config.el +++ b/modules/lang/beancount/config.el @@ -30,22 +30,4 @@ (:prefix ("i" . "insert") "a" #'beancount-insert-account "p" #'beancount-insert-prices - "d" #'beancount-insert-date)) - - (defadvice! +beancount--fix-account-currency-a (account) - "Fixes `beancount-electric-currency', which could never find the currency -for the current account. Also allows it to fall back to the operating_currency." - :override #'beancount--account-currency - (save-excursion - (goto-char (point-min)) - (when (or (re-search-forward - (concat "^" beancount-date-regexp " +open" - "\\s-+" (regexp-quote account) - "\\s-+\\(" beancount-currency-regexp "\\)\\>") - nil t) - (re-search-forward - (concat "^option\\s-+\"operating_currency\"\\s-+\"\\(" - beancount-currency-regexp - "\\)\"") - nil t)) - (match-string-no-properties 1))))) + "d" #'beancount-insert-date)))