From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: python minor-mode Date: Tue, 22 Mar 2022 04:07:44 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17788"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Barry Warsaw To: Andreas =?windows-1252?Q?R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 22 09:09:50 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nWZaP-0004Of-TD for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Mar 2022 09:09:50 +0100 Original-Received: from localhost ([::1]:49440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWZaO-0002Rj-Bm for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Mar 2022 04:09:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWZYa-0001hS-CF for emacs-devel@gnu.org; Tue, 22 Mar 2022 04:07:57 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:29035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWZYX-00074l-GC for emacs-devel@gnu.org; Tue, 22 Mar 2022 04:07:55 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 518C880620; Tue, 22 Mar 2022 04:07:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 68E7D8050D; Tue, 22 Mar 2022 04:07:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1647936468; bh=FF9P29+SlfOILkyKF9sDuQeSeAMB+72FsfXMMtPU1cc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=puG8lGH9IonuB1oV39GtjfMcnQOg2+M5dPJDH6P4lU/XdhvBCKU8C4NS59ISqd7gs SMAhu43Fc7hwsveTypbGKpk9B24mvHDolU8sEH1V7RNU7i/s/APL6v9klt+H5hJxBm rdWB1D7Ip7mS+pDqFAj5/dsYzLxffRet+8Y+eluHNNVq0NiKdoOt19ho4rSL3m7oX3 4RL1OHxsaVoLBYdUSXN3lc35x8ybD1vxW3dbbWgQdkK/y+9KVaiRUpXB/QR19V70Wq W9YADQhV1sRMzjQgukoN6jcxquGpKzGG/B7oJlr3ZIuxEdhQjh5OLNWz1ZeCH/GqZI s4n4+95w35VcQ== Original-Received: from ceviche (a213-22-142-170.cpe.netcabo.pt [213.22.142.170]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 668611204F0; Tue, 22 Mar 2022 04:07:47 -0400 (EDT) In-Reply-To: ("Andreas =?windows-1252?Q?R=F6hler=22's?= message of "Mon, 21 Mar 2022 09:19:29 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287346 Archived-At: Andreas R=F6hler [2022-03-21 09:19:29] wrote: > Currently, both python.el and python-mode.el define a minor-mode called > "python-mode". Actually neither of them defines a minor mode. But yes, they both define a major mode with the same name. > Which may create some confusion. Yes, it's a sad situation. > Wouldn't it be more natural if both files provide modes according to > their filename? I.e. python.el should establish "python" as > minor-mode, python-mode.el sends "python-mode". As Eli explained, that's not really an option, not only because of the "-mode" tradition, but also because they should be using distinction prefixes for their code. See, for example in the `perl-mode` vs `cperl-mode` or `latex-mode` va AUCTeX's `LaTeX-mode`. So one of those two major modes should change their prefix from `python-` to something else. Given the number of years they have existed this seems rather unlikely to take place merrily. Another option (arguably the best option, at least for the end users) is to try and merge the two modes. I.e. push patches from one to the other so they can share as much code as possible, and when that can't be done any more, define the leftover code as a new derived mode built on top of the other. I don't really know how the two compare in functionality, but based on size, I'd guess that we'd end up with Emacs's python.el being the "core" mode and `python-mode.el` being the "derived" mode that provides extra features. Depending on how things end up, the derived mode could be replaced with a minor mode. In any case, it's a non-trivial job which would require someone to figure out all the details. Stefan