From 8667b181fcf5eb113c8a437467291ba30dd51ae5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 27 May 2025 20:41:57 +0200 Subject: [PATCH] feat(beancount): add account completion on budget directives --- modules/lang/beancount/autoload/advice.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/lang/beancount/autoload/advice.el b/modules/lang/beancount/autoload/advice.el index 963317c27..a22b9b460 100644 --- a/modules/lang/beancount/autoload/advice.el +++ b/modules/lang/beancount/autoload/advice.el @@ -149,7 +149,15 @@ will theirs, recursively)." ((beancount-looking-at (concat "^" beancount-date-regexp "\\s-+" (regexp-opt beancount-account-directive-names) - "\\s-+\\([" beancount-account-chars "]*\\)") 1 pos) + "\\s-+\\([" beancount-account-chars "]*\\)") + 1 pos) + (list (match-beginning 1) (match-end 1) (+beancount-account-completion-table))) + + ;; budget directive followed by an account + ((beancount-looking-at + (concat "^" beancount-date-regexp "\\s-+" + "custom\\s-+\"budget\"\\s-+\\([" beancount-account-chars "]*\\)") + 1 pos) (list (match-beginning 1) (match-end 1) (+beancount-account-completion-table))) ;; pad directive followed by two accounts