all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: 19908@debbugs.gnu.org
Subject: bug#19908: python.el: minimal cython indentation support
Date: Thu, 19 Feb 2015 21:27:23 -0300	[thread overview]
Message-ID: <CAELgYhdCywg3aHSBFV-VmBURaeqTcNbReH6fgMBdnDqrmhX9Mg@mail.gmail.com> (raw)

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	other threads:[~2015-02-20  0:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  0:27 Carlos Pita [this message]
2015-08-14 16:59 ` bug#19908: python.el: minimal cython indentation support Nathan Weston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAELgYhdCywg3aHSBFV-VmBURaeqTcNbReH6fgMBdnDqrmhX9Mg@mail.gmail.com \
    --to=carlosjosepita@gmail.com \
    --cc=19908@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.