Patches item #1588272, was opened at 2006-10-31 16:35
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1588272&group_id=86916

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Carl Banks (aerojockey)
>Assigned to: Skip Montanaro (montanaro)
Summary: Better nesting of data structures

Initial Comment:
Currently, python-mode produces unpleasant results when
a statement has multiple open braces at the end of a
line.  

Normally, when a open brace/bracket/parenthesis ends a
line, the following line is indented relative to the
first by py-indent-offset characters.  However, when
another such open brace is nested inside the first, the
indentation of the following line remains relative to
the first line of the statement.

We would like nested data structures to be indented
like this:

a = {
    "b1": {
        "c2": 1,
        }
    }

However, python-mode does this:

a = {
    "b1": {
    "c2": 1,
    }
    }


The supplied patch changes the indent calculation to
account for nesting of braces.  I've been using it for
awhile without problem.  I run GNU Emacs 21.4.1 on
Debian Linux.

The patch uses an undocumented tenth return value
parse-partial-sexp, so I suspect it might not work in
some versions of Emacs.  I hope I didn't break any
etiquette by posting the patch without checking this,
but I wanted to get it out there.

----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2006-10-31 18:35

Message:
Logged In: YES 
user_id=44345

Thanks Carl.  That was easy. It worked for in in XEmacs 21.5b25.  If necessary 
we can tackle older versions.  Checked in 
as python-mode.el v 4.79.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1588272&group_id=86916
_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

Reply via email to