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: master 09b5f00613: ; Fix calls to treesit functions Date: Tue, 20 Dec 2022 15:59:08 +0200 Message-ID: <83fsdach1v.fsf@gnu.org> References: <167138365421.15060.2886694741391315956@vcs2.savannah.gnu.org> <20221218171414.77B8EC0060F@vcs2.savannah.gnu.org> <831qowf54k.fsf@gnu.org> <916FA9FE-440F-4A8F-88FA-F08697EFCB3C@thornhill.no> <83ili6d9ra.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2903"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, theo@thornhill.no, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 20 15:04:03 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 1p7dDt-0000WY-UC for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Dec 2022 15:04:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7d91-0002rT-4A; Tue, 20 Dec 2022 08:58:59 -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 1p7d8z-0002ob-0m for emacs-devel@gnu.org; Tue, 20 Dec 2022 08:58:57 -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 1p7d8y-0001sd-19; Tue, 20 Dec 2022 08:58:56 -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=aC7Iq6/VszEvnyVzO6vVQNlRZj3xkE8KV0uOhyhlSMM=; b=Edb39bhO4R8d Ye/m1B166ESZ2yFQGNyew34no673IbC0Uj8nohjOfcvlXFMlSJjqrSjIhIuE47kF0Dbs2d2SAUZNW wjE/cMaHoz6ElKBoioUvrMG7g7Tpb20OvRYnc/Lcbop/hpW5G8XCw++Cq4jCAtEMOkZhiLEufgJgh a/GU1kULGg+jQInekkcwwWIIevavUVrz4v4KKlZVB5CzCvZGzaoa9heOoyU3u1C/PMX2abaYWT7rZ KHtWANUn+HmoKO6cSaABZKE4glsX0gnw38QfvLrUk60wAgg9wnGYrhK1o7KQPqw6pUJZIvkUokDlm pL1TmDCGfn43F2jDVVw36w==; 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 1p7d8x-0005Yv-1M; Tue, 20 Dec 2022 08:58:55 -0500 In-Reply-To: (message from Stefan Monnier on Mon, 19 Dec 2022 23:37:28 -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:301683 Archived-At: > From: Stefan Monnier > Cc: Yuan Fu , theo@thornhill.no, emacs-devel@gnu.org > Date: Mon, 19 Dec 2022 23:37:28 -0500 > > > SGTM, but I think we should document somewhere how does one write a > > Lisp program that could optionally use tree-sitter, i.e. which APIs > > text for the availability of tree-sitter support internally, and thus > > could serve as a gate-keepers. > > I think this can be done simply by listing which functions are always > defined. No, this is not enough, IMO. What is needed in addition is to document how to know, with each of these always-defined functions, whether tree-sitter can be used (most probably, by examining the returned value). > Then we just have to make sure that those functions can be > implemented correctly even without Tree-sitter. The implementation without tree-sitter will probably be trivial, like return nil or something like that.