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: Tree-sitter and major mode inheritance Date: Sun, 20 Nov 2022 16:49:49 +0200 Message-ID: <83bkp165pu.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33486"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, theo@thornhill.no To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 20 15:50:06 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 1owle1-0008Vx-Oc for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Nov 2022 15:50:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owldf-00076Q-NH; Sun, 20 Nov 2022 09:49:43 -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 1owldd-000762-H0 for emacs-devel@gnu.org; Sun, 20 Nov 2022 09:49:41 -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 1owldc-0007im-Q4; Sun, 20 Nov 2022 09:49:40 -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=xsokKaZfgnJBgSDFvSVqFQmESsQKmuN1EyD8j4Utxo4=; b=GE3BYGCptT+K 2jaeU+lRDmHw9DB0dEnJv1XWl8fEIGnR8OySK+8u5XVKSJT3MfBvwsWZrKN8VrZF9eA16jXiGPeWF 3CUFRHHxS1z/S0i73kRqmpVImIxfQqmdes66t3F8YW/P01tpKqzRWw94zq/NGUjYxC7ZCdOQA5ASf XMkJtwD+m69EqTAZDgjpZHM2U3HKJ1CHPehnKPQ654BnwH/FvcsBvZPz/wD4myUJYQH1KK/2xEgQC jj1kxGdOuJOFSVGqLsf0UzvAzMJaqdgfpD4zvUfqcGw47O6cNXEiix/atX0r1cdakIZjMVxhr0qmB 9XLjpAFnEu67UzCmECJnPQ==; 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 1owldc-00013f-1z; Sun, 20 Nov 2022 09:49:40 -0500 In-Reply-To: <3eeed6e3-c562-96b9-fb05-6588616cce0a@yandex.ru> (message from Dmitry Gutov on Sun, 20 Nov 2022 15:22:40 +0200) 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:300248 Archived-At: > 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)) ? 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?