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


Message #227 received at 68246 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>,
 João Távora <joaotavora <at> gmail.com>
Cc: 68246 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, casouri <at> gmail.com
Subject: Re: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Wed, 10 Jan 2024 03:18:47 +0200
On 09/01/2024 05:49, Stefan Monnier wrote:
>>>> Instead, we could have a mapping of files to "languages" and a separate one
>>>> from languages to major modes.
> `auto-mode-alist` maps from file names to languages/filetypes (where
> "major-mode like" symbols are typically used to represent
> languages/filetypes), and then `major-mode-remap-alist` maps from those
> languages/filetypes to actual major modes.
> 
> Of course, if you want to use other symbols for the content types, that
> works as well, e.g.:
> 
>      emacs --eval '(progn (add-to-list `auto-mode-alist `("\\.myf$" . text/html)) (add-to-list `major-mode-remap-alist `(text/html . html-mode)))' ~/tmp/foo.myf

That's very nice and concise, but it still leaves the issue of users 
being able to use a common hook for a family of major modes (for the 
same language). So I guess some inheritance-based solution is needed?

Or another integration for define-derived-mode which would run a hook 
with name derived from the name of the language.






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.