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: Thu, 16 Sep 2021 14:46:08 -0700 Message-ID: References: <83r1f7hydn.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> <83o88wcof9.fsf@gnu.org> <83lf3zdh4z.fsf@gnu.org> <8965C4A0-79D3-4D77-A6BA-D07A6C93F7FE@gmail.com> <83ilz3cs4k.fsf@gnu.org> <04D19C1A-CD64-4156-B932-1C9FEEE4EC7B@gmail.com> <83zgsebc0r.fsf@gnu.org> <1F752923-F357-4A18-B6E2-0120F1B9BD37@gmail.com> <83fsu5bzem.fsf@gnu.org> <83zgsdad5j.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5611"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ubolonton@gmail.com, theo@thornhill.no, cpitclaudel@gmail.com, emacs-devel@gnu.org, 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 Thu Sep 16 23:47:33 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 1mQzEB-0001By-Sc for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Sep 2021 23:47:31 +0200 Original-Received: from localhost ([::1]:44838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQzEA-0002ju-89 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Sep 2021 17:47:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQzCw-00022l-UE for emacs-devel@gnu.org; Thu, 16 Sep 2021 17:46:14 -0400 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:33434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQzCv-0008GA-IK; Thu, 16 Sep 2021 17:46:14 -0400 Original-Received: by mail-qk1-x733.google.com with SMTP id b64so11151632qkg.0; Thu, 16 Sep 2021 14:46:11 -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=Psz5k7i9eEHBP1iH0+AKTEZTVhUaz1IaxtgDIth499E=; b=Y6LcYh0J0if/WFT3uBIiYBvbsU7m+7t39+NXNa38r6rXCe8KXDUsY7jM1nXtap44p+ MYbcI+bSvqs5Ko7Z8UsYneSIc+q2JvKeKel9GMoy9s0bXB1yMTPtR30tABupDIkLN+II MfvNAMhb0s35WNaRgQ7WTpLEe+gwuaM0zwJXrug3QtC9YFsePgWZSs+cxQwI2YZyHAcV 11hIm1wvn36hYk7hCoy/Uqhp3z31pJNfDAo1mwCiHJDSPf6oTHfi8a7ZVGiXcNnUIOFB e7I7zgxLzQ8iiq6p1rq1nBZiWcT8DIBqOFJ0uT8C0zpLvH+RTP8LP7bFhSAAO81bAPbk C4bg== 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=Psz5k7i9eEHBP1iH0+AKTEZTVhUaz1IaxtgDIth499E=; b=cKR7/XLC6d0//YEyU9vCiuZctTPE92VcRCfhwIniOdMc2sul63rzXwL4quuyawyOW2 HY23wmUsi3C6WKZUX3OpQpC2zZWrhIT6/PsNHfpmpdKwSUxvNJG3sbrkVPGdKoAgm0MY oO6Ly/OdjMBs/gzy/ZLdwIX/PgRMmb21daz96/bRAKtzsIrM1er5IFB1MQUYE6iJMocM bmrkT1UsyRK9yOaa1iljGA22Lnlm56KZSJMbcBAk4+L5D3ke2nkGv9CksMVOI+5TNwBx TWaCCzIxIA5xhUIft6xt82yaeAVW0AoTgPu6oMYWQtCoEtq/osl13IKgdff6LAgc4pEa 4m6g== X-Gm-Message-State: AOAM532xfTJvSARSF9wwjGYZjgpfRVQ7V0W+2ERIXyAFQClDAMgeZ4Y5 WjxQsheEMXkrBNr0ZGvIwLy1WMMWFx3mBA== X-Google-Smtp-Source: ABdhPJydQ3Z/icmiystRVc779VyLqLNqKWDsYl8tzocFcm0wFd3vaXeprv73V27jkvkhzLjaZE9UAg== X-Received: by 2002:a05:620a:1525:: with SMTP id n5mr7320354qkk.386.1631828770798; Thu, 16 Sep 2021 14:46:10 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c9f:6c2c:1a17:b2af:c864]) by smtp.gmail.com with ESMTPSA id y15sm3068489qko.78.2021.09.16.14.46.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Sep 2021 14:46:10 -0700 (PDT) In-Reply-To: <83zgsdad5j.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=casouri@gmail.com; helo=mail-qk1-x733.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:274831 Archived-At: > On Sep 15, 2021, at 11:48 AM, Eli Zaretskii wrote: >=20 >> From: Stefan Monnier >> Cc: Yuan Fu , ubolonton@gmail.com, = theo@thornhill.no, >> cpitclaudel@gmail.com, emacs-devel@gnu.org, >> stephen_leake@stephe-leake.org >> Date: Wed, 15 Sep 2021 14:19:12 -0400 >>=20 >>> I wasn't talking about tree-sitter itself, I was talking about the >>> facilities Emacs will provide based on TS. There will be in Emacs a >>> function to calculate indentation using TS, right? And that = function >>> will be language-agnostic, like indent-line-function is, right? >>=20 >> There is such a function but it doesn't do anything itself. It = relies >> on the major-mode to do the heavy lifting which consists in giving >> indentation rules for each one of the possible node types that can >> appear in the AST >=20 > Sure, and the new one will do that with help of TS. But the principle > is the same. My point is, major mode writers need to read the source of the = tree-sitter language definition to do anything useful with tree-sitter, = therefore they must know the correct name. Yuan=