]> git.eshelyaron.com Git - emacs.git/commit
Respect `prog-indentation-context' in python.el
authorChristoph Wedler <christoph.wedler@sap.com>
Fri, 19 Jun 2015 13:38:24 +0000 (13:38 +0000)
committerChristoph Wedler <christoph.wedler@sap.com>
Sun, 5 Jul 2015 08:52:03 +0000 (08:52 +0000)
commit044d4cc0c0debd4648ec637d63bcd72d4253b1cb
tree5141ad9cfb3ab68795a80b4b87e0829d427226ed
parent4fff58dd1ec11543e2b0195f10cefc1746748499
Respect `prog-indentation-context' in python.el

* lisp/progmodes/python.el (python-indent-guess-indent-offset)
(python-indent-context, python-indent--calculate-indentation)
(python-info-current-defun)
(python-info-dedenter-opening-block-message)
(python-info-line-ends-backslash-p)
(python-info-beginning-of-backslash)
(python-info-continuation-line-p): Use `prog-widen'.
(python-indent--calculate-indentation)
(python-indent--calculate-levels)
(python-indent-calculate-indentation): Use `prog-first-column'.
(python-indent--calculate-levels): Simplify.

Ignore also initial empty lines for syntax calculation.
* lisp/progmodes/python.el (python-indent-context): Return
:no-indent for first non-empty line, not just in line 1.
* test/automated/python-tests.el (python-indent-base-case)
(python-indent-inside-paren-1, python-indent-inside-paren-2)
(python-indent-inside-paren-3, python-indent-inside-paren-4)
(python-indent-inside-paren-5, python-indent-inside-paren-6)
(python-indent-after-backslash-1)
(python-indent-after-backslash-2)
(python-indent-after-backslash-3)
(python-indent-after-backslash-4, python-indent-inside-string-1):
Expect :no-indent for first non-empty line.
lisp/progmodes/python.el
test/automated/python-tests.el