diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:03:03 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:03:03 -0300 |
| commit | 17d13b85268a6b864e92af05cb8f0ed4461e3cc5 (patch) | |
| tree | ce00e0697a098e52e8c1130e9c7be725eed9cf31 /lisp/progmodes/python.el | |
| parent | 24b68537c35c7c7a11be02242a6f3813f279902c (diff) | |
| download | emacs-17d13b85268a6b864e92af05cb8f0ed4461e3cc5.tar.gz emacs-17d13b85268a6b864e92af05cb8f0ed4461e3cc5.zip | |
Fixed indentation of multi-line function call's closing parenthesis
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 44 |
1 files changed, 26 insertions, 18 deletions
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." | |||
| 599 | (current-indentation))))) | 599 | (current-indentation))))) |
| 600 | indentation)) | 600 | indentation)) |
| 601 | ('inside-paren | 601 | ('inside-paren |
| 602 | (- | 602 | (or (save-excursion |
| 603 | (save-excursion | 603 | (forward-comment 1) |
| 604 | (goto-char context-start) | 604 | (looking-at (regexp-opt '(")" "]" "}"))) |
| 605 | (forward-char) | 605 | (forward-char 1) |
| 606 | (save-restriction | 606 | (when (not (nth 1 (syntax-ppss))) |
| 607 | (narrow-to-region | 607 | (goto-char context-start) |
| 608 | (line-beginning-position) | 608 | (back-to-indentation) |
| 609 | (line-end-position)) | 609 | (current-column))) |
| 610 | (forward-comment 1)) | 610 | (- |
| 611 | (if (looking-at "$") | 611 | (save-excursion |
| 612 | (+ (current-indentation) python-indent-offset) | 612 | (goto-char context-start) |
| 613 | (forward-comment 1) | 613 | (forward-char) |
| 614 | (current-column))) | 614 | (save-restriction |
| 615 | (if (progn | 615 | (narrow-to-region |
| 616 | (back-to-indentation) | 616 | (line-beginning-position) |
| 617 | (looking-at (regexp-opt '(")" "]" "}")))) | 617 | (line-end-position)) |
| 618 | python-indent-offset | 618 | (forward-comment 1)) |
| 619 | 0)))))))) | 619 | (if (looking-at "$") |
| 620 | (+ (current-indentation) python-indent-offset) | ||
| 621 | (forward-comment 1) | ||
| 622 | (current-column))) | ||
| 623 | (if (progn | ||
| 624 | (back-to-indentation) | ||
| 625 | (looking-at (regexp-opt '(")" "]" "}")))) | ||
| 626 | python-indent-offset | ||
| 627 | 0))))))))) | ||
| 620 | 628 | ||
| 621 | (defun python-indent-calculate-levels () | 629 | (defun python-indent-calculate-levels () |
| 622 | "Calculate `python-indent-levels' and reset `python-indent-current-level'." | 630 | "Calculate `python-indent-levels' and reset `python-indent-current-level'." |