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: João Távora <joaotavora <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, Eli Zaretskii <eliz <at> gnu.org>, casouri <at> gmail.com, 68246 <at> debbugs.gnu.org
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Tue, 9 Jan 2024 10:52:21 +0000
On Tue, Jan 9, 2024 at 3:49 AM Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> 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

OK, I get it.  This form above is very elegant.

I had already understood the gist from Dmitry's  email and if
more symbols are allowed there (notably symbols with names
matching the MIME type hierarchy), then I think it's mostly fine.

"Mostly" because of the fact that cdrs of entries in m-m-r-alist
are supposed to be functions and major-mode is a symbol, which
makes for brittle reverse lookups.

And then there's still the work of filling it in and changing
auto-mode-alist.  This is mostly mechanical work though.  I can
volunteer if this approach is validated.

Also, writing m-m-r-alist is not incompatible to passing a
:content-type keyword arg to define-derived-mode, which
I still think is the most natural way to maintain this
database.

João




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.