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: Call for volunteers: add tree-sitter support to major modes Date: Mon, 10 Oct 2022 11:16:42 +0300 Message-ID: <834jwchz4l.fsf@gnu.org> References: <83czb1jrm3.fsf@gnu.org> <84436B1D-3359-487F-B997-A7F56FDEA636@thornhill.no> <83bkqljih5.fsf@gnu.org> <87fsfx6ufb.fsf@thornhill.no> <8335bxjdpf.fsf@gnu.org> <1D07A0F1-A269-410A-9D3C-8A53113FFE2F@thornhill.no> <83sfjxhuvc.fsf@gnu.org> <87bkqk7qb0.fsf@thornhill.no> <8735bw7kwm.fsf@thornhill.no> <158F25C9-A539-4515-8D49-50A7E6252960@gmail.com> <9941E2A6-AB31-49FE-A6BA-9BE61BA6ED13@gmail.com> <83fsfwi44y.fsf@gnu.org> <5244C2EB-A319-4CDF-9F60-422798E29F95@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21096"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 10 10:39:24 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 1ohoJm-0005Gu-Sf for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 10:39:23 +0200 Original-Received: from localhost ([::1]:47670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohoJl-0008Qt-Jh for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 04:39:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnxk-0003PU-LM for emacs-devel@gnu.org; Mon, 10 Oct 2022 04:16:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnxj-0000Fp-Tl; Mon, 10 Oct 2022 04:16:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=2EJ73WdI5lXSP1K8DeXt9rIaXua5q4rHPsjBvQ38uXI=; b=MrEMrRYduzWWumv+ph0A gqr1zS3BO0EEZFTdX46F4EwSwf1zFb3EVxTka2stI6JUSICJ5iXgJO+SAEGW4p4IBBU6p61kHXF+G 23tkTnLjYdtpTR75SBVdfl5NnuMOvbsy4fo7NWou+M+p/Id7ZBafJrz2CvWTCAjOIRkTTsZ350f7n dMDZWyqdxnqJI8XuJNy/LM8FuFBNmrcLdRAf/MMM3wZJTjIezRx/tiKy6xAK9OSaf2PDqIgpMLh/0 dFGyWAe0t7LMIhGsyLkWWqP0tfo/vDpNgWv8j9yNys3fk1QDk1ND6WqOioZGCy+IEBTIxtN+NkIx5 OP5OQPtyBUKc3Q==; Original-Received: from [87.69.77.57] (port=1740 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 1ohnxj-00035g-CV; Mon, 10 Oct 2022 04:16:35 -0400 In-Reply-To: <5244C2EB-A319-4CDF-9F60-422798E29F95@gmail.com> (message from Yuan Fu on Sun, 9 Oct 2022 23:46:27 -0700) 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:297339 Archived-At: > From: Yuan Fu > Date: Sun, 9 Oct 2022 23:46:27 -0700 > Cc: Theodor Thornhill , > emacs-devel@gnu.org > > > Automatically and silently? I don't think so. The user should know > > the knob they pressed didn't work. > > Not silently, print a message, raise a user-error at the end, but don’t fail completely and leave the user in a broken mode. I suggest: > > (define-derived-mode mode > (if (and use-tree-sitter tree-sitter-works) > init-tree-sitter > init-non-tree-sitter) > > (if (and use-tree-sitter (not tree-sitter-works)) > ;; Or ‘message’. > (user-error "Tree-sitter can’t be enabled"))) Yes, this should leave the user with the original mode without tree-sitter. > If we think this is good, I’ll add it to the starter guide. Please do, and thanks.