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

ledger-complete-in-steps set to t causes problem with company-mode #443

Open
drdv opened this issue Jan 7, 2025 · 0 comments
Open

ledger-complete-in-steps set to t causes problem with company-mode #443

drdv opened this issue Jan 7, 2025 · 0 comments

Comments

@drdv
Copy link

drdv commented Jan 7, 2025

Consider the following transaction:

; 
2025/01/06 * Cinema
    Expenses:Cinema                           €18.00
    Cash

With point after the initial comment, pressing space gives

Company: backend company-capf error "Not on a posting line" with args (candidates ;  )

This is when using:

(add-hook 'ledger-mode-hook
          (lambda ()
            (setq-local tab-always-indent 'complete)
            (setq-local completion-cycle-threshold t)
            (setq-local ledger-complete-in-steps t)))

The problem comes from (setq-local ledger-complete-in-steps t), which activates the use of ledger-complete-account-next-steps where we have:

(unless (eq 'posting (ledger-thing-at-point))
  (error "Not on a posting line"))

My guess is that using company-mode together with ledger-complete-in-steps set to t is not intended, but there are valid use cases.

If I simply remove the (error "Not on a posting line") things seem to work fine (the tests pass).

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

1 participant