Subject: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode

From: Theodor Thornhill <[email-masked]>
Date: Sat, 21 Jan 2023 20:08:55 +0100

Juri Linkov <[email-masked]> writes:

>> Attached is a ts-mode for HTML support.
>
> Thanks.  Could you please clarify the difference between
> forward-sentence and forward-sexp in html-ts-mode.
> I expected that one of them is moving over the HTML tags
> and another over HTML elements.

Is this more like you were thinking?

Theo

>From a79b4f280c22e937a24f077f0aa7f5ea18a92a0c Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <[email-masked]>
Date: Sat, 21 Jan 2023 20:05:52 +0100
Subject: [PATCH] Use element as a sentence in html-ts-mode

* lisp/textmodes/html-ts-mode.el (html-ts-mode): Tweak the regexp.
---
 lisp/textmodes/html-ts-mode.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el
index 7e4360747a..a2d85bff7d 100644
--- a/lisp/textmodes/html-ts-mode.el
+++ b/lisp/textmodes/html-ts-mode.el
@@ -106,10 +106,7 @@ html-ts-mode
 
   (setq-local treesit-defun-name-function #'html-ts-mode--defun-name)
 
-  (setq-local treesit-sentence-type-regexp
-              (regexp-opt '("start_tag"
-                            "self_closing_tag"
-                            "end_tag")))
+  (setq-local treesit-sentence-type-regexp "element")
 
   (setq-local treesit-sexp-type-regexp
               (regexp-opt '("tag"
-- 
2.34.1