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

can we have the choice of hledger or ledger as the basis for the finance layer? #16237

Open
Abu-Daud opened this issue Jan 5, 2024 · 7 comments

Comments

@Abu-Daud
Copy link

Abu-Daud commented Jan 5, 2024

I have been trying to add a keybinding for the
hledger-balancesheet* command

I used the template on the spacemacs man page.
(spacemacs/declare-prefix-for-mode 'hledger-mode "mo" "custom") (spacemacs/set-leader-keys-for-major-mode 'hledger-mode "os" 'hledger-balancesheet*)

of course I wanted SPC-b-s but that is the scratch buffer. Anyway to make a minor mode
keybinding override a universal keybinding? I think mule does. Sorry if this is the wrong place. Probably should have tried stack overflow. Is there a system for suggesting layers if we come up with a good personal layer? I guess a pull request? Love your work, I've probably been with you about 4 years.

@bcc32
Copy link
Contributor

bcc32 commented Jan 5, 2024

spacemacs/set-leader-keys-for-major-mode puts keys under dotspacemacs-major-mode-leader-key (by default that's `).

So, the key binding you made with that snippet is:

, o s hledger-balancesheet*

As for layers, I think there is probably not too much in common that hledger and ledger would have (at least in terms of the Emacs configuration side). Perhaps it should just be a separate hledger layer (and arguably finance should be called ledger instead).

@Kuba-Jasinski
Copy link

Finance layer wraps ledger-mode.
As hledger-mode is also actively developed https://github.com/narendraj9/hledger-mode, we would be better off having just one Finance layer with option to choose the implementation (hledger is basically ledger's implementation written in Haskell with some minor differences and added features like csv import out of the box).

@bcc32
Copy link
Contributor

bcc32 commented Jan 24, 2024

Why force users to choose between having ledger-mode and hledger-mode installed (by having a mutually exclusive backend variable)? They are two slightly different file formats, with different implementations, and it seems reasonable for a user to want both to be configured at the same time.

(In particular, the file formats are not compatible---I have used ledger for a long time and was not able to use hledger out of the box, without significant modifications to my files that degraded the experience with ledger).

@Kuba-Jasinski
Copy link

It's not about forcing a choice, it's about giving choice and not excluding all of those who use hledger.

A normal use case is that someone uses either one or the other, a migration between ledger and hledger shouldn't be in scope of the layer.

Of course, it's easy to see what is actually installed on the user system and auto-configure the right backend. If both hledger and ledger are installed, then I agree that user would be forced to choice.

Just to emphasize my point again, what I imagine is not switching back and forth between them, but just a possibility for the users who would like to use hledger to set a hledger backend as a default .

@Abu-Daud
Copy link
Author

Abu-Daud commented Jan 30, 2024 via email

@bcc32
Copy link
Contributor

bcc32 commented Jan 30, 2024

There's no mail layer, but there are separate mu4e and notmuch and gnus layers (I don't think Spacemacs has any particular mutt support).

Of course, it's easy to see what is actually installed on the user system and auto-configure the right backend. If both hledger and ledger are installed, then I agree that user would be forced to choice.

hledger and ledger aren't just different backends, though, they also have different frontend Emacs packages. hledger-mode and ledger-mode do not have sufficiently similar sets of (Emacs) commands, as far as I'm aware. The user would not be able to easily switch between them, and there would be lots of incompatible key bindings.

It's not about forcing a choice, it's about giving choice and not excluding all of those who use hledger.

My suggestion was not to exclude those who use hledger, but rather to create a separate hledger layer, in the same way that the different mail clients each have their own layer. I guess I just don't see the benefit in combining the ledger and hledger support in the same layer. There doesn't seem to be any configuration, key bindings, or even documentation to share between them.

And if a user wants to switch between the two programs, they can always disable one layer and enable the other.

@davidpiano
Copy link

Are there other packages in the Finance layer right now? Or just Ledger?

I think if Finance is already a collection of packages, all carefully configured to work together, it wouldn't be so simple to mess around with. But if Finance currently just means Ledger, and if Ledger and Hledger both have enough users, I think having two different layers (with those names) probably makes more sense.

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

4 participants