Hi, I am having issues running C-c C-a bound to ledger-add-transaction in a new file that has no transaction. The issue is that ledger xact executed from ledger-add-transaction returns no matches.
Relevant setup is the following:
main.journal with includes files and contains historical transactions
new.journal which I create and would like to fill with new transaction using C-c C-a functionality
I use ledger-mode in Doom Emacs through straight. I have set these variables for ledger-mode:
(setq ledger-init-file-name (expand-file-name "~/Documents/Finances/Private/main.journal")
ledger-accounts-file (expand-file-name "~/Documents/Finances/Private/meta.journal")
ledger-binary-path "/opt/homebrew/bin/ledger"
ledger-default-date-format ledger-iso-date-format
ledger-highlight-xact-under-point nil)
When I run C-c C-a with any date and uber, ledger-mode raises error:
Error: No accounts, and no past transaction matching 'uber'
However, in cli, ledger xact 2023-11-11 uber would give a match
2024-03-20 Uber
Expenses:Transport:Cabs EUR 53.36
Assets:Visa
I suspect the error occurs here in ledger-exec-ledger code. In fact, (ledger-master-file) resolves to the current buffer, new.journal, which is empty, and so as far as I see ledger xact is called via call-process-region with just contents of the new.journal file, i.e. with no historical transactions.
Am I missing anything to make C-c C-a work in the config, that is, to receive ledger-init-file-name or have ledger-master-file properly resolved? I tried setting it as a variable, but that leads to C-c C-a just failing with an error Ledger execution failed. Thanks :)
Hi, I am having issues running
C-c C-abound toledger-add-transactionin a new file that has no transaction. The issue is thatledger xactexecuted fromledger-add-transactionreturns no matches.Relevant setup is the following:
main.journalwith includes files and contains historical transactionsnew.journalwhich I create and would like to fill with new transaction usingC-c C-afunctionalityI use
ledger-modein Doom Emacs through straight. I have set these variables forledger-mode:When I run
C-c C-awith any date anduber, ledger-mode raises error:Error: No accounts, and no past transaction matching 'uber'However, in cli,
ledger xact 2023-11-11 uberwould give a matchI suspect the error occurs here in ledger-exec-ledger code. In fact,
(ledger-master-file)resolves to the current buffer,new.journal, which is empty, and so as far as I seeledger xactis called viacall-process-regionwith just contents of thenew.journalfile, i.e. with no historical transactions.Am I missing anything to make
C-c C-awork in the config, that is, to receiveledger-init-file-nameor haveledger-master-fileproperly resolved? I tried setting it as a variable, but that leads toC-c C-ajust failing with an errorLedger execution failed. Thanks :)