GNU bug report logs - #61996
30.0.50; Submitting elixir-ts-mode and heex-ts-mode

Previous Next

Package: emacs;

Reported by: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>

Date: Mon, 6 Mar 2023 07:27:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>
Cc: 61996 <at> debbugs.gnu.org, theo <at> thornhill.no, casouri <at> gmail.com
Subject: Re: bug#61996: 30.0.50; Submitting elixir-ts-mode and heex-ts-mode
Date: Mon, 06 Mar 2023 20:36:54 +0200
> From: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>
> Cc: 61996 <at> debbugs.gnu.org, casouri <at> gmail.com, theo <at> thornhill.no
> Date: Mon, 06 Mar 2023 19:23:39 +0200
> 
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks.  Please state in the comments to each mode with which
> > grammars is it compatible, so that users could know from which URL
> > to download the required grammar libraries.  The heex-ts-mode
> > mentions that, but elixir-ts-mode doesn't, AFAICT.
> 
> Will this make sense in the Commentary section: "The
> tree-sitter grammar for Elixir can be downloaded from 
> https://github.com/phoenixframework/tree-sitter-heex."

Yes, that's good enough.  But please change the wording to say that
this is the grammar with which the package was tested, not just that
it "can be downloaded" from that place.  That way, users will know
that if they use a different grammar for the same language, they might
be on their own.

> >> +(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?

> 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.




This bug report was last modified 2 years and 74 days ago.

Previous Next


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