Indenting in Emacs

Michael Hoffman cam.ac.uk at mh391.invalid
Thu Jun 21 05:11:41 EDT 2007


eugene.morozov at gmail.com wrote:
> Hello,
> Does anyone know how to make python-mode correctly indent nested lists
> and dictionaries. I hate indenting Django url patterns and Zope
> Archetypes schemas by hand, because python-mode indents them in
> incorrect and ugly way.
> 
> Here's how it should be:
>     StringField('reference',
>                 widget=StringWidget(
>                        description='Position reference'
>     )),
> 
> Here's how python-mode indents this code:
> schema = BaseSchema.copy() +  Schema((
>     StringField('reference',
>                 widget=StringWidget(
>     description='Position reference'
>     )),

I get:

schema = BaseSchema.copy() +  Schema((
     StringField('reference',
                 widget=StringWidget(
                     description='Position reference'
                     )),

I'm using py-version "$Revision$." Oops! Anyway, try to install the 
latest python-mode, whatever that is, if it isn't 4.78.
-- 
Michael Hoffman



More information about the Python-list mailing list