From: Fabián Ezequiel Gallina Date: Thu, 17 May 2012 03:03:03 +0000 (-0300) Subject: Fixed indentation of multi-line function call's closing parenthesis X-Git-Tag: emacs-24.2.90~1199^2~599 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=17d13b85268a6b864e92af05cb8f0ed4461e3cc5;p=emacs.git Fixed indentation of multi-line function call's closing parenthesis --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1fd4f326d3c..564638c1b58 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -599,24 +599,32 @@ START is the buffer position where the sexp starts." (current-indentation))))) indentation)) ('inside-paren - (- - (save-excursion - (goto-char context-start) - (forward-char) - (save-restriction - (narrow-to-region - (line-beginning-position) - (line-end-position)) - (forward-comment 1)) - (if (looking-at "$") - (+ (current-indentation) python-indent-offset) - (forward-comment 1) - (current-column))) - (if (progn - (back-to-indentation) - (looking-at (regexp-opt '(")" "]" "}")))) - python-indent-offset - 0)))))))) + (or (save-excursion + (forward-comment 1) + (looking-at (regexp-opt '(")" "]" "}"))) + (forward-char 1) + (when (not (nth 1 (syntax-ppss))) + (goto-char context-start) + (back-to-indentation) + (current-column))) + (- + (save-excursion + (goto-char context-start) + (forward-char) + (save-restriction + (narrow-to-region + (line-beginning-position) + (line-end-position)) + (forward-comment 1)) + (if (looking-at "$") + (+ (current-indentation) python-indent-offset) + (forward-comment 1) + (current-column))) + (if (progn + (back-to-indentation) + (looking-at (regexp-opt '(")" "]" "}")))) + python-indent-offset + 0))))))))) (defun python-indent-calculate-levels () "Calculate `python-indent-levels' and reset `python-indent-current-level'."