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: Average-user-facing interface for tree-sitter Date: Tue, 25 Oct 2022 14:37:12 -0700 Message-ID: <1E3B06A0-46B0-495B-90B0-618CCA5D1C59@gmail.com> References: <8BAAB6CC-C8BA-4255-9E60-8963A828BE31@gmail.com> <41838564-B3F1-46C8-A316-EE888C4B9968@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="38760"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill , Lars Ingebrigtsen , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 25 23:38:32 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 1onRd1-0009r2-FF for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Oct 2022 23:38:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onRbs-0008Mp-BA; Tue, 25 Oct 2022 17:37:20 -0400 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 1onRbq-0008MF-37 for emacs-devel@gnu.org; Tue, 25 Oct 2022 17:37:18 -0400 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onRbo-0000Ts-Gm for emacs-devel@gnu.org; Tue, 25 Oct 2022 17:37:17 -0400 Original-Received: by mail-pg1-x536.google.com with SMTP id q1so12810767pgl.11 for ; Tue, 25 Oct 2022 14:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fiq98g/7YoAQi6EgHY90WR70ucWhyoO8vSXG3JQExb4=; b=ToE0ZwkGEwi4/HcldbhvxJvFCvslvm6OcghDwyOUCu/yGIDaeGPwgQeXjMZ1dolfgP /IuP4PMSxHC0jKHv9JJ/YsU+L4iE0tc4XHJPDbNgQ3TOP9eifisuXHZ+U229C3G4wPuv G2mBkT/UHsiG5BKxbY4EGLPpaIXaScY87rDAkgXxlJkX/bsEPyiX2HMTSAqec6GyRVFx mxYQTXG7+GvFKuqtb4X5TXmYTP9/4F+QS9pmL53YD2bOuX7SLwJVAE6IcteUbRLZD1+z s6i5iGRX8R+QIWSmuqH/IHQEy7aQoYagf0eX0Pn/HTSBsPqAk3PAlNQJBOZka4B3uxF+ K6xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fiq98g/7YoAQi6EgHY90WR70ucWhyoO8vSXG3JQExb4=; b=bWDvkIvPvsLcL6kSJFsz2JDt46R7Fc6NtfZ1nlfvfNiPkxbPFGmT1Tq8mbmDN8Kk4F Gu/zzSg1PVjHOBSD/0UPv8hbjqc917foQ7vYZDIoKDtTc0GWKv5J/KnZNNLzHL49rUIS eOa6uF4omnWWiBOiSDmTcvDXqWNlF4Qus/YTSB/sIxyJORvSHxnsd5Nq8yMOIITz5Bap 15T3hopoqFVNyXjgYYydjtKa6j0rQwKQF5RkS3YBb1zIT6zo4X4aff0C0/+Ak7BoUxwp XvT+yJYlB/CcZuz/gO4V3/trnX+GDkuUiggtZhfDlQbxQI8wW4s1nta5DS5r8dxUPIkN uSfg== X-Gm-Message-State: ACrzQf0+U8F2L0Bra3nfL/yrh09u/Ly7nOQZEZ0cu27Ocmm+IxX3ReeW ne8p8Kuc1RqtVxno6eOE8bM= X-Google-Smtp-Source: AMsMyM7qMkw8SpMefSxFCxBGmW6TCIcwD+SZzk/7SH7nop0gZjMAq/AQopuvxHOBV6BSEkkWI83oVQ== X-Received: by 2002:a63:84c6:0:b0:46e:df48:afdd with SMTP id k189-20020a6384c6000000b0046edf48afddmr15981799pgd.458.1666733834668; Tue, 25 Oct 2022 14:37:14 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id s11-20020a170902ea0b00b0016c0c82e85csm1626101plg.75.2022.10.25.14.37.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2022 14:37:14 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=casouri@gmail.com; helo=mail-pg1-x536.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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298501 Archived-At: > On Oct 24, 2022, at 4:55 PM, Stefan Monnier = wrote: >=20 >> There will not be treesit-mode and global-treesit-mode, only the = central >> variable treesit-settings. Enabling tree-sitter only requires adding = (mode >> t) to treesit-setttings, and M-x revert-buffer, or reopen the file, = or rerun >> the major mode. >=20 > Yeah, I guess it's good enough for now. We can still keep all the > treesit- variables and then a `treesit-enable` function which the > major mode has to call, right? Oh and probably something like > `treesit-enable-p` function (or maybe `treesit-enable` can return > whether it enabled the treesit support). >=20 > So the major mode code could look like in the patch below? Ok, I pushed the change. I didn=E2=80=99t move as many setup in js-mode = as you did in the patch, because I think some of them are still needed? = For example, filling. Js-mode=E2=80=99s tree-sitter code doesn=E2=80=99t = provide filling right now, so we should setup filling regardless of = tree-sitter. Yuan