]> git.eshelyaron.com Git - emacs.git/commitdiff
; Small fixes for the recently added 'mhtml-ts-mode'
authorJuri Linkov <juri@linkov.net>
Mon, 17 Feb 2025 17:40:20 +0000 (19:40 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 18 Feb 2025 08:53:13 +0000 (09:53 +0100)
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode): Add autoload cookie.

* lisp/treesit.el (treesit-modify-indent-rules): Use 'rules'
instead of 'js--treesit-indent-rules'.

(cherry picked from commit 1a8493f0a5fcd45c7e992dbf42cfbb0346edcaff)

lisp/textmodes/mhtml-ts-mode.el
lisp/treesit.el

index 9be1a14c25784b8d8baf52e0cfe23c011177e465..bdb016d67dccb1fe4b69410adc1f0c39e05ff6ec 100644 (file)
@@ -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 <v.pupillo@gmail.com>
 ;; Maintainer: Vincenzo Pupillo <v.pupillo@gmail.com>
@@ -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) "")
index f121b15141a88d705c1942df0f0a6daeac21987e..f6f9a9952b74ff4a0fef48e62466f3920b0ebfb4 100644 (file)
@@ -1318,7 +1318,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)
@@ -2543,7 +2543,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