From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes Date: Sat, 20 Jan 2024 16:32:02 -0800 Message-ID: <02EBD96A-B040-46CF-9ED2-775A6696E1CC@gmail.com> References: <83h6joqz0t.fsf@gnu.org> <834jfoq86m.fsf@gnu.org> <831qarrbjx.fsf@gnu.org> <87a5p84nlh.fsf@gmail.com> <83edekfldq.fsf@gnu.org> <8e6935bc-2a60-4a14-8e63-d6057a7e2af7@gutov.dev> <1a0802a1-7c25-4188-9984-f54b0e56ab5e@gutov.dev> <83bk9gv640.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13567"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68246@debbugs.gnu.org, Dmitry Gutov , Eli Zaretskii , Stefan Monnier , Stefan Kangas To: =?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 Sun Jan 21 01:33:31 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 1rRLmE-0003Jl-A5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Jan 2024 01:33:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRLlp-0000Bi-79; Sat, 20 Jan 2024 19:33:05 -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 1rRLlk-0000Al-2u for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 19:33:00 -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 1rRLlj-00038T-OF for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 19:32:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRLlm-00085q-Cn for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 19:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jan 2024 00:33: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.170579714931064 (code B ref 68246); Sun, 21 Jan 2024 00:33:02 +0000 Original-Received: (at 68246) by debbugs.gnu.org; 21 Jan 2024 00:32:29 +0000 Original-Received: from localhost ([127.0.0.1]:36175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRLlE-00084x-W3 for submit@debbugs.gnu.org; Sat, 20 Jan 2024 19:32:29 -0500 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:43114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRLlA-00084h-5D for 68246@debbugs.gnu.org; Sat, 20 Jan 2024 19:32:27 -0500 Original-Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6dbb003be79so2019486b3a.0 for <68246@debbugs.gnu.org>; Sat, 20 Jan 2024 16:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705797135; x=1706401935; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qnJk+4FJSME82XTC93bsWF49b7+5dsoGUZ2XV6521q4=; b=YfXZbj6C8lyxGE77WS5Q5SWFHWQcF1kCgspY8oc8atAs5azeTSPBqi3clrkfnJOhNj HISjvOSNLY9Glzv91eHA6xb9tgbqjQRhVMz+eZ2/Ijv5UuyqQh/S1Ys9cICTXwj01FMJ qNR6qL4tbRQsL5GUDqbq1b/kGBbZ3mlEYeboXpvexYUm+O3xngMnFBNl0wS/Apn0mkY+ gmm3YOELfpw17RAdTzK2i3YqRBORGXu56ViAMaczNS+aMPMOwRAkGR/L2WG+r52E8msq K9q5uVJF3Jc7Quhm4pARVdAKPa3xTGnlTk/dOQzRESOibA+PfBI5XKR8n/V2cSpCejVF htoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705797135; x=1706401935; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qnJk+4FJSME82XTC93bsWF49b7+5dsoGUZ2XV6521q4=; b=sgWSg/7Ne2Bqs5oud6u3ctB4DcPqMYIyqAu5XnQhawiDWQ59A1GoJE0VsjiHof9mii WK4Pu1fnzZD6Tf3yvyKSLr28JMSOyrLsP+/4LPKkLPMF9+bxIEYo3kwy1/1A6P07LmEO H+VCLLIhuhazOpzYIeVZKm3DhB4OzFaLS9eGR2bzYVTgI5WKtZOPsT1DL4D6C3R9gttf /h49drUpy/ZZFCsDsSceXE8SEGVEDXbjTbfTob1XyuRzhgUFETbo7xkpgvixWzBwTjO4 XW8ySbN0bwPyRdcoaaufJcp1qiM+RBI2A/ntlLypmIx+Nuc71peL1l03JMd9CzAmRoiW ijwQ== X-Gm-Message-State: AOJu0YyDMg2l2NYX1drW04HSUUiIWu7Piyz5qY8VaTVaZDcBD8XE85e+ wq2hk+Zp+///xxd6MQmZNiXa5il0/lZcO4F01lRzseWrHFBGV6gK X-Google-Smtp-Source: AGHT+IFRmopTnJOp3Ny5FcQufim5sJO1zWxHS3uYQlP9MHxGlWeJtEmt3r5vfNwWPBkRb9qjRowNcw== X-Received: by 2002:a05:6a20:d399:b0:19a:797f:eac8 with SMTP id iq25-20020a056a20d39900b0019a797feac8mr221954pzb.46.1705797134979; Sat, 20 Jan 2024 16:32:14 -0800 (PST) Original-Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id m7-20020a62f207000000b006dbbc6ab938sm3453010pfh.199.2024.01.20.16.32.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2024 16:32:14 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) 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:278633 Archived-At: > On Jan 20, 2024, at 2:16 AM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > On Sat, Jan 20, 2024, 07:04 Eli Zaretskii wrote: >=20 >>> After it lands, derived-mode-p will cease to mean "A derived >>> from B via defined-derived-mode, so you can trust hook for B >>> runs in hook for A and a lot of other things". It will mean >>> something else. >>=20 >> Indeed, and it was not meant to mean what you suggest it should mean. >=20 > Then pray tell. What will it mean exactly? This patch has no doc > yet (last I saw). >=20 >>> * if it lands, we should document very well what that new meaning >>> of "-mode" is. Also make some "provided-mode-walk-parents" >>> so that at least problem 2 can be solved, by string-matching >>> the symbol name of what will now be an even more enshrined >>> convention. As to problem 3, maybe, it can be written off to >>> "major-mode-remap-alist" (which I doubt will ever see much >>> adoption) >>=20 >> Feel free to suggest improvements and clarifications to the >> documentation in these matters. >=20 > I don't understand the vision behind this patch. It has do doc > yet. Despite your attempts to wrap this up and shut me up > I'm trying to at least converse with the author to expound it. > Often it's when trying to explain something in plain English > that to see how suitable it is. >=20 >>> * if it doesn't land, we should look at some solution that solves >>> 1 2 and 3 cleanly. I think Dmitry's patch is a decent start. >>=20 >> Since it will land, there's no need yet to look for alternatives. >=20 > If you've already decided that, just install it and save > us all some time. >=20 >> We will consider alternatives or other ways to fix this when >> we have data >=20 > I've given you data: at least Eglot and markdown mode have brittle > hacks this patch does nothing for. You have chosen to ignore it. > Also I've explained how potentially dangerous this patch is to > Eglot customizations. >=20 >> We already use base modes where it makes sense. It sounds like your >> opinion is that we should use it much more radically, with which I >> disagree and will object to introduction of base modes that server no >> useful purpose by themselves. >=20 > So solving the common language-detection problem, deduplicating > hooks and dir-locals is not serving a purpose "by oneself"? > Indeed you make up an undefined high bar of "by oneselfness" > you get to choose what clears it and doesn't. But it doesn't > make your argument an argument. [I=E2=80=99ve been loosely following the thread so this might have been = brought up and I missed it] IIUC Stefan=E2=80=99s patch is trying to use xxx-mode to represent = =E2=80=9Cmode for xxx in general=E2=80=9D, sort of like the keys in = major-mode-remap-alist. And IIUC Joao and Dmitry are not very = comfortable with it because (mode-A R mode-B) where R is derived-mode-p = implicitly means mode-B runs mode-A=E2=80=99s hooks and major mode body, = and this patch would break that, which would bring a lot of confusion. Instead of using xxx-mode, can we set common-xxx-mode to the parent of = both xxx-mode and xxx-ts-mode? Or maybe abtract-xxx-mode, or just xxx, = the name doesn=E2=80=99t matter. The point is this is just a symbol and = doesn=E2=80=99t have hooks and other implicit things a major mode have. = It=E2=80=99s still a bit confusing, but it should be less confusing. We = can also add a variable common-mode-list or abstract-mode-list so these = symbols don=E2=80=99t seem to come out of nowhere. Yuan=