From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Sun, 01 Jan 2023 08:54:38 +0200 Message-ID: <834jta4udt.fsf@gnu.org> References: <83edszjslp.fsf@gnu.org> <87tu1vxs3a.fsf@ledu-giraud.fr> <831qozjob7.fsf@gnu.org> <87cz8jxoat.fsf@ledu-giraud.fr> <83wn6ri7pn.fsf@gnu.org> <5e0a3185-de82-b339-0fa2-956779e63d6f@cornell.edu> <868rj6vfep.fsf@gmail.com> <4895891b-e5ea-9c37-f51b-df2e479ee758@yandex.ru> <83y1qt11xq.fsf@gnu.org> <9eb013da-d0fc-8e17-c6e3-1e8f913aebfa@yandex.ru> <83pmc50xxc.fsf@gnu.org> <71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru> <83h6xg29z3.fsf@gnu.org> <87wn6cyey5.fsf@posteo.net> <787B1EB4-1925-4679-8747-449DCD685432@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23122"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 01 07:55:18 2023 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 1pBsFa-0005o2-13 for ged-emacs-devel@m.gmane-mx.org; Sun, 01 Jan 2023 07:55:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBsF1-0005Fs-9b; Sun, 01 Jan 2023 01:54:43 -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 1pBsEz-0005Fi-Gq for emacs-devel@gnu.org; Sun, 01 Jan 2023 01:54:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBsEy-00060c-TV; Sun, 01 Jan 2023 01:54:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=HIWapUwaCg0CRF1aD0phkjgiK5cPA2CcFrT/t5bpWOU=; b=K57jIkWTFUBV W7b6LTU/0+GOYjbeuhamzoQMajmwJJKIcP5PXTd/v7/wp7wSjSRbU24N2e7y+wmL5t3b0MHFr+NYC 6uzTsUdaQea7nZYtCLCutDNV+Xv2gsDdlg0R40jL/YjUt15iwzl4VE8iaeiNvm3cxYFcSo2Y7Lnev vN8ESSVOERZ1rUgLSg/bOespDHFlwQJoZX42nOwX3gCYIyVHMGPlbuf8cOGIituJD1SVMOtTihjQV qll0Y2iP4RczCHl1jcQRII57Zg2GkzPLuz7ht87c7Hvy/6Dm5cytzcTbiheaBfr/RP8ZvVtbH9ejs YZ7oBJ/GUeJTaqD3nENiLQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBsEr-0000QY-Ql; Sun, 01 Jan 2023 01:54:34 -0500 In-Reply-To: (message from Richard Stallman on Sat, 31 Dec 2022 22:03:56 -0500) 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:302179 Archived-At: > From: Richard Stallman > Cc: emacs-devel@gnu.org > Date: Sat, 31 Dec 2022 22:03:56 -0500 > > > (setq treesit-language-source-alist > > '((python "https://github.com/tree-sitter/tree-sitter-python.git") > > (typescript "https://github.com/tree-sitter/tree-sitter-typescript.git" > > "typescript/src" "typescript"))) > > A GNU package should not load other programs straight off of someone > else's repository. That is vulnerable to surprise changes, in the > code and in its license. We can hardly count on Github to make sure > these run without any nonfree software. The above was an example of user customizations. There's no such text anywhere in Emacs, nor there will be. Emacs will be distributed with that variable having the nil value, and users will have to download and install the grammar libraries by themselves. The major modes we distribute all use grammars whose licenses are free, and as long as we take care to verify this aspect, there should be no problem here from this aspect. > There are three proper ways for Emacs to handle it needs. > > * To assume that they are already installed. Normally they would be > part of some other package in your system distro. This is what we do > with many standard tools and libraries. > > With this method, we outsource the vetting of those programs to the > GNU/Linux distro. If you use a free distro, you can count it to make > free versions of those programs available to install. > > We could in principle handle tree-sitter grammars this way, > but only if and when GNU/Linux distros generally package them. > Is that the case today? > > * To include their source code in Emacs the Emacs release, and build > them along with the rest of Emacs. > > * To tell the user, "Installing these external programs is your > responsibility." That is the least helpful method, but it's > acceptable. We currently assume either the 1st or the 3rd alternative. For the details, see the text in NEWS about installing the grammar libraries. > How does the current tree-sitter code obtain grammars to run? It doesn't. It expects these grammar libraries to be installed "by other means". The tree-sitter code just checks that the grammar is available, and if not, emits a warning to that effect and doesn't enable the related features. > Does it download those straight from Github too? There's a command to download and install a grammar library, but it leaves it to the user to specify from where to download the library the user wants.