bump: :lang beancount
beancount/beancount-mode@dbafe6a73d -> beancount/beancount-mode@ea8257881b Some of our local changes were upstreamed. Ref beancount/beancount-mode#17 Ref beancount/beancount-mode#18
This commit is contained in:
parent
d29a2fd865
commit
3d302c3304
2 changed files with 5 additions and 32 deletions
|
@ -2,37 +2,21 @@
|
||||||
|
|
||||||
(use-package! beancount
|
(use-package! beancount
|
||||||
:mode ("\\.beancount\\'" . beancount-mode)
|
:mode ("\\.beancount\\'" . beancount-mode)
|
||||||
|
:hook (beancount-mode . outline-minor-mode)
|
||||||
:init
|
:init
|
||||||
(add-hook 'beancount-mode-hook #'outline-minor-mode)
|
;; REVIEW Remove once domtronn/all-the-icons.el#272 is merged
|
||||||
|
|
||||||
(after! all-the-icons
|
(after! all-the-icons
|
||||||
(add-to-list 'all-the-icons-icon-alist
|
(add-to-list 'all-the-icons-icon-alist
|
||||||
'("\\.beancount\\'" all-the-icons-material "attach_money" :face all-the-icons-lblue))
|
'("\\.beancount\\'" all-the-icons-material "attach_money" :face all-the-icons-lblue))
|
||||||
(add-to-list 'all-the-icons-mode-icon-alist
|
(add-to-list 'all-the-icons-mode-icon-alist
|
||||||
'(beancount-mode all-the-icons-material "attach_money" :face all-the-icons-lblue)))
|
'(beancount-mode all-the-icons-material "attach_money" :face all-the-icons-lblue)))
|
||||||
|
|
||||||
;; TODO PR this upstream
|
|
||||||
(defadvice! +beancount--fix-faces-a ()
|
|
||||||
"`beancount-outline-face' returns org-level-N faces for beancount-mode's
|
|
||||||
font-lock keywords, but there is no guarantee `org' will be loaded when
|
|
||||||
beancount-mode is activated. If it is absent, you will see a flood of 'invalid
|
|
||||||
face' errors. Just use the outline-N faces to get around this.
|
|
||||||
|
|
||||||
This msut be advised *before* beancount-mode loads, because
|
|
||||||
`beancount-outline-face' is used at load time."
|
|
||||||
:override #'beancount-outline-face
|
|
||||||
(if outline-minor-mode
|
|
||||||
(let ((level (funcall outline-level)))
|
|
||||||
(if (integerp level)
|
|
||||||
(intern (format "outline-%d" level))))
|
|
||||||
nil))
|
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
(setq beancount-electric-currency t)
|
||||||
|
|
||||||
(when (featurep! +lsp)
|
(when (featurep! +lsp)
|
||||||
(add-hook 'beancount-mode-local-vars-hook #'lsp!))
|
(add-hook 'beancount-mode-local-vars-hook #'lsp!))
|
||||||
|
|
||||||
(setq beancount-electric-currency t)
|
|
||||||
|
|
||||||
(map! :map beancount-mode-map
|
(map! :map beancount-mode-map
|
||||||
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
||||||
#'beancount-outline-cycle
|
#'beancount-outline-cycle
|
||||||
|
@ -48,17 +32,6 @@ This msut be advised *before* beancount-mode loads, because
|
||||||
"p" #'beancount-insert-prices
|
"p" #'beancount-insert-prices
|
||||||
"d" #'beancount-insert-date))
|
"d" #'beancount-insert-date))
|
||||||
|
|
||||||
;; TODO PR this upstream?
|
|
||||||
(defun +beancount-electric-align-h ()
|
|
||||||
"Align amount in current line to `beancount-number-alignment-column'."
|
|
||||||
(when (and beancount-electric-currency (eq last-command-event ?\n))
|
|
||||||
(save-excursion
|
|
||||||
(forward-line -1)
|
|
||||||
(ignore-errors (beancount-align-to-previous-number)))))
|
|
||||||
(add-hook! 'beancount-mode-hook
|
|
||||||
(add-hook 'post-self-insert-hook #'+beancount-electric-align-h 'append t))
|
|
||||||
|
|
||||||
;; TODO PR this upstream
|
|
||||||
(defadvice! +beancount--fix-account-currency-a (account)
|
(defadvice! +beancount--fix-account-currency-a (account)
|
||||||
"Fixes `beancount-electric-currency', which could never find the currency
|
"Fixes `beancount-electric-currency', which could never find the currency
|
||||||
for the current account. Also allows it to fall back to the operating_currency."
|
for the current account. Also allows it to fall back to the operating_currency."
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
(package! beancount
|
(package! beancount
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "beancount/beancount-mode")
|
:repo "beancount/beancount-mode")
|
||||||
:pin "dbafe6a73d90c1f64d457b356b9dbb43499f70d5")
|
:pin "ea8257881b7e276e8d170d724e3b2e179f25cb77")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue