Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/bin9bmAxov3pv.bin below:
From 89eaff15030bf627b39a4e98801103ab622cfac6 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 22 Nov 2022 12:24:31 -0800 Subject: [PATCH] Enable elixir font-lock rules in heex-mode --- heex-mode.el | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/heex-mode.el b/heex-mode.el index a32b9ee..7425ed8 100644 --- a/heex-mode.el +++ b/heex-mode.el @@ -18,6 +18,7 @@ ;; Code: +(require 'elixir-mode) (require 'treesit) (eval-when-compile @@ -257,11 +258,32 @@ (cond ((treesit-ready-p 'heex) - (progn (if (treesit-ready-p 'elixir) - ;; (setq-local treesit-range-settings - ;; heex--treesit-range-rules) - ) - (treesit-major-mode-setup))) + (when (treesit-ready-p 'elixir) + (setq-local treesit-range-settings heex--treesit-range-rules) + (setq-local treesit-font-lock-settings + (append heex--treesit-font-lock-settings + ;; Add elixir font-lock rules, rename each + ;; rulesâ feature name to be + ;; elixir- . + (mapcar + (lambda (rule) + (list (nth 0 rule) + (nth 1 rule) + (intern (format "elixir-%s" + (nth 2 rule))) + (nth 3 rule))) + elixir--treesit-font-lock-settings))) + ;; Add elixir features to the feature list. + (setq-local treesit-font-lock-feature-list + '(( doctype comment elixir-comment elixir-string ) + ( bracket tag attribute keyword string + elixir-keyword elixir-unary-operator elixir-operator + elixir-doc) + ( component + elixir-call elixir-constant) + ( elixir-sigil elixir-string-escape) + ( elixir-string-interpolation)))) + (treesit-major-mode-setup)) (t (message "Tree-sitter for Heex isn't available"))) -- 2.33.1
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4