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: Thu, 18 Jan 2024 21:12:43 -0800 Message-ID: <3C29CB93-925C-4C65-BCEA-6506F2D9E4BD@gmail.com> References: <83edeww73j.fsf@gnu.org> <83o7dzvrmf.fsf@gnu.org> <838r53vlo5.fsf@gnu.org> <831qavvcbo.fsf@gnu.org> <83bk9wq9ho.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="4777"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68246@debbugs.gnu.org, Eli Zaretskii , Stefan Kangas , joaotavora@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 19 06:14: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 1rQhCp-000166-Tf for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Jan 2024 06:14:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQhCc-0005Fz-4I; Fri, 19 Jan 2024 00:14:02 -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 1rQhCa-0005FZ-Fz for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 00:14: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 1rQhCa-0006aX-7O for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 00:14:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQhCc-0002Rq-5x for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 00:14: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: Fri, 19 Jan 2024 05:14: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.17056411879304 (code B ref 68246); Fri, 19 Jan 2024 05:14:02 +0000 Original-Received: (at 68246) by debbugs.gnu.org; 19 Jan 2024 05:13:07 +0000 Original-Received: from localhost ([127.0.0.1]:57229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQhBi-0002Pz-GY for submit@debbugs.gnu.org; Fri, 19 Jan 2024 00:13:06 -0500 Original-Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:42042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQhBf-0002PM-TH for 68246@debbugs.gnu.org; Fri, 19 Jan 2024 00:13:04 -0500 Original-Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6db79e11596so376683b3a.0 for <68246@debbugs.gnu.org>; Thu, 18 Jan 2024 21:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705641176; x=1706245976; 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=YarmSZRDcZIXn09/6PE9PrJI5I+Iwz56k8XrBEx5JHY=; b=ZCRLXASeUYO8nSNrRMxkQDXl0I/H303g01bgQXeRPkE+V3m+K3Y1FUuOtcyi6BQ4eI 3rBAZtJyNnnRgsqlY53nw7f3VIjEElmcwSyLwoRm912BdEGyFfo2bx9y9YtWT10WMpgR ob+yJbuyOoX9Jq5u/T6t5qvLVkkQSMpVr6j1dI3+ilvhVwtbO9I4vBcSNsndem0CsKtJ ZrTQqOV1rtMupZdLRNDJm+wZCmGiCeMskuiSwi6TdPm0mBx9zvqWAnwr+EvB3lyGRQj0 8KgGegAUk6xJmAVHy4q0kvKH3gJjZuTHJzPOPFORWZuKccFMKcDZdjHjMtSWO3+IVBHk R7Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705641176; x=1706245976; 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=YarmSZRDcZIXn09/6PE9PrJI5I+Iwz56k8XrBEx5JHY=; b=sMEo3y2dK14dHrz4ROuQzf7kTCoRS1qtQjkep+qq/b/3VzM5G7sMOF1UF2L20Q7fwd dTeURZ4GX5CutSYlr8BrtcOsHoO215Uyue2ihZd8Gya+cvRXJU2bynYNNKoI31qToxQ9 CSei+il1TkUKlXa+oLwpFJpU0Q3Kj/sscj8eTv8OHtKOtqpwz6WzbKD7QsDTmyh7l+/H bC46IFF/3yRyMoT0iCSqDEDbH6bsqpAnuAB1txt+aLDUUiDGztH70T1WRnQJCg1GSsoE loHvv6eUCL2Njn+gxulQVJI776yF9Apsd9bjxTzqRifjzgK8R0puAhpu9JpQVC8zuenW SPcg== X-Gm-Message-State: AOJu0YxUyFFfWGcHLhvoo8wlHVK1Z0xUduPzybGshWWhGYMphM+hlM8y /snGaLwDF4sJaxYnKQIrTzm0SP9huQQ7HDAICix408Wf2fS/fwik X-Google-Smtp-Source: AGHT+IGFUlPXQhdIDUBuTs+iexfL4O9g4nKrBrBtuEbvMphrKMfRg42EYlL0qdb8DE2eyO1j+MjT3w== X-Received: by 2002:a05:6a00:a8b:b0:6d9:ad3d:7d8 with SMTP id b11-20020a056a000a8b00b006d9ad3d07d8mr601569pfl.19.1705641175800; Thu, 18 Jan 2024 21:12:55 -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 fh4-20020a056a00390400b006d9b4a0b6e3sm4159340pfb.80.2024.01.18.21.12.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 21:12:55 -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:278471 Archived-At: > On Jan 15, 2024, at 6:32 PM, Stefan Monnier = wrote: >=20 >>> Please don't call it "language". That'd be confusing. LSP is about >>> programming languages, so "language" is natural there. But in = Emacs, >>> a major mode is more general than that. For example, it is not >>> unthinkable to consider mail-mode to be the extra-parent of >>> message-mode (or vice versa) -- but what is the "language" in that >>> case? >> Isn't the language for such modes in this paradigm just the empty = set? >=20 > I'm not too worried about those cases, indeed. > I'm more worried about the taxonomy of languages. > We currently have the taxonomy of major modes, with which we're pretty > familiar, and we've had many years to learn about its downsides, > complexity, as well as how to deal with them, but for languages we're > only familiar with the easy cases, which makes us judge the idea in > a way that may prove naive. I don=E2=80=99t have anything insightful to contribute, but want to = point out that in Emacs, =E2=80=9Clanguage=E2=80=9D doesn=E2=80=99t = always mean programming language. =E2=80=9CLanguage=E2=80=9D can also = mean Chinese, English, etc, and Emacs are quite often used for editing = natural language text. So it warrants some caution when using = =E2=80=9Clanguage=E2=80=9D to mean programming language specifically. >=20 > IME, deciding what is the type of the content of a buffer is usually > trivial but with some notable caveats, such as XPM or Postscript = files, > or "container formats" (like `.deb` or `.odt`, as well as things like > DocBook which can be considered either as their own format or as XML), > or "sublanguages" such as C being a subset of C++, or Javascript being > a subset of Typescript. And I suspect the info we need will not = always > be quite the same. >=20 > So while there might be a good case to be made to add some API = functions > to query the language/type(s) of a given buffer (I'm not sure we'd = need > the language of a given major mode, OTOH), or to find the preferred > mode(s) for a given language/type, I think it's worthwhile to try and > tweak our major mode taxonomy because it is information we must have > and information we know we will always have, so we should strive to = make > it as good as we can. >=20 > It shouldn't make it any harder to add language/type API = functionality. > On the contrary it should make it easier. >=20 > [ As suggested elsewhere in this thread, we could even try and merge > those taxonomies, e.g. using extra parents of the form `LANG-lang`. = ] >=20 > As I said at the very beginning of this long thread, I'm not = completely > sure how well my proposal will play out: the upsides are in plain = sight, > but it may bump into real problems. [ I'm actually surprised by Eli's > optimism about it =F0=9F=99=82 ] > But we won't know until we try it. >=20 >=20 > Stefan >=20