From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#67008: 30.0.50; Multiple major mode parents Date: Wed, 8 Nov 2023 23:43:10 -0800 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23865"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67008@debbugs.gnu.org, Ikumi Keita To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 08:44:35 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0ziN-00060h-Jm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 08:44:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0ziE-0006W6-Gp; Thu, 09 Nov 2023 02:44:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0ziC-0006Vr-QH for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 02:44:24 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0ziB-0000Pb-Bq for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 02:44:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0zio-0005EY-BJ for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 02:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2023 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67008 X-GNU-PR-Package: emacs Original-Received: via spool by 67008-submit@debbugs.gnu.org id=B67008.169951585220034 (code B ref 67008); Thu, 09 Nov 2023 07:45:02 +0000 Original-Received: (at 67008) by debbugs.gnu.org; 9 Nov 2023 07:44:12 +0000 Original-Received: from localhost ([127.0.0.1]:46736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0zi0-0005D3-80 for submit@debbugs.gnu.org; Thu, 09 Nov 2023 02:44:12 -0500 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:60536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0zhv-0005CN-UX for 67008@debbugs.gnu.org; Thu, 09 Nov 2023 02:44:11 -0500 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1cc29f39e7aso4410815ad.0 for <67008@debbugs.gnu.org>; Wed, 08 Nov 2023 23:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699515803; x=1700120603; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XhuhfBVWvIQnlMELM+PvXiU178DjCVixnjN6Bgkk8FU=; b=OwPvOzCArNayATBNkyxvl9HApJ1aJucItpoLYkNUXngTXbk0SqJ36ZTt1A2gtUpD9v 4JA+G7Dnc0JzsHnAaI0sBhdyPZTh4r3fYD8FcvNkMpYUV4myCrNe3fcBwTjtmB8tJn01 eQVM0IgUVQ9ovct9KdwCEOEaYlRyj21+ubbkJwYRg+A8bE/tqFTkH0xYnb59685iNqy7 TQ+r/e05hHtZcaI9mPReOY9ja3uqmNSFBLO3mpC+3NfYE4WUi/EhV1NI/hUgPEkz8Md4 mjPijbNj/UWIylA3ZE1mi5uWlf4/guggTZNW42nS0F8CIwE+6oY/l7d2oHuwX1FkABkV /Rew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699515803; x=1700120603; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XhuhfBVWvIQnlMELM+PvXiU178DjCVixnjN6Bgkk8FU=; b=nPYb+Ap8rdNaIK5OafAbyD7zWoduzjFZ7DFoQaJYIuPRZwFP8CFjcuCMsw5x6CEl8f bd1XM98TBHhR96Dz2V7WS/qrd2byyLp5a3uSCs+3fgvHHtGseGiANNf4Y7JgNKzJ6OJR g623qlpG9JjrPLZ+GFWWUuMLHN52Cl3AbTkG6hJuO8pOF9YfRx5dBq4ScZvZHWR7RoRi lqgTj1riJp/mFDyJQsbj39TPIArFGFL0EuuPP5hA0qIG8461PyCTK3xWSOhirUE75RXV 5dHaPwc2GjDvXCIxkDOzHYuLFet5fTy6x4GuCXNRtgP8kP4B7LpxN3x8AvMd/KV6k3KM miJg== X-Gm-Message-State: AOJu0YyE4b54PD7ZOVAysu/GV+tbIBY8+Ifs36bOLrvf9kfnNe0yqMeF UL4J0gqkbuV0EbR86+aY5vc= X-Google-Smtp-Source: AGHT+IHer3BO19lzW4UIlZf0i0HLELJudjsIWym83Qoa7AeTxcaqo387JCABQqC7dloD7VoaPXMvgQ== X-Received: by 2002:a17:903:230c:b0:1cc:6e42:1413 with SMTP id d12-20020a170903230c00b001cc6e421413mr5076085plh.57.1699515802650; Wed, 08 Nov 2023 23:43:22 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id kx14-20020a170902f94e00b001c898328289sm2863534plb.158.2023.11.08.23.43.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2023 23:43:22 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274035 Archived-At: > On Nov 8, 2023, at 9:38 PM, Stefan Monnier via Bug reports for GNU = Emacs, the Swiss army knife of text editors = wrote: >=20 > Package: Emacs > Version: 30.0.50 >=20 >=20 > 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. >=20 > 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`. >=20 > 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. >=20 > I pushed to the branch `feature/derived-mode-add-parents` a bunch of > patches which add support for such limited form of `multiple > inheritance`. >=20 > 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: >=20 > - `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. >=20 > The patch also consolidates the code that linearizes the inheritance > hierarchy of CL classes, EIEIO classes, and major modes. >=20 > 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=