diff options
| author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-12-16 15:30:52 -0500 |
|---|---|---|
| committer | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-12-16 15:30:52 -0500 |
| commit | 0cfe08d45fb67f6ca9b876ed7c6de1803865f6a2 (patch) | |
| tree | b9cf74d6d32c893f35a1903c87c3a91332d75f99 | |
| parent | Make the mouse orange so I can see it (diff) | |
| download | mmosmacs-0cfe08d45fb67f6ca9b876ed7c6de1803865f6a2.tar.gz mmosmacs-0cfe08d45fb67f6ca9b876ed7c6de1803865f6a2.tar.bz2 mmosmacs-0cfe08d45fb67f6ca9b876ed7c6de1803865f6a2.zip | |
Add hledger
| -rw-r--r-- | init.el | 31 |
1 files changed, 31 insertions, 0 deletions
| @@ -1565,6 +1565,37 @@ delimit it to END. Start an unlimited search at | |||
| 1565 | (setq browse-url-browser-function 'browse-url-firefox) | 1565 | (setq browse-url-browser-function 'browse-url-firefox) |
| 1566 | 1566 | ||
| 1567 | 1567 | ||
| 1568 | ;; --------------------------------- | ||
| 1569 | ;; Finance | ||
| 1570 | ;; ------- | ||
| 1571 | ;; Emacs is perfect for plaintext | ||
| 1572 | ;; accounting. | ||
| 1573 | ;; --------------------------------- | ||
| 1574 | |||
| 1575 | (use-package hledger-mode | ||
| 1576 | :straight t | ||
| 1577 | :mode ("\\.journal\\'" "\\.hledger\\'") | ||
| 1578 | :config | ||
| 1579 | (setq hledger-jfile (expand-file-name "~/kb/self.fin.hledger") | ||
| 1580 | hledger-currency-string "USD")) | ||
| 1581 | |||
| 1582 | ;; Completion for accounts | ||
| 1583 | (defun mm/hledger-completion-accounts () | ||
| 1584 | (when-let ((bounds (and (boundp 'hledger-accounts-cache) | ||
| 1585 | (bounds-of-thing-at-point 'symbol)))) | ||
| 1586 | (list (car bounds) (point) hledger-accounts-cache))) | ||
| 1587 | (add-hook 'hledger-mode-hook 'mm/hledger-completion-accounts) | ||
| 1588 | |||
| 1589 | (use-package flycheck-hledger | ||
| 1590 | :straight t | ||
| 1591 | :after (flycheck | ||
| 1592 | hledger-mode) | ||
| 1593 | :demand t | ||
| 1594 | :config | ||
| 1595 | (setq flycheck-hledger-strict t) | ||
| 1596 | (dolist (check | ||
| 1597 | '("orderless" "payees" "accounts" "ordereddates" "recentassertions" "commodities" "uniqueleafnames")) | ||
| 1598 | (add-to-list 'flycheck-hledger-checks check))) | ||
| 1568 | 1599 | ||
| 1569 | 1600 | ||
| 1570 | ;; --------------------------------------------------------------------- | 1601 | ;; --------------------------------------------------------------------- |