ledger-mode icon indicating copy to clipboard operation
ledger-mode copied to clipboard

[ledger-report] Delay report command expansion

Open kevinjfoley opened this issue 2 years ago • 3 comments

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

kevinjfoley avatar Jan 22 '22 14:01 kevinjfoley

Good idea

enderw88 avatar Jan 22 '22 15:01 enderw88

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.

kevinjfoley avatar Feb 04 '22 00:02 kevinjfoley

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.

bcc32 avatar Mar 17 '24 04:03 bcc32