From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew De Angelis Newsgroups: gmane.emacs.devel Subject: Re: treesit: how to get it to parse multiple languages Date: Wed, 4 Dec 2024 23:23:06 -0500 Message-ID: References: <87r06u4i91.fsf@mail.linkov.net> <2121596.YKUYFuaPT4@fedora> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000eff34206287e417b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20897"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov , Yuan Fu , emacs-devel@gnu.org, Peter Oliver To: Vincenzo Pupillo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 05 05:24:18 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tJ3PV-0005Gt-TP for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Dec 2024 05:24:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJ3Od-0001lr-Hl; Wed, 04 Dec 2024 23:23:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJ3Ob-0001lg-U0 for emacs-devel@gnu.org; Wed, 04 Dec 2024 23:23:22 -0500 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJ3OZ-0005a6-Tj for emacs-devel@gnu.org; Wed, 04 Dec 2024 23:23:21 -0500 Original-Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a9e8522445dso82643966b.1 for ; Wed, 04 Dec 2024 20:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733372598; x=1733977398; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9d520Aj2oa9VHWlwoyEEGEoaxsUZPRkaqjAoE8Fxl7s=; b=lVrZkUGRllbPSELJjZTrWqQmZQ6BcuI/cXhVFKCQVfBuCisKM+iAihhKYXBzJelLat J2p3c+7sO4eGbNRIzDjnzWxyBy6VsV3OQHVu3G5yoPPYhEZQECVhNRD3pJyXGaq4SDHb KmABfV3axBD6ZyRJemptB1uBabhybpE08haE4w5aG+WpMC2cHZEMJiADn7riIO276SMq po/DFmBtkpGwHLnLrIaU58rUiVC00XV9MuWvPPfa9Q5/7QYtfDcUniVy3qgjW3nUsOZF AEeePHCfmZqF5H0VkEnHahML0hAJiaEA0CL+/4m2P3t53ZHMmeWuEPIjtDgHvvGK3Fih SKdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733372598; x=1733977398; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9d520Aj2oa9VHWlwoyEEGEoaxsUZPRkaqjAoE8Fxl7s=; b=M3n7311D2u4/1zKy4ApfHJd0gPjM5drAVIfcVcep7lo4WPCF1gqMsMdv56Ndz4Mb5i tv/8N0peDHpSVklwV0HB61/33A4J+89UJ3fxX3jh/TEsFC8gyLKHwtw+TCdydW44Xbv3 JCCwy5wzclhT5cnCv0ZR/Wrp1GbMxBUg2QFZLcJJxFDuw/w6rt1/EJ4ZHGZjEUdmD5Rv 9kFLxF2BNobsfSnBshBTlTTGnJea0HbyFegt6ytKZQgkgT0GO4el0TAZeYFoa5Vchhfv /psyAW5Dj+IxjpCQsF/59ZM+XaQFtDVd6vJuzVjpKOUer6x0zNVkWCuDGxAzrDTq1sKr niOA== X-Forwarded-Encrypted: i=1; AJvYcCU76//asf9mljlB1TVDy1IntIo6mk8aJTY5uJHwjaBWaVjuTvEx63xV+//IKg69gjsPj7vIIGmfoBEsDg==@gnu.org X-Gm-Message-State: AOJu0YxxWWIazW0gqAfiIHs08IcErh5nqmmAe0X0CwSKQ5VR7OTJynlT KVwXS3+HZpSult8Ed2jql+br/MdYImTDfRvZADuJuti9gWQEgWzcLnt3uEYZEu2iKCqxEk/zXT5 NH3kn3yl/EXFTjLfaLZAQls9wZi4= X-Gm-Gg: ASbGnctcAbsqoTTjWLTzPc/z0OKY+6p0lA+iuAs4Stqlt8i5N9TN5giPuCLsqu633ET NqK/752dPphPxxYAvbXLQFd01uirOtPvXiTGjYfMae0zEn2U9kXZsMlZkwKhBA8qXZA== X-Google-Smtp-Source: AGHT+IG0dBmgMwht8bFgONPAzUN82YFwfBArPD7BdRBAUA5k806ATDcumOUKKbBbOVFqhoxnpd905fZMAAdESxnPQOc= X-Received: by 2002:a17:906:3090:b0:aa5:1757:bdd3 with SMTP id a640c23a62f3a-aa5f7d1fb8dmr784418466b.20.1733372597495; Wed, 04 Dec 2024 20:23:17 -0800 (PST) In-Reply-To: <2121596.YKUYFuaPT4@fedora> Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=bobodeangelis@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326056 Archived-At: --000000000000eff34206287e417b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks a lot Vincenzo! Excited to take a deeper look at it. By the way, I did start working on a possible python-notebook mode, with planned multi-language (markdown and python) support: https://github.com/andrewdea/enb Progress has been a bit slow due to other commitments: so far I only have a rudimentary parser that 'renders' the JSON into a markdown/python buffer. But I'm hoping to add more functionalities over the coming months. Thank you all again for all the help on this. On Fri, Nov 29, 2024 at 5:13=E2=80=AFPM Vincenzo Pupillo wrote: > In data venerd=C3=AC 29 novembre 2024 08:37:28 Ora standard dell=E2=80=99= Europa > centrale, > Yuan Fu ha scritto: > > > On Nov 28, 2024, at 11:22=E2=80=AFPM, Juri Linkov w= rote: > > >>> That=E2=80=99s awesome! > > >> > > >> It's pretty much ready, the only thing I'm missing is the ability to > > >> create an Imenu with symbols from both HTML and the other embedded > > >> languages. I have tried a few approaches but it seems that it can on= ly > > >> be done for the main language. Is there any way to do something like > > >> that? > > > > > > Imenu is a small detail that could be figured out after pushing your > main > > > work. > > Oops, sorry for the late reply. Lets=E2=80=99 do this: I=E2=80=99ll ext= end > > treesit-simple-imenu to support multi-language. Once we have that you c= an > > add imenu support for your new mode. > Thank you Yuan. > I just submitted mhtml-ts-mode for inclusion. > Please take a look at bug #74610. > @Andrew: I tried to explain as best as I can how to write a major-mode > that > handles multiple languages, check it out. > > Vincenzo > > > > --000000000000eff34206287e417b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot Vincenzo! Excited to take a deeper = look at it.
By the way, I did start working on a possible python-n= otebook mode, with planned multi-language (markdown and python) support: https://github.com/andrewdea/enb=

