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: Need for "-ts-mode" modes Date: Thu, 29 Dec 2022 19:42:08 +0200 Message-ID: <831qoi85u7.fsf@gnu.org> References: <877cyagmti.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 29 18:42:34 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 1pAwvK-0000BD-8d for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Dec 2022 18:42:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAwuk-0000pb-48; Thu, 29 Dec 2022 12:41:58 -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 1pAwui-0000pN-3J for emacs-devel@gnu.org; Thu, 29 Dec 2022 12:41:56 -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 1pAwug-0001r7-EW; Thu, 29 Dec 2022 12:41:54 -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=uvXU07XFFxMNNKzKMbfDKrCf+IgvPdQ3urqE/SPcvVY=; b=VU7Ifc29fbR5 Lh1MYqTkFSlAQGWsAMoUPnNVw5hmVawDZ5JKPEC1K+yu2CJxk81UsFoAOaVRtuXsAmTbZu42uEpqo NTIJdUvynexi2247y9FJvf14C280xP6vFOCya20APXdOkY50AWCKOKLgZhBV1OlIf8IduTHWWNQWR eAVQ7LdrbYfDsV39zbW1uBUEw6/uPSH7L/XL9KHJmUQApM/TLn/70pQ0TJ8Yy96kjWoPzzm1kajc9 FdhwdT/UV83W5pEkCMQcZvFqjEIdfSRtpKrt0av9YTwk+18hi/+/EKI4dgnrR409sRj+x7mJ10zEy +DQAHF99eIwBcHQXxdRfuw==; 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 1pAwuf-0000rM-Pa; Thu, 29 Dec 2022 12:41:54 -0500 In-Reply-To: <877cyagmti.fsf@posteo.net> (message from Philip Kaludercic on Thu, 29 Dec 2022 17:08:09 +0000) 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:302053 Archived-At: > From: Philip Kaludercic > Date: Thu, 29 Dec 2022 17:08:09 +0000 > > The issue has been discussed before, but I failed to understand the > point of duplicating a lot of modes Because this was the simplest way, that created no complications, neither to users nor to the code, and could be added in backward-compatible ways. > or creating new modes that depend > on tree-sitter and that don't work or even try to provide some fall-back > if the library is not available. I fail to see what's wrong with that. It is entirely legitimate to have a major mode which depends on an optional feature and doesn't work without it. Besides, we've lived this far without major modes for those languages, so adding a tree-sitter based one cannot possibly do any harm, it can only make things better for Emacs. > Or the re-phrase the question, why can't tree-sitter support be > implemented by extending `define-derived-mode', ideally in such a way > that can be translated to some kind of font-lock rules for basic syntax > if the library is not installed. Because it doesn't work. Tree-sitter supported modes are not derived modes, they are completely different modes with different settings which make no sense when tree-sitter is not used.