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 version? Date: Fri, 25 Nov 2022 01:43:39 -0800 Message-ID: <8B97AC7B-54CF-41AC-9EF7-0A83F1709B98@gmail.com> References: <70973BD9-26D2-4833-A429-8434FC03026B@gmail.com> <87cz9cevns.fsf@gnu.org> 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="20172"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "T.V Raman" , emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 10:44:22 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 1oyVFt-00057s-OE for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 10:44:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyVFJ-000771-PR; Fri, 25 Nov 2022 04:43:45 -0500 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 1oyVFI-00076s-Ov for emacs-devel@gnu.org; Fri, 25 Nov 2022 04:43:44 -0500 Original-Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyVFH-0007XI-7g; Fri, 25 Nov 2022 04:43:44 -0500 Original-Received: by mail-pj1-x1029.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so3687720pjg.1; Fri, 25 Nov 2022 01:43:41 -0800 (PST) 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=3CJR6ZQQXauMk2SUMZi7MTvnSHaq8UDmluGWx+Enf5A=; b=gyGymEk1ngnkNs4xkdYM3Rycr/YXOAx4vbRtmFvXpZ+xvmgHOwKADygHoPLb29MR5j IL7/VKGxJIjChIScI/aiNI00KzN6FWTPR2QH7PKDHaO5Xy1gMI6V07fKQgJ8+o+25Lgt kYEtAE+XqARRuW4HBTNVV5QDPwOU5UakY3xcjWBnugBJAjefg2/M4C1LbsG0RE+URLNR a10d72jFH34QvVHKG+fs9bYLxJeXCiobz9+wdqPNoQszxSxZqXFTjUmd6EIqXqJ1ND4X OFEHfsQLXQ5Qab86Q41+da8OSr/g5VlP2jDAeyywCKePxpT2B2vleDck15pi7QJFN/Fm FUew== 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=3CJR6ZQQXauMk2SUMZi7MTvnSHaq8UDmluGWx+Enf5A=; b=OZIESpmr4r5QFlR4WJ+7aenGy5DFqP2d6ppNLvXk0qinPS8vtVxDluSgLkIOWS1Vpw S2IfbiiVR9XUKvJHtzFn0Oy5h9HXWbuah1eDxeg6T+9WBCyszmPoIwSHxyU641r28gTr nmfu+KzWtWPJ5NLqoR1V6w+4oYjh82apBZ/d1LfMy7o75qRej+2veMJ+oYtcKnAGW8NY 4dPO+4VqRXW+tLuSj7B2GC8zdRWxIhCwMTcJwJ1dXmL3ZJsl6lgpqVqZSI6N2wLKjEWg pOk25FrLbd02hZFtHQ9TeqmMtXwmi9xOseMmAY3QX+x4+2aPt4owk7b4gjHz8Z58Ur2X qaWA== X-Gm-Message-State: ANoB5pnPROrMmtExxlvRHt3NsawFYS8AmQGt2f1qjpQ2HjdYVbCJUptU /JYlH4ZQZLgqlrIzZQ5Z4tQ8RZlxnQAsSg== X-Google-Smtp-Source: AA0mqf5Sln1ZNrih6gwZrDk3LgrUbxe8kLee927EUFMvhgfDt/vGeUptwZ5wFuVcH7bMeHM5AKJo3g== X-Received: by 2002:a17:902:c14d:b0:188:f9e2:7d9c with SMTP id 13-20020a170902c14d00b00188f9e27d9cmr18712082plj.33.1669369420565; Fri, 25 Nov 2022 01:43:40 -0800 (PST) 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 i65-20020a626d44000000b0056c058ab000sm2643629pfc.155.2022.11.25.01.43.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2022 01:43:40 -0800 (PST) In-Reply-To: <87cz9cevns.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=casouri@gmail.com; helo=mail-pj1-x1029.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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300474 Archived-At: > On Nov 23, 2022, at 9:54 PM, Tassilo Horn wrote: >=20 > Yuan Fu writes: >=20 > Hi Yuan, >=20 >>> So: am I supposed to install tree-sitter from github or from = debian's >>> package manager? >>=20 >> Either should be fine. >=20 > Ah, I was wondering the same when I wanted to give tree-sitter a try. = I > have tree-sitter 0.20.7 installed but the configure output said > ">=3D0.20.2 no" but only reported a >=3D 0.6.x version. It still = works > fine. :-) >=20 >>> I first did the package-manager version, then pulled from github and >>> installed that -- configure shows that tree-sitter is detected -- = but >>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an >>> error saying that support is not available. >>=20 >> If you call tree-sitter-available-p, what do you get? Most likely you >> don=E2=80=99t have the relevant language definition/grammar for those >> modes. You can probably find them on package managers, or you can >> build with the script here: >=20 > Indeed, that was the next trap I fell in. On Arch, tree-sitter is in > the community repository (so basically almost official) whereas the > language definitions are only on the AUR. Maybe the NEWS entry should > tell more clearly that tree-sitter needs to be system-installed and = also > the language definitions need to be grabbed somewhere. Yeah there will be a NEWS entry for tree-sitter. >=20 > BTW, how can a user decide that tree-sitter modes should be used? For > example, when I open a json file I get js-json-mode, not json-ts-mode, > which also works, so support is available. Should user's augment > auto-mode-alist? Or is there some "enable TS whenever possible and = the > devs think its support is in a usable state for that language" toggle? There is no global toggle, unfortunately. You could use auto-mode-alist = or major-mode-remap-alist to enable tree-sitter modes, yes. I imagine = there could be a third-party package that automatically enables = tree-sitter for all supported nodes, maybe. Yuan=