From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter and major mode inheritance Date: Sat, 19 Nov 2022 23:39:37 +0200 Message-ID: References: <0249C656-21C8-49F2-B979-A1894BF80637@gmail.com> <1B76E73A-0DCD-456E-9F28-0E90723DA66D@gmail.com> <83sfif8cl2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1263"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, theo@thornhill.no To: Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 19 22:40: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 1owVZW-0000A8-6n for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Nov 2022 22:40:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owVZB-0005YK-Mr; Sat, 19 Nov 2022 16:40:01 -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 1owVZA-0005Xd-4P for emacs-devel@gnu.org; Sat, 19 Nov 2022 16:40:00 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owVZ7-0007to-Uj; Sat, 19 Nov 2022 16:39:59 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id e11so1579233wru.8; Sat, 19 Nov 2022 13:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=q61L4ovwB2/Pt8PDS3Xp/4GECoezHhqxsXipEyLMQJM=; b=Uwi4rwsGvS7v/XgxBvlKat+h5N6CKLAc8huPLFDZSKrG2+jrM1xvJWq53ZLPpmxfnq ZAkWQ0kuIfqVoZGh1PZ/sS1u5pvj+EG2fRc8F9adioN8dBucbKbaAiYfPYwS2ygikqAV sofY67Z++tJB8Oc2Ds67oCXRE5G8FMyciw+ZNunu5sKa+bLmdwycc/2tuC4OqKFQafK7 oajqugPJcND2UHVdPVUsBq0sEB45scYEhSW/Q2KpbvxZ/3JfMT++INLITI3xU/T4mEu3 VCadDfZ/rSO+wC23uoQxydFZiQmp+9ZpqIwgsGWFwXLSVY/Rtbg/6gkQ0EwpvjzWzmVa DcHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q61L4ovwB2/Pt8PDS3Xp/4GECoezHhqxsXipEyLMQJM=; b=Ic//CZmkkuEqHkAymVQXGGFJiBj5ez9niVmtBE3hMwi6/uNq2EmwvHZ0Rd+P6XKrms YxhbQrd0kFtJP5QUCBxC2J5lI0W80ob1mAiIvxlJaDB+1gs2ZA0yEteZty4vzqMUGr57 ReqdpFYuU8bJwtK65tBtDKMYIcYYMIE19mq38M0jFIoipU5ecEho7FIHjOpOAb4C99zW J1cGF7JtjPgzpeV4DS+RutI3tCgjKIt0EEfHUI3pZup4Izo2bnK4Xj9dJk6ESf3FVLk0 A+QVrAYEo2RgPCJdMdo0oqy7u40B7L8dd/2cVoMMVkT8a9sBDNhU+QvgRaq+db4/+Jy6 QSzA== X-Gm-Message-State: ANoB5pmoWRYbIbzlXQ19CU6cp1sP9VrzWAM65c8F2wyVXNntQdpZ0fZs NMQszc/3bCn4OnyaKTcgrNSpZBPHa3E= X-Google-Smtp-Source: AA0mqf69fuB3/8RHiILQM8MgLBk4uM+2ltSnZ6WzWH+mJy95DvzEJGX+X2ACOJAhYIJFm1SqPrDNnQ== X-Received: by 2002:adf:e28b:0:b0:241:c2c3:26c8 with SMTP id v11-20020adfe28b000000b00241c2c326c8mr4601807wri.278.1668893979737; Sat, 19 Nov 2022 13:39:39 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id e18-20020adfdbd2000000b0022da3977ec5sm7143295wrj.113.2022.11.19.13.39.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Nov 2022 13:39:39 -0800 (PST) Content-Language: en-US In-Reply-To: <83sfif8cl2.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=raaahh@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:300206 Archived-At: On 19.11.2022 12:26, Eli Zaretskii wrote: >> From: Yuan Fu >> Date: Sat, 19 Nov 2022 01:41:47 -0800 >> Cc: Stefan Monnier, >> Eli Zaretskii, >> Theodor Thornhill >> >> Anyway, does anyone think this is a good/bad idea? Should I go implement this on css, js, c, etc? It can also be the other way around: instead of having c-mode being the virtual mode, we can leave c-mode as-is, and have a c-base-mode inherited by c-mode and c-ts-mode. And similarly rss-base-mode, rss-mode, and rss-ts-mode. > I'd prefer leaving the original modes as-is. That should cause less > compatibility problems, I think. Eli, what's your solution for the problem, then? E.g. js-mode enables tree-sitter, and installs some stuff based on it. But js2-mode inherits from js-mode (meaning, it will run the same setup code, and then some of its own), yet it has its own parser. Which will cause all sorts of conflicts with tree-sitter.