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: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 68246 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, casouri <at> gmail.com, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Tue, 9 Jan 2024 01:31:25 +0000
On Tue, Jan 9, 2024 at 1:10 AM Dmitry Gutov <dmitry <at> gutov.dev> wrote:

> Perhaps we should have entries like ("\\.js\\'" . 'js-lang) in
> auto-mode-alist and then map the symbol to the specific major mode in
> major-mode-remap-alist. But for this to be useful to determine the
> language of a major mode via reverse lookup, all/most programming
> language modes will need to be featured there, rather than this being
> optional and used only for custom overrides.

That clarifies how it would be used, thanks.  But in addition to the
problem you note, there's the fact we would have many new foo-lang
functions and the cdr of that m-m-r-alist is specified to be a function
object, while  major-mode is supposed to be symbol, so a bit brittle
for  reverse lookup.

The simplest way to do that reverse mapping is still just adding an
optional entry to a mode symbol's plist.




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.