diff --git a/etc/NEWS b/etc/NEWS index dcb9c1c51e4..190da3e3797 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1392,14 +1392,11 @@ language symbol. For example, 'cpp' is translated to "C++". A new variable 'treesit-language-display-name-alist' holds the translations of language symbols where that translation is not trivial. -+++ -++++ *** New function 'treesit-merge-font-lock-feature-list'. This function merges two tree-sitter font-lock feature lists. Returns a new font-lock feature list with no duplicates in the same level. It can be used to merge font-lock feature lists in a multi-language major mode. -+++ *** New function 'treesit-replace-font-lock-feature-settings'. Given two tree-sitter font-lock settings, it replaces the feature in the second font-lock settings with the same feature in the first font-lock @@ -1407,7 +1404,6 @@ settings. In a multi-language major mode it is sometimes necessary to replace features from one of the major modes, with others that are better suited to the new multilingual context. -+++ *** New function 'treesit-modify-indent-rules'. Given two tree-sitter indent rules, it replaces, adds, or prepends the new rules to the old ones, then returns the new tree-sitter indent diff --git a/lisp/textmodes/mhtml-ts-mode.el b/lisp/textmodes/mhtml-ts-mode.el index 9be1a14c257..bdb016d67dc 100644 --- a/lisp/textmodes/mhtml-ts-mode.el +++ b/lisp/textmodes/mhtml-ts-mode.el @@ -1,6 +1,6 @@ ;;; mhtml-ts-mode.el --- Major mode for HTML using tree-sitter -*- lexical-binding: t; -*- -;; Copyright (C) 2024 Free Software Foundation, Inc. +;; Copyright (C) 2024-2025 Free Software Foundation, Inc. ;; Author: Vincenzo Pupillo ;; Maintainer: Vincenzo Pupillo @@ -248,7 +248,7 @@ For NODE, OVERRIDE, START, and END, see `treesit-font-lock-rules'." 'font-lock-variable-name-face override start end))) -;; Embedded languages ​​should be indented according to the language +;; Embedded languages should be indented according to the language ;; that embeds them. ;; This function signature complies with `treesit-simple-indent-rules' ;; ANCHOR. @@ -440,6 +440,7 @@ Calls REPORT-FN directly. Requires tidy." (process-send-region mhtml-ts-mode--flymake-process (point-min) (point-max)) (process-send-eof mhtml-ts-mode--flymake-process))))) +;;;###autoload (define-derived-mode mhtml-ts-mode html-ts-mode '("HTML+" (:eval (let ((lang (mhtml-ts-mode--language-at-point (point)))) (cond ((eq lang 'html) "") diff --git a/lisp/treesit.el b/lisp/treesit.el index 30fe3798bd9..cd95524fdf4 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1322,7 +1322,7 @@ and leave settings for other languages unchanged." Returns a new font lock feature list with no duplicates in the same level. It can be used to merge font lock feature lists in a multi-language major mode. FEATURES-LIST-1 and FEATURES-LIST-2 are list of lists of feature symbols." - (let ((result nil) + (let ((result nil) (features-1 (car features-list-1)) (features-2 (car features-list-2))) (while (or features-1 features-2) @@ -2551,7 +2551,7 @@ NEW-RULES replace rule in RULES which the same anchor." (error "No rules for language %s in RULES" lang)) ((not (alist-get lang new-rules)) (error "No rules for language %s in NEW-RULES" lang)) - (t (let* ((copy-of-rules (copy-tree js--treesit-indent-rules)) + (t (let* ((copy-of-rules (copy-tree rules)) (lang-rules (alist-get lang copy-of-rules)) (lang-new-rules (alist-get lang new-rules))) (cond