Add support for live preview of ledger xact output while adding transactions#461
Add support for live preview of ledger xact output while adding transactions#461bcc32 wants to merge 8 commits into
Conversation
|
I've noticed at least one issue where the current version may sometimes swallow the user's input. I'll need to see if we're interacting with |
|
I've fixed the bad interactions with while-no-input by switching to |
|
... and, actually delete the temp file when we're done previewing. |
|
Currently blocked on #474. |
|
Unfortunately, it seems necessary to decrease the test coverage requirement due to this code all being effectively untestable, at least not robustly. On the other hand, I have been running this branch of ledger-mode myself for the last 6 months, and it works smoothly. |
Elisp convention is that most functions may change the match data and the caller is responsible for using save-match-data where needed.
This check should not run in temporary buffers that might be put into ledger-mode for fontification purposes only.
This is far faster, and means the buffer contents only need to be written once. It is still read multiple times by ledger, but hopefully from the page cache since the file is unchanged while the user adjusts their input.
Add a new customization,
ledger-add-transaction-idle-preview(enabled bydefault) to display a preview of the
ledger xactoutput that would be insertedin the ledger buffer as the user is inputting a transaction text in
ledger-add-transaction. (Also affectsledger-reconcile-add).ledger xact's exact output can be quite unpredictable, since it is hard toremember exactly what payees exist in a ledger file, and since it depends on the
most recent transactions that match the inputted strings. Displaying a live
preview that can inform the user how to make their input more specific is a much
nicer experience than "hit enter, see that the resulting transaction is wrong,
undo, press C-c C-a again, enter date again, then press M-p to bring up previous
input".
Close #456.