From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67008: 30.0.50; Multiple major mode parents Date: Sun, 12 Nov 2023 11:41:35 -0500 Message-ID: References: <445405AC-C0DA-4914-984E-B42671AB536D@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67008@debbugs.gnu.org, Ikumi Keita , Yuan Fu , Dmitry Gutov To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 12 17:42:50 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 1r2DXt-0006FY-Mj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Nov 2023 17:42:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2DXT-0002MY-T1; Sun, 12 Nov 2023 11:42:23 -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 1r2DXR-0002M2-V2 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 11:42:22 -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 1r2DXR-0007Zw-Bp for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 11:42:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2DY6-0002rZ-BE for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 11:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2023 16:43: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.169980734610956 (code B ref 67008); Sun, 12 Nov 2023 16:43:02 +0000 Original-Received: (at 67008) by debbugs.gnu.org; 12 Nov 2023 16:42:26 +0000 Original-Received: from localhost ([127.0.0.1]:56846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2DXW-0002qe-I0 for submit@debbugs.gnu.org; Sun, 12 Nov 2023 11:42:26 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2DXU-0002qN-C5 for 67008@debbugs.gnu.org; Sun, 12 Nov 2023 11:42:25 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5DCB3440876; Sun, 12 Nov 2023 11:41:37 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1699807296; bh=zdiyGw4vlk2DnmxllCiBeCZuuE6enGs04WVBd28mJ2M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=go3Zccoi5vZ0yqKxPxIeCf5GSujtHTil3BaaWBc7drs7TlBrM9OeWBHMtUCGvZ/uf 9SS2Zo2Qcpt/WkfwBSVtB2FMu8PKv7BJDdEV3CeGC8OyfxeHDs+SXtPdTzXJTJRXnN D/FObI4nyRjnpMGsOH0PFY0Xa30B9cgBm5MMapUPLlqEywxdj4gfuhZ2oHA4mjjYUL DI7rdF1eIhLv759idFqP7WFSVAqJv3+7MRG6XGsNmo+dC8XgjX/bC2gd/mgfzzinX2 OKt+oSRGlr3o3s8MSgxSQ8+bZBwjgm/Lb1BD8YHOFpj5HAGZrHGQz9njNd9slpQKCZ kHp4JvG+UqLRA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3F56E4409DD; Sun, 12 Nov 2023 11:41:36 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 08DE51203DD; Sun, 12 Nov 2023 11:41:36 -0500 (EST) In-Reply-To: ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Sun, 12 Nov 2023 14:37:15 +0100") 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:274211 Archived-At: >> Having read a bit further, I'm now not sure that `merge-ordered-lists` >> implements C3. I suspect it provides a useful primitive with which to >> implement C3 but whether it gives the same result as C3 or not depends >> on how we call it. > Yes, the output seems very sensitive about the input order: > > (B A) (C A) (D B) (E D C) -> (E D B C A) > > (E D C) (B A) (C A) (D B) -> (E D C B A) Yes, that's on purpose: when the dependencies expressed by the (sub)lists don't enforce a unique solution, the order between the (sub)lists is used to choose between the available options. > Maybe that's obvious for someone who knows how to use it. I improved the docstring to try and clarify. > It could probably be used as a general-purpose topo-sorter but it's not > a very efficient one (at least quadratic, possibly cubic). Also it doesn't start from a graph but from a lists of lists (because for uses in method inheritance it's very desirable that the ordering be "monotonic": if A comes before B in the linearization of class C's parents then the same should be true in the linearization of all its subclasses). Stefan