From: Barry Warsaw Date: Wed, 1 Apr 1998 21:59:41 +0000 (+0000) Subject: (py-compute-indentation): When looking at a continuation line inside X-Git-Tag: v1.5.1~277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92166d9a75ce034ae86cff746207e401e5065976;p=python (py-compute-indentation): When looking at a continuation line inside an open paren, do a better job of reindenting the line. For example: def foo(): print 'hello %s, %d' % ( a, b) Hit TAB on the line starting with `a'. Without this patch this line will never be reindented. --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 6fadfa1689..b50ce9502b 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -1529,7 +1529,12 @@ the new line indented." (while (and (< (point) startpos) (looking-at "[ \t]*[#\n\\\\]")) ; skip noise (forward-line 1)) - (if (< (point) startpos) + (if (and (< (point) startpos) + (/= startpos + (save-excursion + (goto-char (1+ open-bracket-pos)) + (skip-chars-forward " \t\n") + (point)))) ;; again mimic the first list item (current-indentation) ;; else they're about to enter the first item