<commit_before>;;; lang/ledger/config.el -*- lexical-binding: t; -*-

(use-package! ledger-mode
  :defer t
  :init
  (setq ledger-clear-whole-transactions 1
        ledger-mode-should-check-version nil)

  :config
  (setq ledger-binary-path
        (if (executable-find "hledger")
            "hledger"
          "ledger"))

  (defadvice! +ledger--check-version-a (orig-fn)
    "Fail gracefully if ledger binary isn't available."
    :around #'ledger-check-version
    (if (executable-find ledger-binary-path)
        (funcall orig-fn)
      (message "Couldn't find '%s' executable" ledger-binary-path)))

  (map! :map ledger-report-mode-map
        "C-c C-c" #'ledger-report-edit-report
        "C-c C-r" #'ledger-report-redo
        "C-c C-s" #'ledger-report-save<commit_msg>Set company-capf as backend for ledger-mode.<commit_after>;;; lang/ledger/config.el -*- lexical-binding: t; -*-

(use-package! ledger-mode
  :defer t
  :init
  (setq ledger-clear-whole-transactions 1
        ledger-mode-should-check-version nil)

  :config
  (setq ledger-binary-path
        (if (executable-find "hledger")
            "hledger"
          "ledger"))

  (set-company-backend! 'ledger-mode 'company-capf)

  (defadvice! +ledger--check-version-a (orig-fn)
    "Fail gracefully if ledger binary isn't available."
    :around #'ledger-check-version
    (if (executable-find ledger-binary-path)
        (funcall orig-fn)
      (message "Couldn't find '%s' executable" ledger-binary-path)))

  (map! :map ledger-report-mode-map
        "C-c C-c" #'ledger-report-edit-report
        "C-c C-r" #'ledger-report-redo
        "C-c C-s" #'ledger-report-save
{'fraction_non_alphanumeric': 0.15384615384615385, 'fraction_numerical': 0.001221001221001221, 'mean_word_length': 2.6666666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2463414', 'n_tokens_mistral': 615, 'n_tokens_neox': 597, 'n_words': 121}