[Top][All Lists]

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

A new major-mode for Python

From: Fabian Ezequiel Gallina
Subject: A new major-mode for Python
Date: Tue, 15 Feb 2011 05:05:59 -0300

Hello Emacs devs,

I know the status of GNU/Emacs python.el has been discussed several
times on this list and I know there were some hopes for a merge
between python-mode.el[0] and python.el that never happened (mainly
because of Copyright issues AFAIK).

The thing is that I work a lot with Python and Emacs but I
wasn't happy with any of the available Python major modes.

I liked some stuff from the default python.el and some other from
python-mode.el and because of this I have come up with a *new*
major-mode[1] for Python which is based on the things I like and need
on a daily basis.

Most of the code is written from scratch. There are some parts that
are inspired by Emacs' python.el but I *never* used any of code you'll
find on python-mode.el in order to avoid Copyright issues in the case
there is some interest into merging this to the trunk.

The mode itself it's pretty solid, It's what I've been using for
almost a year now. After fixing a couple of things here and there, I'm
quite happy with the results.

I know the code is *not* perfect. I tried to be as clean as possible
and to name things the best way I could, but I'm not an Elisp guru,
and probably some parts of it are ugly at best (I'd like to receive
some pointers when that kind of stuff happens, since the idea is to
learn a little bit more about best practices).

Here is the list of what it currently implements:

    * Syntax highlighting

    * Solid (auto)indentation support

    * auto-detection of indentation levels for current file

    * Triple quoted strings support (stolen without guilt from
      GNU/Emacs' original python.el)

    * Fancy variable assignment colorization

    * Movement commands you’ll expect from a major-mode.

    * Python shell integration (not only for Python 2 but also Python 3!)

    * Python shell completion (Same as above!)

    * Nice generic shell integration that could support virtually any
      text based python shell

    * PDB Tracking (it even supports ipdb!)

    * Symbol completion that sucks because a running inferior shell
      process and valid code in the current buffer are needed (Don’t
      blame me, it’s like that in every python-mode I know). I don’t
      use this thing a lot, I use ropemacs instead

    * Eldoc support (this suffers the same drawbacks as the symbol
      completion, but it’s the only sane way to do it from Elisp)

    * add-log-current-defun support

    * hideshow support

    * outline support

    * fill paragraph

Things that (perhaps) are good to add at some point:

    * python-check
    * ffap support (I never used it though)
    * some skeletons (I never used them since I use yasnippet)

Things I don't think are necessary to be added:

    * Bicycle Repair Man integration: since it is discontinued and
      there are other really nice refactoring tools out there (like
      rope which can be integrated via ropemacs).

Since I'd love to contribute this to Emacs I don't have any issues in
signing papers for Copyright assignment.

In the meanwhile you can find this major mode at github[1].

[0] http://launchpadlibrarian.net/61970301/python-mode.el
[1] http://github.com/fgallina/python.el

Any ideas or suggestions are appreciated,
Fabián E. Gallina

reply via email to

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