Progress has been a bit slow due to other commitment= s: so far I only have a rudimentary parser that 'renders' the JSON = into a markdown/python buffer. But I'm hoping to add more functionaliti= es over the coming months.

Thank you all again for= all the help on this.

On Fri, Nov 29, 2024 = at 5:13=E2=80=AFPM Vincenzo Pupillo <v.pupillo@gmail.com> wrote:
In data venerd=C3=AC 29 novembre 2024 08:37:28 Ora s= tandard dell=E2=80=99Europa centrale,
Yuan Fu ha scritto:
> > On Nov 28, 2024, at 11:22=E2=80=AFPM, Juri Linkov <juri@linkov.net> wrote: > >>> That=E2=80=99s awesome!
> >>
> >> It's pretty much ready, the only thing I'm missing is= the ability to
> >> create an Imenu with symbols from both HTML and the other emb= edded
> >> languages. I have tried a few approaches but it seems that it= can only
> >> be done for the main language. Is there any way to do somethi= ng like
> >> that?
> >
> > Imenu is a small detail that could be figured out after pushing y= our main
> > work.
> Oops, sorry for the late reply. Lets=E2=80=99 do this: I=E2=80=99ll ex= tend
> treesit-simple-imenu to support multi-language. Once we have that you = can
> add imenu support for your new mode.
Thank you Yuan.
I just submitted mhtml-ts-mode for inclusion.
Please take a look at bug #74610.
@Andrew: I tried to explain as best as I can how to write a major-mode that=
handles multiple languages, check it out.

Vincenzo



--000000000000eff34206287e417b--