From noreply at sourceforge.net Tue Oct 31 23:35:17 2006 From: noreply at sourceforge.net (SourceForge.net) Date: Tue, 31 Oct 2006 14:35:17 -0800 Subject: [Python-mode] [ python-mode-Patches-1588272 ] Better nesting of data structures Message-ID: Patches item #1588272, was opened at 2006-10-31 17:35 Message generated for change (Tracker Item Submitted) made by Item Submitter 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: Open Resolution: None Priority: 5 Private: No Submitted By: Carl Banks (aerojockey) Assigned to: Nobody/Anonymous (nobody) 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1588272&group_id=86916