unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 60972@debbugs.gnu.org
Subject: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Sat, 21 Jan 2023 20:08:55 +0100	[thread overview]
Message-ID: <87tu0j7liw.fsf@thornhill.no> (raw)
In-Reply-To: <86o7qrg36l.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Juri Linkov <juri@linkov.net> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-element-as-a-sentence-in-html-ts-mode.patch --]
[-- Type: text/x-patch, Size: 990 bytes --]

From a79b4f280c22e937a24f077f0aa7f5ea18a92a0c Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
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


  reply	other threads:[~2023-01-21 19:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 20:10 bug#60972: 30.0.50; [PATCH]: Add html-ts-mode Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-20 20:28 ` Eli Zaretskii
2023-01-20 20:40   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 17:50 ` Juri Linkov
2023-01-21 19:08   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-01-22 17:02     ` Juri Linkov
2023-01-22 18:20       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu0j7liw.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60972@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).