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: Stefan Kangas <stefankangas <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>,  Eli Zaretskii <eliz <at> gnu.org>, Yuan Fu <casouri <at> gmail.com>
Cc: 68246 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Fri, 5 Jan 2024 11:03:46 -0800
João Távora <joaotavora <at> gmail.com> writes:

> In summary, my position is that regardless of Stefan's patch, which
> I'm not opposed to, we should:
>
> 1. Use add-derived-mode-parents sparingly and consider foo-base-mode when
> possible.

I agree that inheriting from a `foo-base-mode' is a good way to reuse
code between different modes.  It's easy to think of examples of where
this will be useful: looking up some documentation, running a REPL,
interacting with a debugger, and so on and so forth.

But even if we added all the base modes today (as empty stubs), AFAIU it
wouldn't solve the exact problem that Monnier's patch is addressing,
namely to make packages and customizations work in both foo-mode and
foo-ts-mode even if they only say:

    (derived-mode-p 'foo-mode)

So I'm not sure doing one excludes the other, or that one should be
considered preferred over the other.  IOW, I'm not sure about the
recommendation to use `add-derived-mode-parents' sparingly, as that
would seem to defeat the point.

Am I missing something?




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.