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
This commit is contained in:
parent
3ad9e39559
commit
fb8d540422
1 changed files with 1 additions and 19 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue