emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python minor-mode


From: Stefan Monnier
Subject: Re: python minor-mode
Date: Tue, 22 Mar 2022 04:07:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Andreas Röhler [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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]