bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61996: 30.0.50; Submitting elixir-ts-mode and heex-ts-mode


From: Wilhelm Kirschbaum
Subject: bug#61996: 30.0.50; Submitting elixir-ts-mode and heex-ts-mode
Date: Mon, 06 Mar 2023 21:24:11 +0200
User-agent: mu4e 1.9.3; emacs 30.0.50


Eli Zaretskii <eliz@gnu.org> writes:

>> +(if (treesit-ready-p 'elixir)
>> +    (progn
>> + (add-to-list 'auto-mode-alist '("\\.elixir\\'" . >> elixir-ts-mode)) >> + (add-to-list 'auto-mode-alist '("\\.ex\\'" . >> elixir-ts-mode)) >> + (add-to-list 'auto-mode-alist '("\\.exs\\'" . >> elixir-ts-mode)) >> + (add-to-list 'auto-mode-alist '("mix\\.lock" . >> elixir-ts-mode))))
>> +
>> +(if (treesit-ready-p 'heex)
>> + (add-to-list 'auto-mode-alist '("\\.[hl]?eex\\'" . >> heex-ts-mode)))
>                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Copy/paste error, I presume?
>
> Thanks.

This was intentional, but perhaps a bad choice and lack of understanding of how the -ts-modes should be activated. elixir-ts-mode should ideally load the HEEx grammar, but should also technically be able to function without.

Sorry, I don't understand: are you saying that the HEEx grammar
supports both modes?  I thought you need a separate grammar for
Elixir. I also thought the Elixir files have different file-name
extensions than the HEEx files.  Was I mistaken?


No, you were not mistaken. I corrected this with the new patches.

The Elixir language author mentioned that heex can practically be seen as part of Elixir, so requiring heex-ts-mode makes sense, sort
of.

heex-ts-mode and elixir-ts-mode used to be in one file, but I was
asked to split them for the MELPA submission. The HEEx language
should actually also be able to embed Elixir, but this is not
essential and we can do without imo. Would it make sense have them
in one file?

Maybe.  Otherwise, if they have a lot in common, you'd need to
duplicate stuff or have a common file used by both.  Your call.

For this release it will be good just to get the basics to work as is, but good to know it is an option. Attached are the updated patches. Is this the right format, or should I
add them inline rather?

Attachment: 0001-Add-heex-ts-mode.patch
Description: Add heex-ts-mode

Attachment: 0002-Add-elixir-ts-mode.patch
Description: Add elixir-ts-mode


reply via email to

[Prev in Thread] Current Thread [Next in Thread]