GNU bug report logs - #60972
30.0.50; [PATCH]: Add html-ts-mode

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Fri, 20 Jan 2023 20:12:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: Theodor Thornhill <theo <at> thornhill.no>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60972 in the body.
You can then email your comments to 60972 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to eliz <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Fri, 20 Jan 2023 20:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Theodor Thornhill <theo <at> thornhill.no>:
New bug report received and forwarded. Copy sent to eliz <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Fri, 20 Jan 2023 20:12:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH]: Add html-ts-mode
Date: Fri, 20 Jan 2023 21:10:56 +0100
[Message part 1 (text/plain, inline)]
Hi!

Attached is a ts-mode for HTML support.

@Eli, is this ok for emacs-29, or should it go to master?  If ok for 29
I'll remove the sentence/sexp-related stuff and commit that later on
master.  Otherwise I'll just add everything to master.

Theo

[0001-Add-html-ts-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Fri, 20 Jan 2023 20:30:01 GMT) Full text and rfc822 format available.

Message #8 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Fri, 20 Jan 2023 22:28:55 +0200
> Cc: eliz <at> gnu.org
> From: Theodor Thornhill <theo <at> thornhill.no>
> Date: Fri, 20 Jan 2023 21:10:56 +0100
> 
> Attached is a ts-mode for HTML support.

Thanks.

> @Eli, is this ok for emacs-29, or should it go to master?  If ok for 29
> I'll remove the sentence/sexp-related stuff and commit that later on
> master.  Otherwise I'll just add everything to master.

Please install on master.

But please also add setting of auto-mode-alist, similarly to what we
do in other *-ts-mode's.  And a NEWS entry.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Fri, 20 Jan 2023 20:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Fri, 20 Jan 2023 21:40:49 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: eliz <at> gnu.org
>> From: Theodor Thornhill <theo <at> thornhill.no>
>> Date: Fri, 20 Jan 2023 21:10:56 +0100
>> 
>> Attached is a ts-mode for HTML support.
>
> Thanks.
>
>> @Eli, is this ok for emacs-29, or should it go to master?  If ok for 29
>> I'll remove the sentence/sexp-related stuff and commit that later on
>> master.  Otherwise I'll just add everything to master.
>
> Please install on master.

Will do :)

>
> But please also add setting of auto-mode-alist, similarly to what we
> do in other *-ts-mode's.  And a NEWS entry.

Will do!

Theo




bug marked as fixed in version 30.1, send any further explanations to 60972 <at> debbugs.gnu.org and Theodor Thornhill <theo <at> thornhill.no> Request was from Theodor Thornhill <theo <at> thornhill.no> to control <at> debbugs.gnu.org. (Fri, 20 Jan 2023 21:00:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Sat, 21 Jan 2023 18:32:01 GMT) Full text and rfc822 format available.

Message #16 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Sat, 21 Jan 2023 19:50:18 +0200
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Sat, 21 Jan 2023 19:09:02 GMT) Full text and rfc822 format available.

Message #19 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Juri Linkov <juri <at> linkov.net>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Sat, 21 Jan 2023 20:08:55 +0100
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> 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

[0001-Use-element-as-a-sentence-in-html-ts-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Sun, 22 Jan 2023 17:14:01 GMT) Full text and rfc822 format available.

Message #22 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Sun, 22 Jan 2023 19:02:15 +0200
>> I expected that one of them is moving over the HTML tags
>> and another over HTML elements.
>
> Is this more like you were thinking?
>
> -  (setq-local treesit-sentence-type-regexp
> -              (regexp-opt '("start_tag"
> -                            "self_closing_tag"
> -                            "end_tag")))
> +  (setq-local treesit-sentence-type-regexp "element")

According to the discussion in bug#60894 I expected it to be
rather like this:

  (setq-local treesit-sentence-type-regexp "tag")
  (setq-local treesit-sexp-type-regexp
              (regexp-opt '("element"
                            "text"
                            "attribute"
                            "value")))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60972; Package emacs. (Sun, 22 Jan 2023 18:21:01 GMT) Full text and rfc822 format available.

Message #25 received at 60972 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Juri Linkov <juri <at> linkov.net>
Cc: 60972 <at> debbugs.gnu.org
Subject: Re: bug#60972: 30.0.50; [PATCH]: Add html-ts-mode
Date: Sun, 22 Jan 2023 19:20:01 +0100
Juri Linkov <juri <at> linkov.net> writes:

>>> I expected that one of them is moving over the HTML tags
>>> and another over HTML elements.
>>
>> Is this more like you were thinking?
>>
>> -  (setq-local treesit-sentence-type-regexp
>> -              (regexp-opt '("start_tag"
>> -                            "self_closing_tag"
>> -                            "end_tag")))
>> +  (setq-local treesit-sentence-type-regexp "element")
>
> According to the discussion in bug#60894 I expected it to be
> rather like this:
>
>   (setq-local treesit-sentence-type-regexp "tag")
>   (setq-local treesit-sexp-type-regexp
>               (regexp-opt '("element"
>                             "text"
>                             "attribute"
>                             "value")))


Ok, let's try that :-)

Theo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Feb 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.