From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Wed, 30 Mar 2022 14:46:21 +0100 Message-ID: References: <9C5A86D6-0E7D-4DDF-B211-278EF9AC7E01@gmail.com> <87a6gq5mxl.fsf@gmail.com> <877dbu5mgj.fsf@gmail.com> <0BB906F7-BD3A-41CC-9783-19AA16934497@gmail.com> <83pmplq9f3.fsf@gnu.org> <5B304D80-2969-4F59-9A90-412D0A284912@gmail.com> <83ilvbpsvl.fsf@gnu.org> <4A6F417A-EF74-40B6-9517-6C0947AB87A6@gmail.com> <83wnjmiork.fsf@gnu.org> <6D1CD758-2C6F-4843-9739-F2A5D5591648@gmail.com> <67183EAB-5D98-4211-B71B-4618D6266A15@gmail.com> <83lews90ft.fsf@gnu.org> <32CE637B-B9A6-4E1A-A6C5-B6A930D34299@gmail.com> <87a6d8yype.fsf@yahoo.com> <6097E0D9-0AF2-43D3-AA5F-A8424A161B02@gmail.com> <87wngcxg66.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003b297905db6fc2f6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2669"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , ubolonton@gmail.com, Emacs developers , Lars Ingebrigtsen , Yoav Marco , Eli Zaretskii To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 30 15:46:56 2022 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 1nZYf2-0000QF-1O for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Mar 2022 15:46:56 +0200 Original-Received: from localhost ([::1]:54500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZYf0-0007sp-Ia for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Mar 2022 09:46:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZYdh-0006EQ-43 for emacs-devel@gnu.org; Wed, 30 Mar 2022 09:45:34 -0400 Original-Received: from [2607:f8b0:4864:20::c2f] (port=41866 helo=mail-oo1-xc2f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZYdf-0001U7-F2; Wed, 30 Mar 2022 09:45:32 -0400 Original-Received: by mail-oo1-xc2f.google.com with SMTP id l24-20020a4a8558000000b00320d5a1f938so3613003ooh.8; Wed, 30 Mar 2022 06:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N4sYA94nBVbvsmXSHz5DhRKsIaFvURwDxqw7RthVIVk=; b=FAmWrvke7KKJUNKCTD4DJWbJ8rJbFlWZvJ5ToRs+bV7RIHv/8OPN7c0DFNgHjthjrh S9YKysMw5jKtRmviBdYMnwCLt13inUJMr/iq4JXuwBNWJfLGT2oZsdTpvHSkINaC20vQ qAHZauUzLmbsg+N9Qbk0xksXsord6SZs9uupkX8FBAYQDhyuW/sFBH+WM8xtKvQrJSe0 G/8N6oyTMdvJegi8bGARm65ljP3XWjwe7F02HW+B+7UVl6f1E5nIoYzbLsCqDHsq5IMX se5i9GhYLPYUidBttpvD+JchmyDKDujlVpWIsHeqxB49gYixOKYZ1h2U430YmMjMwCfa /CAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N4sYA94nBVbvsmXSHz5DhRKsIaFvURwDxqw7RthVIVk=; b=1izDTP39LmhiFQ9kVjUkxTW5eSsMsROLgHoUavdbIFvlPyUzDFyaoC0+PiwyjYcs3U CU00AA+XIQ19dSQAG0DGaf2WvnLGVh4Ps2eWEDRmuUmyf7iWhfTHm0DMmK227e0ykuZk TKepDC5zglQGgUtWLEfXhD5q2SZggNsGJ7r2SCD9v74s0RaZSHfkdnTr3UGUEAzi/OJU Y+Q26yYzm1zheX+cbpeXDq+IEu8f38GEj2hYift05oP6Qi8yJUdUELeiRRlBll0hg/r8 FwCND7HrzzG7A802Ekt/OVU3g1ewUIiBXuemZyPxO/s9iq3lfBn5LIs62ToPDYy1jCAy WP9Q== X-Gm-Message-State: AOAM533vyh2H2LbcezW1S6omU99havFl0ag7CI4O0mjo38aSGf7Gb0JS VfknhqdkeGRY/1P+H7SP8sLkUJ1e9EkqTKAFUTU= X-Google-Smtp-Source: ABdhPJxCwFRBMs4XZs0pZk4Pr7TGFno08gnsCI16Wwr2mKNOCNUSsVcRSGS8pYxqNIe92FUyg9AmEuRP6FOoXmveSCk= X-Received: by 2002:a4a:3391:0:b0:320:d78b:7957 with SMTP id q139-20020a4a3391000000b00320d78b7957mr2804321ooq.60.1648647930062; Wed, 30 Mar 2022 06:45:30 -0700 (PDT) In-Reply-To: <87wngcxg66.fsf@yahoo.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::c2f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::c2f; envelope-from=joaotavora@gmail.com; helo=mail-oo1-xc2f.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:287610 Archived-At: --0000000000003b297905db6fc2f6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 30, 2022 at 4:40 AM Po Lu wrote: > Yuan Fu writes: > > > I was saying we can=E2=80=99t use ts as a prefix, but I agree with the = idea of > > using a shorter prefix. > > But you can have the cake and eat it too, by making `ts' (or some other > short prefix) a shorthand for `tree-sitter' in the files where you want > to use it. Exactly. And just to highlight this fact: shorthands are per-file. In one file `tree-sitter-foo` can be shothanded to `ts-foo` but not in others. If the relevant files are in Emacs core and some official policy states that no shorthands should be used in versioned files there, then maybe your typing/reading aches can still be somewhat solved by temporarily using the shorthand in your file, reading and writing `ts-foo` wherever you like (knowing it will be interned `tree-sitter-foo`) and then renaming everything to `tree-sitter-` before committing. Personally, I think I'd do this at least in test/scratch files that exercise the API or in non-core packages. Jo=C3=A3o --0000000000003b297905db6fc2f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Mar 30, 2022 at 4:40 AM Po Lu <luangruo@yahoo.com> wrote:
Yuan Fu <casouri@gmail.com> writes:

> I was saying we can=E2=80=99t use ts as a prefix, but I agree with the= idea of
> using a shorter prefix.

But you can have the cake and eat it too, by making `ts' (or some other=
short prefix) a shorthand for `tree-sitter' in the files where you want=
to use it.

Exactly. And just to highlight t= his fact: shorthands are per-file. In one
file `tree-sitter-f= oo` can be shothanded to `ts-foo` but not in others.

If the relevant files are in Emacs core and some official pol= icy states that
no shorthands should be used in versioned fi= les there,=C2=A0 then maybe
your typing/reading aches can still b= e somewhat solved by temporarily
using the shorthand in your= file, reading and writing `ts-foo` wherever
you like (knowi= ng it will be interned `tree-sitter-foo`) and then renaming
= everything to `tree-sitter-` before committing.=C2=A0 Personally, I think I= 'd do
this at least in test/scratch files that exercise = the API or in non-core
packages.

Jo= =C3=A3o


--0000000000003b297905db6fc2f6--