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: Sun, 20 Nov 2022 17:24:59 +0200 Message-ID: References: <0249C656-21C8-49F2-B979-A1894BF80637@gmail.com> <1B76E73A-0DCD-456E-9F28-0E90723DA66D@gmail.com> <83sfif8cl2.fsf@gnu.org> <43E997E4-3449-4974-AB8C-BD5A4AA8A738@gmail.com> <2ccc9409-36ae-9bb5-127f-bb77a8b59460@yandex.ru> <6D0D24A7-7A7B-4D8E-A267-1FA752071C68@gmail.com> <8335ae6q5y.fsf@gnu.org> <3eeed6e3-c562-96b9-fb05-6588616cce0a@yandex.ru> <83bkp165pu.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="1490"; 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: casouri@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, theo@thornhill.no To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 20 16:25:51 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 1owmCb-00007S-Ce for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Nov 2022 16:25:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owmCC-0001mJ-Sf; Sun, 20 Nov 2022 10:25:24 -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 1owmCA-0001lw-JQ for emacs-devel@gnu.org; Sun, 20 Nov 2022 10:25:22 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owmC8-0006mX-N1; Sun, 20 Nov 2022 10:25:22 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id d1so4340235wrs.12; Sun, 20 Nov 2022 07:25:03 -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=bRXRQ1Pr3NVYUoeo+pmIvL6zbS3End8UBzUFtExXrRs=; b=IwQnZL3z53gSipxtPyN+q2CSjFwmHPlVXgKjfQFZLRIOsmVvcPsXqwFVYkj62m/58q Zj2setREjBUtVawRDfyo8tPEQT+Ml3wd9J1os8RsbYJWgWuee3fX6DuCfd8CzKQ4v0xG /OvOtWGzp3ns8gC6rZc9cbEewD7Spyg/+d1TTVmhvYmpXms/UZccL07qhrukcHV81hFC g0KILrG2P2rx7BWfvHMP5LXA4bWLIxQnFI7iEjA8SPhnPfdXQ86Wc9jFctYVvVJ0t02K pYe9jwDSlm9cTFpZYqACTcSI10ihf5bGAdty6+x6jvigqRqMJLtvEIkROCbXdQjK/foG kjTw== 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=bRXRQ1Pr3NVYUoeo+pmIvL6zbS3End8UBzUFtExXrRs=; b=yLAWJRVNjvKKDld5pSnKlUvYrSyaXD7fnDfqjm+y8HNTH3BdqLH1ATqS3BJ7woBcJI 1YptDmTYdk+dXLESDyxJ9P5XzWhPLFdi6ew69BNMJnYEebrTJItf3XuAx+Ixc3qXpulu v3NFsiZIBG6/ZqG2yvTGXt8t9jSKoybsWqXwk6/84vL7jnkMAnptLKmw6zkCpk7yLxCE ytchiD9buI8aqKBukjYlwgJc2YN3kbOzncnRWrVthLgov7uRot8YjFDnGqTe+ADRYxU5 WOwj+vDvKLooTcDaMu+o8+a1OEnYPoNmTXJkBbH8FzjWqI/xTbYzrtHCSFnmcoAVW6EQ 5Bqw== X-Gm-Message-State: ANoB5pnsd2ivRuGP4IUVxoxU2kvHBQ00d0QOJSmMu9mEVR+8lyjRZFHk 8ep3jOuFBHVVdFvcM92PaqCCL7Filnk= X-Google-Smtp-Source: AA0mqf7bl7XnKfF2sLC+darE2SZ/FEe+BxvvbGlasKjoSr6WdWaELtVqbRp2cZHT2chWpEtbxy80wQ== X-Received: by 2002:a5d:4484:0:b0:241:9b26:d18e with SMTP id j4-20020a5d4484000000b002419b26d18emr8570616wrq.548.1668957902199; Sun, 20 Nov 2022 07:25:02 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id s18-20020adfdb12000000b00241727795c4sm10706762wri.63.2022.11.20.07.25.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Nov 2022 07:25:01 -0800 (PST) Content-Language: en-US In-Reply-To: <83bkp165pu.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.179, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, 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:300251 Archived-At: On 20.11.2022 16:49, Eli Zaretskii wrote: >> Date: Sun, 20 Nov 2022 15:22:40 +0200 >> Cc: casouri@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, >> theo@thornhill.no >> From: Dmitry Gutov >> >>> This is a >>> fragile assumption, so code which is based on it is broken and should be >>> fixed. >> >> Okay then, but then we'll need to learn another way to ask that >> question. > > I guess. I admit I didn't know derived-mode-p was being used for such > tests. > > Would it make sense to use alternatives, as in > > (or (derived-mode-p 'js-mode) > (derived-mode-p 'js-ts-mode)) > > ? Those kind of lists are going to be inherently non-exhaustive. > Or maybe we should add a new predicate, which will take a LANGUAGE argument, > and use some database of known modes internally to call derived-mode-p as > above? Some kind of new registry could be the answer, but it would be nice to manage using the existing tools/variables somehow. Stefan has touched on this issue in https://debbugs.gnu.org/58075