GNU bug report logs - #68246
30.0.50; Add non-TS mode as extra parent of TS modes

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 4 Jan 2024 22:12:01 UTC

Severity: wishlist

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 68246 <at> debbugs.gnu.org, casouri <at> gmail.com, joaotavora <at> gmail.com
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Mon, 8 Jan 2024 20:57:13 +0200
On 08/01/2024 14:45, Eli Zaretskii wrote:
>> From: Stefan Monnier<monnier <at> iro.umontreal.ca>
>> Cc: Eli Zaretskii<eliz <at> gnu.org>,casouri <at> gmail.com,68246 <at> debbugs.gnu.org
>> Date: Sun, 07 Jan 2024 23:11:00 -0500
>>
>>>     (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?
> 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?
> 
>> Or maybe we want to take it from MIME types?
>> I'm sure there are other options out there.
>>
>> 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.
> File types also have problems: Emacs modes are sometimes defined for
> buffers that don't visit files.

Even if we call non-file-visiting buffers' contents "languages", I don't 
think anyone will have a heart attack or something.

But the "languages" thingy will mostly be useful when there can be 
several different major modes that can work on a given buffer contents. 
In most/all such cases, we would probably come up with a language name. 
E.g., for example, we have message-mode, but if we wanted to support 
alternatives, we could call the base "email-message". Or for different 
major modes to edit VC commit messages, we could call the language 
"vc-log-message".




This bug report was last modified 1 year and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.