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.
Even though
ledger-occur
can be used to narrow down a buffer based on a regex, I find it useful to have, in addiction, folding of transaction records. This PR implements the latter. For example, folding a transactionresults in
Two
interactive
functions are exposed:ledger-mode-transaction-toggle-folding
: hide/show transaction under pointledger-mode-folding-toggle-transactions
: hide/show all transactions in the bufferledger-occur
and transaction folding can be used to complement each other.The buffer-local variable
ledger-mode-toggle-invisible-transactions
can be used to enable/disable folding of invisible transactions (i.e., transactions whose overlay has been set usingledger-occur
).Transaction blocks are detected using the same approach as in
ledger-highlight-xact-under-point
(probably some code refactoring should be done).The transaction folding functionality has been added to the
ledger-occur.el
file even though probably a new file should be used (my aim was to do the least amount modifications). The same thing applies to the unit tests.The function
ledger-occur-make-invisible-overlay
has been modified by adding(overlay-put ovl 'display "")
in order to avoid undesired trailing ellipsis when usingledger-occur
together with transaction folding.Overlay of type
'code
has been used in order for incremental search to temporarily open folded blocks.