From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Mon, 13 Sep 2021 11:29:01 -0700 Message-ID: References: <83r1f7hydn.fsf@gnu.org> <95F37923-5BF9-4D81-B361-267CF119FBCA@gmail.com> <735AF34C-FD18-4A6A-A99D-E5D8EB4DE4F3@gmail.com> <40611F1F-7B5C-4885-A2CA-CE709ED8D22B@gmail.com> <4E876354-10D1-46B3-8124-CAE916261F08@gmail.com> <0A3F5464-B90D-4D47-BBDD-CCA26D877F43@gmail.com> <83tuiys1y4.fsf@gnu.org> <835yvcpdip.fsf@gnu.org> <7B1F90DE-A992-4F51-B391-0A4E5A598780@gmail.com> <3E8CA8E4-E623-4051-A76D-508C6CF94B6A@gmail.com> <837dfpj5yf.fsf@gnu.org> <8335qbirsr.fsf@gnu.org> <73E0B1F6-6F9F-40E0-927E-D08481BFF391@gmail.com> <834kaqhqlp.fsf@gnu.org> <8335qahqgk.fsf@gnu.org> <3BC29D06-CA75-4706-9AD7-ABA2F65C4DEE@gmail.com> <83v936fj35.fsf@gnu.org> <83r1dselyo.fsf@gnu.org> <6A4CE984-6ACE-4E66-8EF2-F3D351C02248@gmail.com> <83r1dscpt2.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) 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="20234"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= , Theodor Thornhill , =?utf-8?Q?Cl=C3=A9ment_Pit-Claudel?= , Emacs developers , Stefan Monnier , stephen_leake@stephe-leake.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 13 20:30:44 2021 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 1mPqj4-0004yI-T3 for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Sep 2021 20:30:42 +0200 Original-Received: from localhost ([::1]:53236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPqj3-0004SA-PZ for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Sep 2021 14:30:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPqhW-0003ct-Ai for emacs-devel@gnu.org; Mon, 13 Sep 2021 14:29:06 -0400 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:45866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPqhU-0003a3-Pp; Mon, 13 Sep 2021 14:29:06 -0400 Original-Received: by mail-oi1-x233.google.com with SMTP id j66so3194988oih.12; Mon, 13 Sep 2021 11:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AtJaZWXmNrw9n47PNkN1woBx5KsARNG4ac2KwuZTyEw=; b=FXgc9wYsTZoNnolwnTF0xLpdnWvhRmVUmUdjU3kEeolL2BfJJ3kIcvAljacpqnP2dW NiwJI2IKlNArMTeHRfsmM/tNtlwDCRZLItxHyLnBMi2wTWRi7Haunv+wy4J9XcNccf95 CuNoJFPhLyjdxkzCWgFdMH6H5pcgGqKgBIWHBh5HON/pvFTxKbQF9qunwhNZujz73TES RA76YmZIiqvP1Czyf6s+q4bMI1AmxzCykA1K91KowJKiafnUQJU7SGUCOhuTqMgJDTkR PRRgsN6XBevGO6Q09r68nVEMboiWL8WHicuQq31gT7Wv5sWnsL/4Lw5YLO+9VnjcMm9q 0EzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AtJaZWXmNrw9n47PNkN1woBx5KsARNG4ac2KwuZTyEw=; b=fQxrYVmMneS/u1J84a59sm7DLERb4FK3MUGg27IEnx2gUY+gzucMsgEZBkfEqC4nia zTMEj8uv7y5pPFB9dQBMo1WN3ENF+bpQQagHeGgrqEJMX8L8r/EBeOSPzci5NCwC6QFp zGekHfFW4wyE9nUJi7ll0uOkN96xzDVNQ5jn3nzjCkz9B+Tpfouj+0/94p/UHor43H8a Rdn8RuypZdHfmnCU50c8C8suqmswY+OKzGlnDSuL5CR8esisvuP5ejshBMJfRy1s7bgs JjLYEvhKXcSmh100Y3BES1xJ0yn4/drg2PpI8rr40zOdmxdRhs+OOLzzlUm1A22Ikp1N Gepg== X-Gm-Message-State: AOAM5339KPsEAGwSplt/yTXJ7yk942T2Ij19qLHGYXuRdG3IL8kf9SJb N0C/12AhXShAHlMYs+6NuCg7Fnw6B1ucwDzE X-Google-Smtp-Source: ABdhPJwFYwiWCHFYZJir5pj6RoqQ0tqI66XqzVlTn1fv94xNx3xOuTPiP7NyceMrNKhjulX7V+pEeg== X-Received: by 2002:a05:6808:81:: with SMTP id s1mr8666543oic.130.1631557742899; Mon, 13 Sep 2021 11:29:02 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c9f:a1fa:bf8f:af60:ddef]) by smtp.gmail.com with ESMTPSA id m25sm2093038otp.41.2021.09.13.11.29.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Sep 2021 11:29:02 -0700 (PDT) In-Reply-To: <83r1dscpt2.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=casouri@gmail.com; helo=mail-oi1-x233.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.23 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" Xref: news.gmane.io gmane.emacs.devel:274663 Archived-At: > On Sep 13, 2021, at 11:07 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Mon, 13 Sep 2021 11:01:47 -0700 >> Cc: Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n , >> Theodor Thornhill , >> Cl=C3=A9ment Pit-Claudel , >> Emacs developers , >> Stefan Monnier , >> stephen_leake@stephe-leake.org >>=20 >>> It makes little sense to me to request each major mode to figure = this >>> out. It should IMO be a service provided by the TS integration into >>> Emacs. >>=20 >> This is IMO the easiest and least confusing way for major-mode = authors. But before we continue, what is the way you envisioned? I=E2=80=99= m not sure what exactly is the service you want Emacs to provide. >=20 > What I had in mind is a function that give the major-mode symbol will > return the name of the corresponding TS language module (or a list of > modules, if there's more than one). My problem with such a function is that Emacs can=E2=80=99t possibly = cover all the major-modes and tree-sitter languages. What if there is a = new language, and someone wrote a tree-sitter language definition for = it, and then want to write an Emacs major mode using tree-sitter = features? Yuan=