mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feat(beancount): add commodity/currency completion
Was supposed to be part ofd3e8ca8
. Now completes commodities/currencies from declared commidities, operating_currency options, or price directives. Currently only works in postings, but can be later extended to complete in price directives and operating_currency options. Amend:d3e8ca8d9d
This commit is contained in:
@ -182,7 +182,24 @@ will theirs, recursively)."
|
|||||||
(list (match-beginning 1) (match-end 1)
|
(list (match-beginning 1) (match-end 1)
|
||||||
(+beancount-completion-table
|
(+beancount-completion-table
|
||||||
(concat " \\(" (match-string-no-properties 2) "[" beancount-tag-chars "]+\\)")
|
(concat " \\(" (match-string-no-properties 2) "[" beancount-tag-chars "]+\\)")
|
||||||
1 (if (equal (match-string-no-properties 2) "#") 'tags 'links)))))))))
|
1 (if (equal (match-string-no-properties 2) "#") 'tags 'links))))
|
||||||
|
|
||||||
|
((progn
|
||||||
|
(goto-char pos)
|
||||||
|
(and (looking-back (concat "\\s-" beancount-number-regexp
|
||||||
|
"\\s-+\\(\\(?:" beancount-currency-regexp
|
||||||
|
"\\)?\\)")
|
||||||
|
(pos-bol))
|
||||||
|
(>= pos (match-beginning 1))
|
||||||
|
(<= pos (match-end 1))))
|
||||||
|
(list (match-beginning 1) (match-end 1)
|
||||||
|
(+beancount-completion-table
|
||||||
|
(concat "^\\(?:" beancount-date-regexp
|
||||||
|
"\\s-+commodity\\s-+\\|"
|
||||||
|
beancount-date-regexp "\\s-+price\\s-+\\|"
|
||||||
|
"option\\s-+\"operating_currency\"\\s-+\""
|
||||||
|
"\\)\\(" beancount-currency-regexp "\\)")
|
||||||
|
1 'commodities))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +beancount-get-account-names-a (&rest _)
|
(defun +beancount-get-account-names-a (&rest _)
|
||||||
|
Reference in New Issue
Block a user