Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind M-; to comment/uncomment an entire transaction #315

Open
presto8 opened this issue Oct 1, 2021 · 3 comments
Open

bind M-; to comment/uncomment an entire transaction #315

presto8 opened this issue Oct 1, 2021 · 3 comments

Comments

@presto8
Copy link

presto8 commented Oct 1, 2021

Thank you for writing ledger-mode, it has truly revolutionized my use of ledger!

One feature I would find nice is the ability to comment, uncomment, or toggle an entire transaction. Sometimes it is desirable to comment out a problematic transaction that is causing problems (for example, balance assertions). It would be nice to be able to simply hit M-; (or other hotkey) which would comment or uncomment the current transaction under the point.

I am more than happy to try adding this feature to the source and submitting a pull request, but wanted to check first if it is something that would be desirable.

Thank you!

@enderw88
Copy link
Member

enderw88 commented Oct 1, 2021 via email

@purcell
Copy link
Member

purcell commented Oct 2, 2021

Users might reasonably have different expectations of what the common keybinding M-; might operate on, e.g. current line vs. current transaction. I'd suggest it should be easy enough to write a command that will call comment-region/uncomment-region on the transaction at point, but that it should probably not be bound to any particular key by default.

@presto8
Copy link
Author

presto8 commented Oct 2, 2021

Thanks for the feedback so far. Yes, I see the point about redefining key bindings which may introduce surprises for users used to the current behavior. In looking at the code, it was extremely easy to duplicate the approach used to apply the font highlighting for the current transaction. I'll submit a pull request soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants