bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19908: python.el: minimal cython indentation support


From: Carlos Pita
Subject: bug#19908: python.el: minimal cython indentation support
Date: Thu, 19 Feb 2015 21:27:23 -0300

X-Debbugs-CC: fgallina@gnu.org

This isn't a bug in python.el at all. But as it tries to be so smart at
indenting it could be difficult for inherited modes to leverage this
cleverness.

What is needed for cython-mode indentation to work (AFAICS):

* To add cdef, cpdef, enum, struct, union, IF, ELIF and ELSE as
  block starters.

* To add ELIF and ELSE as dedenters.

* To add cdef and cpdef as defuns.

Hopefully the above will also make navigation commands to work with
cython source.

It would be pretty easy to add this directly into python.el (but a
kludge, except you plan to support cython directly). I've done it in my
working copy of python.el and seems to do the job quite well.

This report is about finding a good extension point for the above, in
order to make possible cython-mode to better extend
python-mode. Briefly, it's necessary to extend python-rx-constituents
some way, and at compilation time. Maybe it's already possible in a
clean way I'm not aware of. Or maybe you plan to support cython directly
(+1 it shouldn't be difficult at all).

I will gladly add a pull request to the cython project in github with
the result of the discussion and suggestions here. Or help integrating
cython-mode.el into python.el. In it's current shape cython-mode
indentation and navigation really sucks.

Cheers
--
Carlos





reply via email to

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