Add support for live preview of ledger xact output while adding transactions#461
Open
bcc32 wants to merge 8 commits intoledger:masterfrom
Open
Add support for live preview of ledger xact output while adding transactions#461bcc32 wants to merge 8 commits intoledger:masterfrom
bcc32 wants to merge 8 commits intoledger:masterfrom
Conversation
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.
Collaborator
Author
|
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 |
Collaborator
Author
|
I've fixed the bad interactions with while-no-input by switching to |
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.
Collaborator
Author
|
... and, actually delete the temp file when we're done previewing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.