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: Sat, 11 Nov 2023 11:57:02 -0500 Message-ID: References: <51598.1699705296@localhost> 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="7039"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67008@debbugs.gnu.org To: Ikumi Keita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 11 17:57:47 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 1r1rIp-0001ei-1p for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Nov 2023 17:57:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1rIR-0008ID-Ai; Sat, 11 Nov 2023 11:57: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 1r1rIQ-0008Fo-G6 for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 11:57: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 1r1rIQ-0002jg-7P for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 11:57:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1rJ4-0006ZF-B0 for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2023 11:58: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: Sat, 11 Nov 2023 16:58: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.169972187225229 (code B ref 67008); Sat, 11 Nov 2023 16:58:02 +0000 Original-Received: (at 67008) by debbugs.gnu.org; 11 Nov 2023 16:57:52 +0000 Original-Received: from localhost ([127.0.0.1]:54388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1rIt-0006Yq-Ul for submit@debbugs.gnu.org; Sat, 11 Nov 2023 11:57:52 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1rIr-0006Yc-P9 for 67008@debbugs.gnu.org; Sat, 11 Nov 2023 11:57:50 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A7CE91000AD; Sat, 11 Nov 2023 11:57:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1699721823; bh=3ev+cA3VfYpNOiMcQW381GjDcO2wfk29wMqKEU5Y+Hk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jARBkKi/FJ6PCoLqhiXaR1++wiMfdlDxNExKnzPvdZ1AmAiH7RCeMKrI3s9ykcTS/ hSI6jT50qbjwjO9/z/YG6r6z/+wMCEbOsd+l5gCeHuHgFwSfNjAi2FiD9jcVuLXoIG tc7eXpaHqwCh5ykmYZicOrAsFJ820F7/8QCEddz7dk3s6G2XimZWH26OysHIGKCocg 8RYO1pJZWq9IC1prmFoSBAiHdi1620KZnVuAemPzd9KhfXWeLiRxQd/eqWGXyNALjm S15yGQtCIiWuxL2jk7lozQiUAAszHESSWZhKDdOtr/X76SJw6hTCpxO+U2ddpiSKUY gZNAm5hg23r5w== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F0364100061; Sat, 11 Nov 2023 11:57:02 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CA78C1200DB; Sat, 11 Nov 2023 11:57:02 -0500 (EST) In-Reply-To: <51598.1699705296@localhost> (Ikumi Keita's message of "Sat, 11 Nov 2023 21:21:36 +0900") 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:274167 Archived-At: > I tried the branch with the attached tentative addition to AUCTeX > feature/fix-mode-names-overlap branch. I tested two modes, namely latex > mode and japanese latex mode, with the second attachment to see whether > the directory local variables stored in the .dir-locals.el are reflected > or not. Thanks for testing :-) > For latex mode, it works as expected. Thank you, it is promising. Great. > On the contrary, it fails for japanese latex mode with the error: > File mode specification error: (error Cycle in the major mode hierarchy: japanese-LaTeX-mode) > I think the reason is that AUCTeX has > (defalias 'japanese-latex-mode #'japanese-LaTeX-mode) > for backward compatibility. Oh, I see so `japanese-LaTeX-mode` declares `japanese-latex-mode` as an extra parent but the alias makes it a cycle. Admittedly, in the current `provided-mode-derived-p` code, we actually don't signal errors in case of cycles, we just silently break them via de-duplications, so I just changed my code accordingly. > This new feature of multiple inheritance would work well for category > [a], which retains backward compatibility by `major-mode-remap-alist' > and doesn't use defalias. However, it doesn't work for category [b]. I believe with the code I just pushed it should work fine for [b] as well. > It seems to me very difficult to arrange the proposed feature to cover > category [b], looking at its way to handle mode alias. Maybe there's something I'm missing, but the change was simple and I believe it does address your use case. Stefan