From 8406c1ff22b95bd0f816de4a0223fa3ce3c82568 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 24 May 2025 16:39:27 +0200 Subject: [PATCH] feat(beancount): highlight custom directives Doesn't seem to be done by beancount-mode, so... --- modules/lang/beancount/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/lang/beancount/config.el b/modules/lang/beancount/config.el index c72ff6e07..c3e77e7c7 100644 --- a/modules/lang/beancount/config.el +++ b/modules/lang/beancount/config.el @@ -34,6 +34,14 @@ behavior).") (setq beancount-electric-currency t) + ;; Fontify custom directives. + ;; REVIEW: PR this upstream. + (add-to-list 'beancount-font-lock-keywords + `(,(concat "^\\(" beancount-date-regexp "\\) +" + "\\(" (regexp-opt '("custom")) "\\) +") + (1 'beancount-date) + (2 'beancount-directive))) + (when (modulep! +lsp) (add-hook 'beancount-mode-local-vars-hook #'lsp! 'append))