diff options
| author | Fabián Ezequiel Gallina | 2014-11-15 19:02:52 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2014-11-15 19:02:52 -0300 |
| commit | 92f58578cc939e0d955437fcbc87cda80c2ba05c (patch) | |
| tree | cfa7284f877f5bf05e98f6f607a38ce36ccd044e /lisp/progmodes/python.el | |
| parent | b6cd03a825f7b8bdd0a741f68f20f81fb541ee5b (diff) | |
| download | emacs-92f58578cc939e0d955437fcbc87cda80c2ba05c.tar.gz emacs-92f58578cc939e0d955437fcbc87cda80c2ba05c.zip | |
Fixes: debbugs:18432
* lisp/progmodes/python.el (python-indent-calculate-levels): Fix
indentation behavior multiline dedenter statement.
* test/automated/python-tests.el (python-indent-dedenters-8): New test
for Bug#18432.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5f8d7a29fa6..89b2f1fd081 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -955,7 +955,11 @@ START is the buffer position where the sexp starts." | |||
| 955 | 955 | ||
| 956 | (defun python-indent-calculate-levels () | 956 | (defun python-indent-calculate-levels () |
| 957 | "Calculate `python-indent-levels' and reset `python-indent-current-level'." | 957 | "Calculate `python-indent-levels' and reset `python-indent-current-level'." |
| 958 | (if (not (python-info-dedenter-statement-p)) | 958 | (if (or (python-info-continuation-line-p) |
| 959 | (not (python-info-dedenter-statement-p))) | ||
| 960 | ;; XXX: This asks for a refactor. Even if point is on a | ||
| 961 | ;; dedenter statement, it could be multiline and in that case | ||
| 962 | ;; the continuation lines should be indented with normal rules. | ||
| 959 | (let* ((indentation (python-indent-calculate-indentation)) | 963 | (let* ((indentation (python-indent-calculate-indentation)) |
| 960 | (remainder (% indentation python-indent-offset)) | 964 | (remainder (% indentation python-indent-offset)) |
| 961 | (steps (/ (- indentation remainder) python-indent-offset))) | 965 | (steps (/ (- indentation remainder) python-indent-offset))) |