ledger-mode
ledger-mode copied to clipboard
[ledger-report] Delay report command expansion
Delays the expansion of the report command until execution time. This leaves the command in `ledger-report-cmd' unexpanded, which prevents the expanded version of the command from being edited / saved by the user.
Resolves #325
Good idea
Good idea
Thanks! Anything else needed? I'm not sure what's wrong with the CI, I tried rebasing on the latest changes from master but it looks like it still isn't working.
I think this PR breaks a couple things. For one thing, it causes the user to be re-prompted for any format specifiers that imply a prompt, such as %(account)
, every time the report is run (e.g., if they modify and save the journal file). Maybe the most robust way to address that issue would be to cache the expansion of each format specifier in some buffer-local alist or something, or maybe the expanded and unexpanded commands should both be saved so that the appropriate one can be used at each call site.