From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.devel Subject: Re: treesit: how to get it to parse multiple languages Date: Fri, 29 Nov 2024 23:13:01 +0100 Message-ID: <2121596.YKUYFuaPT4@fedora> References: <87r06u4i91.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32552"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Peter Oliver , Andrew De Angelis To: Juri Linkov , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 29 23:13:51 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 1tH9FG-0008Ec-H5 for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Nov 2024 23:13:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH9Ee-0004TT-Al; Fri, 29 Nov 2024 17:13:12 -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 1tH9Ea-0004T0-Jl for emacs-devel@gnu.org; Fri, 29 Nov 2024 17:13:08 -0500 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tH9EZ-0000C1-3k for emacs-devel@gnu.org; Fri, 29 Nov 2024 17:13:08 -0500 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d0c92e335bso290856a12.2 for ; Fri, 29 Nov 2024 14:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732918384; x=1733523184; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6skRkeatLFMWdK0lMCyeSknJVH61SnlpVIOPnEccSpA=; b=kujgi6i1XkiFvqhQHDZftQ7kwq2AWZenZXSVPvIUWT23cbnAKLis1QLFIKN4Lt2NCa p7VCEoAfDwZnrGHite+zAvgYON9iiNo7UViP6LUu4Vl5ShGrv3o1WxaHy+ZdYZNU94so zhlDHfVmKXsRYqXrRFgONITbDyrWlRD5XKuiQwpzxS5focqFdPmrylMgArX8lpOycP0C GRToLOXidYdVTPlfk91mrk/bXBx+8H4kAaSW7DQg89aWa55/fxDCw8HflGwWkph6H3kq 7ZQUf+0IJ7QfrsG1ne5NMPRSJtYF20g8IKLUlJdiFqqRTRsUd5S295RQvwtjyizRFMvp KQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732918384; x=1733523184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6skRkeatLFMWdK0lMCyeSknJVH61SnlpVIOPnEccSpA=; b=prqW3Kxv0SgxSos4NWGSPb4JdQRVMxaj4pCXcU5WubVHgrlnnc/BH9rdDg83rTCGe7 vlGFcJO3bopfIRvBKMbE5BVdT8wZQ5eTOepzb+m5AUo0jyr6aVKGbbkR4KQBDFh99B/y KnkV/EdYza+kJyFOi3NcJyD/eGRAvUYcagq85Bbi2Ajmf3/15GMUdggBGAmCreJ5IDg6 S7xTmcNH5ZbHyNjf6pntRnK01W5IqIMZRjCQoyD0rNQm2pFzOY5zlUAaqMqJZbJ7aIEr +Alh/NdmA6EZwZZXX6w81k1SCQgYGzhTZp75lOmyK9Cry3poNpmdjZulRW+237RPGguk LFnQ== X-Gm-Message-State: AOJu0YwJpCb8WApOkSvjofXosxHdewl8TmderM+5j/bVCJqQUnx9f1Zy s0t8fL3dtY0LCnAa4CfXtump171zutT0Xni3qgysdUHifLKTatq5 X-Gm-Gg: ASbGncu6vP8/OHbhMreStWyn6aj7eSdyz4czzQ9bjvbZ0HyJ/kko72DCv9/lT5/PTW6 EVDDfwTYJ13jz9j6n3edA8sjhpoH5VPWdJtQjZIkBtS0bzokEt7kn+hVvEf5+J0tBZ6IICTW80v Jc1jkf01fCKME4q6rq+DVMskYaiVBSHqijPsz61kkFiaWhdLemYDbMCddgoIpksw9L4PowP0jos A9Hr58VTE+XpYF1J/RqFkUgR+TK0Oi/13v0jakC68aQvBw10/Uafl6Nx/Hrsq2tPw+TUBq/y5Ct TAO+jgitJhniUA== X-Google-Smtp-Source: AGHT+IGc1qFexmvK0H7bKrxjWWeVIT1x56JiYyHByeufDanSs3QkvDIuPWKObuwusA/NObcKgH4dAQ== X-Received: by 2002:a17:906:4ca:b0:aa5:b32:6966 with SMTP id a640c23a62f3a-aa581076b11mr1360628066b.50.1732918383628; Fri, 29 Nov 2024 14:13:03 -0800 (PST) Original-Received: from fedora.localnet (2-230-139-124.ip202.fastwebnet.it. [2.230.139.124]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa5996c195bsm215099966b.1.2024.11.29.14.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 14:13:03 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=v.pupillo@gmail.com; helo=mail-ed1-x52b.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, 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:325860 Archived-At: In data venerd=C3=AC 29 novembre 2024 08:37:28 Ora standard dell=E2=80=99Eu= ropa centrale,=20 Yuan Fu ha scritto: > > On Nov 28, 2024, at 11:22=E2=80=AFPM, Juri Linkov wro= te: > >>> That=E2=80=99s awesome! > >>=20 > >> 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 only > >> be done for the main language. Is there any way to do something like > >> that? > >=20 > > Imenu is a small detail that could be figured out after pushing your ma= in > > work. > Oops, sorry for the late reply. Lets=E2=80=99 do this: I=E2=80=99ll extend > treesit-simple-imenu to support multi-language. Once we have that you can > add imenu support for your new mode. Thank you Yuan.=20 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= =20 handles multiple languages, check it out. Vincenzo