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.bugs Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes Date: Mon, 8 Jan 2024 21:04:30 +0200 Message-ID: References: <83edeww73j.fsf@gnu.org> <83o7dzvrmf.fsf@gnu.org> <838r53vlo5.fsf@gnu.org> <831qavvcbo.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="21753"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 68246@debbugs.gnu.org, Eli Zaretskii , casouri@gmail.com To: Stefan Monnier , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 08 20:05:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rMuvz-0005RE-3K for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jan 2024 20:05:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMuvj-0001sh-E7; Mon, 08 Jan 2024 14:04:59 -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 1rMuvg-0001sG-CL for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 14:04:56 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMuvg-0001mF-4J for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 14:04:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMuvm-0005fy-4b for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 14:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jan 2024 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68246 X-GNU-PR-Package: emacs Original-Received: via spool by 68246-submit@debbugs.gnu.org id=B68246.170474068821796 (code B ref 68246); Mon, 08 Jan 2024 19:05:02 +0000 Original-Received: (at 68246) by debbugs.gnu.org; 8 Jan 2024 19:04:48 +0000 Original-Received: from localhost ([127.0.0.1]:37583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMuvY-0005fU-3x for submit@debbugs.gnu.org; Mon, 08 Jan 2024 14:04:48 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMuvV-0005fE-0n for 68246@debbugs.gnu.org; Mon, 08 Jan 2024 14:04:45 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 46C8B5C0775; Mon, 8 Jan 2024 14:04:33 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 08 Jan 2024 14:04:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704740673; x=1704827073; bh=S9jhgwK19aIZMEl0qL3Fi8dizO4ypb4wDWSjtvtyujU=; b= JQOyGMmNxDRj5FBrmmPvn+yJdo/0cXpRFLhsEJAL/gB+H93BzONSQJMqrJ9XbHr3 LMoUkgWhVP4vfm7jadagirPDJlJaaxhj9uhRMDOsJs7CZV/cCyeRqUCsmm18Jhg2 RZ47/Y1G54WKKrYK/0fhyG5MZVu/dZtedkCMTWeHLI42bgERuXFYPRS3+YDokeve ZxmYtb+Q+JUlvn0Pag8dKyqnEKH2/cXbfPgJx+szk1YM1Qcenfwrq2Sok9XB/WrZ SCL+vmIIdP3GHbOU3umB2B4/a7g05Gb93NT+X9vFxeS0KOa8FeJDEr2gxTwE4ZL0 UrKHoAoZOKWtSEb/CUo4mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704740673; x= 1704827073; bh=S9jhgwK19aIZMEl0qL3Fi8dizO4ypb4wDWSjtvtyujU=; b=L D9VEa7mMsNVQQZEy3a+2WoZZLggJuYH3ehqw4QB5sMISWZcgqnCYsjjSZhTRyPfk hwkhhOSMcVahET7am7yT1vjtMc/oNz4G/QrJvbQC0Tz3fh4ljvvBGAvglgi0EDOc uI9+U7K2Omig3qa2/c+AHRlEju4ASMxToo9++gDCs6yJN04Wel9p5pupH9MPLBeL nbLXIGAiHELzfWc0PWjX8GEG3sIa/cqBVCBTkkeNswPoKU89oHdRzea9yPVVFPjx f+NADgbucp1/mLB+9XwBx75f0PIR+aqznDZoIcs9HCiqBN6n1+cJYK3PiEF+moki 2QfVcFYY/c1/gbQnshfFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehjedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jan 2024 14:04:31 -0500 (EST) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277572 Archived-At: On 08/01/2024 06:11, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: >> (set-language-for-mode 'foo-ts-mode 'foo) > > Maybe we want to introduce this concept, indeed. > > maybe we want to that notion of "language" from elsewhere, such as > the one used in LSP? > Or maybe we want to take it from MIME types? > I'm sure there are other options out there. I think the precise source of the mapping is not that important. We might as well continue maintaining auto-most-alist, interpreter-mode-alist and magic-mode-alist by hand. Or indeed learn to populate them from the MIME database later. What we have, though, it different major modes duplicating auto-mode-alist entries even inside the core Emacs. Such as c-ts-mode having modified copies of forms that originate from CC Mode. Or ruby-mode and ruby-ts-mode using two copies of the same regexp. Etc. Instead, we could have a mapping of files to "languages" and a separate one from languages to major modes. And one could fetch the "language" for the current buffer using 'rassoc'. > Problem is: they come with their own complexities and corner cases. > After all, this is inevitable when you create a taxonomy. > IOW, while we *may* want to add support for an explicit notion of "file > type", it's a whole problem in itself and it will not solve all > our problems either. > > In the mean time, I think `derived-mode-add-parents` is worth a try. > As mentioned in some message up-thread, I'm not 100% confident that it > won't introduce serious breakage. But I think we do need more > experience and installing my patch is a good way to do that. This would've worked better inside the Emacs 29.1 release (which contains a few other "expedient" solutions). I'm guessing it won't get into 29.2 either. So the users of such versions would have to deal with the existing taxonomy anyway, and half-measures might also serve to make people more confused about what works in which version and why.