0

This keybind only works after I've opened a ledger file.

(spacemacs/set-leader-keys "jL"
  'ledger-report
  )

Thus I presume ledger-mode is required. Yet adding (require 'ledger-mode)

(spacemacs/set-leader-keys "jL"
  (require 'ledger-mode)
  'ledger-report
  )

returns

kbd: Wrong type argument: integer-or-marker-p, ledger-report

ledger-report: https://github.com/ledger/ledger-mode/blob/3495d1224ee73aa96c1d5bd131dc3a7f23d46336/ledger-report.el#L264

1 Answer 1

0

I don't know anything about spacemacs, but on general principles I would try this:

(spacemacs/set-leader-keys "jL"
  (lambda ()
     (interactive)
     (require 'ledger-mode)
     (call-interactively #'ledger-report)))
6
  • Thank you. Returns command-execute: Wrong type argument: commandp, (lambda nil (require 'ledger-mode) (ledger-report))
    – jjk
    Commented Mar 3, 2021 at 8:12
  • Fixed that - can you try again?
    – NickD
    Commented Mar 3, 2021 at 13:02
  • Thank you. Returns Wrong number of arguments: (2 . 2), 0
    – jjk
    Commented Mar 3, 2021 at 13:16
  • Eh - sorry. I'm proceeding blindly since I have neither spacemacs, nor ledger-report, but this "final" fix should work (famous last words!)
    – NickD
    Commented Mar 3, 2021 at 14:10
  • Asks Buffer modified, save it? (y or n). Hitting n, I'm able to select a report (hurray), though find-file-noselect: Wrong type argument: stringp, nil. Could it help providing the ledger file as an argument to your snippet?
    – jjk
    Commented Mar 3, 2021 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.