From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Sat, 18 Dec 2021 14:39:22 +0100 Message-ID: References: <83r1f7hydn.fsf@gnu.org> <1F752923-F357-4A18-B6E2-0120F1B9BD37@gmail.com> <83fsu5bzem.fsf@gnu.org> <83zgsdad5j.fsf@gnu.org> <83sfy391ni.fsf@gnu.org> <03386E3C-A975-4ECD-BF89-6AC62F751725@gmail.com> <83ilyz8xdl.fsf@gnu.org> <86czp6ukpj.fsf@stephe-leake.org> <1AEED8A5-BF5E-45E5-AE22-9B405A710F9B@gmail.com> <83czp313tf.fsf@gnu.org> <7447C582-70CB-4599-BC76-AD5687D64250@gmail.com> <784947A6-6164-4158-993B-01E881690ADF@gmail.com> <83zgrxji7q.fsf@gnu.org> <8E8D28F9-258E-490B-BF48-7EF8D6CA0817@gmail.com> <838rzgk6ll.fsf@gnu.org> 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="19744"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) Cc: Eli Zaretskii , ubolonton@gmail.com, theo@thornhill.no, cpitclaudel@gmail.com, emacs-devel@gnu.org, Stefan Monnier , stephen_leake@stephe-leake.org, john@yates-sheets.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 18 14:43:28 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 1myZzj-0004w4-8x for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 14:43:28 +0100 Original-Received: from localhost ([::1]:54022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myZzi-00086S-80 for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 08:43:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myZvx-0003rr-06 for emacs-devel@gnu.org; Sat, 18 Dec 2021 08:39:33 -0500 Original-Received: from sonic301-21.consmr.mail.ir2.yahoo.com ([77.238.176.98]:35623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myZvu-0003jG-UB for emacs-devel@gnu.org; Sat, 18 Dec 2021 08:39:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1639834767; bh=Ov13jAP8gYUL5z44C2exD4lC92j2pqzbSjKkm//UoSw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=tJMhGIIQahjZITQ8feWHh8zlQIQjKpXB2k6Yxyn4gMtuSAkbJ0pMFY+TprSsAvVray1goEjy9pE2qiK4S770W1DQCeoujCi/CcoQVSg5g+72ZLk/yPQuE58yqLi34vYDn91nX6wpcxMXRXa54+uTj0lKfM1tArD9i0fEKSd1YOUSNcP37hwidEba5znjCXHEpur/5AmOwfoeKMOULWC4n+0qAhIGh3MnB1k5qe2sYA7RGKzxIx+GgnWpVVK9iju+8WdgEiTKSOpP7HCoXWfQWt/fP/U+vl01wt/BTs3S5cKfsq5BXltGQ2ZQ4yyNb/+spFYreEpAiTSQQ7WsA/TNpA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639834767; bh=aE8y2m0p9f1/yhEfSChT0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nwf5Phk1Zi9nch ANwY.cz5t8nAN2RVgWo3t6PyN9i89BEJt9vNM5NgX6afiXlWUxyZsoz6.gDoJiPiCjnhsJnmxUTV BEvXxMUdLROm2zaHfrXUIE1jzP7Wo.K7eeeBS_OUwT_sMSl4RSMOOApTsmetW4tNQpR4a2IiQ7TJ dfhQDThb5ekelHWHFBuk0yaGTOEz05RDaNzGw_iUdh X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Sat, 18 Dec 2021 13:39:27 +0000 Original-Received: by kubenode504.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 6f555c9ec9c3f11a817c612529d6c629; Sat, 18 Dec 2021 13:39:23 +0000 (UTC) In-Reply-To: (Yuan Fu's message of "Sun, 12 Dec 2021 22:54:59 -0800") X-Mailer: WebService/1.1.19415 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.176.98; envelope-from=mardani29@yahoo.es; helo=sonic301-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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" Xref: news.gmane.io gmane.emacs.devel:282306 Archived-At: Yuan Fu writes: > It=E2=80=99s been a while and no one provided further comments on the ind= ent > and font-lock integration of tree-sitter, so I finished the manuals > for indent and font-lock integration. They are under 24.6 Font Lock > Mode and 24.7 Automatic Indentation of code. Once the author of > tree-sitter allow tree-sitter to change malloc implementation at > runtime, tree-sitter integration will be ready. (Though I suspect that > won=E2=80=99t come soon. The author is still actively developing tree-sit= ter > but he didn=E2=80=99t reply to my request.) > > As before, the code is at https://github.com/casouri/emacs on ts branch. > > Yuan Thank you for your work. I had some troubles getting the latest code to compile, so I've sent you a pull request with potential fixes: https://github.com/casouri/emacs/pull/4 I have signed the FSF papers. I have a general question about the major modes. I see there's a couple of sample major modes, one for C and another for JSON, but they are in tree-sitter.el. How would those new major modes be included with Emacs? Will there be a c-ts mode, separate from cc-mode, which will implement font lock and indentation in terms of tree-sitter (when Emacs is compiled with tree-sitter support)? Or the plan is to extend the core language modes to offer an option to support tree-sitter? (I'm not sure how complicated and clean that would be.) Thanks.