tags:

views:

112

answers:

2

I 'm just starting to use Python, but I'm a very experienced emacs user. I'd trying to decide between python.el and python-mode.el (or any other equivalent mode people can suggest).

Currently I'm leaning strongly towards python-mode.el, mainly because it has a useful "indent-region" method...

However, there's a couple of features of C-mode that I seem to lack in both modes which is go to the next/previous function (c-beginning-of-defun) (this differs from py-goto-block-up in that 1) there is no py-goto-block-down, and 2) you can use c-b.... to scroll up through multiple functions, but the py-.. only goes out levels)

Also, since C has braces, etc, it's easy to find the beginning/end of a current section. py-goto-block-up gives me the beginning of a block, but there is no equivalent for the end of the block...

thanks

+3  A: 

There are C-M-a and C-M-e in python-mode. They go to start and end, respectively, of the current def or class. They're mapped to beginning-of-defun and end-of-defun by default.

There's also C-c C-u, which is mapped to python-beginning-of-block. My python-mode doesn't map python-end-of-block by default, but it's there too.

Nathon
yes, but they only work for top level stuctures, like def and class... you can't use them for finding the end of a forloop...
Brian Postow
Ah, for some reason I thought you already had `python-[beginning|end]-of-block`. Edited.
Nathon
+1  A: 

I find pdbtrack (part of python-mode.el) invaluable

matt harrison