all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 67008@debbugs.gnu.org, Ikumi Keita <ikumi@ikumi.que.jp>
Subject: bug#67008: 30.0.50; Multiple major mode parents
Date: Wed, 8 Nov 2023 23:43:10 -0800	[thread overview]
Message-ID: <F9C9B94F-01C2-4F2B-884B-DEE79BEF4826@gmail.com> (raw)
In-Reply-To: <jwvbkc3mqpd.fsf@iro.umontreal.ca>



> On Nov 8, 2023, at 9:38 PM, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
> 
> Package: Emacs
> Version: 30.0.50
> 
> 
> While it seems difficult to add support for multiple inheritance to
> `define-derived-mode`, it's fairly easy to allow a major mode to declare
> itself the spiritual heir of various other major modes beside the one
> from which it actually inherits.
> 
> We already have some very basic such cases in our own code:
> - `locate-mode` inherits from `special-mode` but declares itself
>  as a child of `dired-mode`.
> - CEDET declares that `c++-mode` is a child of `c-mode`.
> 
> I'd been toying with this idea for a while because it has seemed useful
> a few times, tho until now there seemed to be good enough alternatives.
> But in order to really support AUCTeX modes well, we do need such
> a thing: we need `LaTeX-mode` to be able to declare itself as a child
> of `latex-mode` (even tho it does not inherit from it) so that
> directory-local variables are properly applied to it, which is
> a fairly common use case.
> 
> I pushed to the branch `feature/derived-mode-add-parents` a bunch of
> patches which add support for such limited form of `multiple
> inheritance`.
> 
> The patch is fairly large because it goes through all the code that
> uses the `derived-mode-parent` property and adjusts it to use
> a few new functions:
> 
> - `derived-mode-set-parent` and `derived-mode-all-parents` cover
>  basically all previous uses of the `derived-mode-parent` property.
> - `derived-mode-add-parents` to declare additional parents.
> 
> The patch also consolidates the code that linearizes the inheritance
> hierarchy of CL classes, EIEIO classes, and major modes.
> 
> You can see below the corresponding commit log.
> There are no doc (or etc/NEWS) changes yet.
> Any comment/objection?

Great work! Thanks! I need to find some time to read through the changes, but sounds promising.

Yuan




  reply	other threads:[~2023-11-09  7:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  5:38 bug#67008: 30.0.50; Multiple major mode parents Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-09  7:43 ` Yuan Fu [this message]
2023-11-12 22:11   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 15:16     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-11  0:01 ` Dmitry Gutov
2023-11-11  4:23   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-11 10:14 ` Mattias Engdegård
2023-11-11 16:20   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-11 18:12     ` Mattias Engdegård
2023-11-11 18:43       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-11 20:13     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-12 13:37       ` Mattias Engdegård
2023-11-12 16:41         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-13 12:45           ` Mattias Engdegård
2023-11-13 13:30             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-13 16:44               ` Mattias Engdegård
2023-11-13 17:46                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 11:07                   ` Mattias Engdegård
2023-11-16 15:15                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 19:35                       ` Mattias Engdegård
2023-11-16 21:40                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-17 14:04                           ` Mattias Engdegård
2023-11-17 14:20                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-17 16:15                               ` Mattias Engdegård
2023-11-11 12:21 ` Ikumi Keita
2023-11-11 16:57   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-12  9:50     ` Ikumi Keita
2023-11-12 16:04       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F9C9B94F-01C2-4F2B-884B-DEE79BEF4826@gmail.com \
    --to=casouri@gmail.com \
    --cc=67008@debbugs.gnu.org \
    --cc=ikumi@ikumi.que.jp \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.