• Fabián Ezequiel Gallina's avatar
    python.el: New non-global state dependent indentation engine. · 5485e3e5
    Fabián Ezequiel Gallina authored
    Fixes: debbugs:18319
    Fixes: debbugs:19595
    
    * lisp/progmodes/python.el (python-syntax-comment-or-string-p): Accept
    PPSS as argument.
    (python-syntax-closing-paren-p): New function.
    (python-indent-current-level)
    (python-indent-levels): Mark obsolete.
    (python-indent-context): Return more context cases.
    (python-indent--calculate-indentation)
    (python-indent--calculate-levels): New functions.
    (python-indent-calculate-levels): Use them.
    (python-indent-calculate-indentation, python-indent-line):
    (python-indent-line-function): Rewritten to use new API.
    (python-indent-dedent-line): Simplify logic.
    (python-indent-dedent-line-backspace): Use `unless`.
    (python-indent-toggle-levels): Delete function.
    
    * test/automated/python-tests.el (python-indent-pep8-1)
    (python-indent-pep8-2, python-indent-pep8-3)
    (python-indent-after-comment-1, python-indent-after-comment-2)
    (python-indent-inside-paren-1, python-indent-inside-paren-2)
    (python-indent-after-block-1, python-indent-after-block-2)
    (python-indent-after-backslash-1, python-indent-after-backslash-2)
    (python-indent-after-backslash-3, python-indent-block-enders-1)
    (python-indent-block-enders-2, python-indent-block-enders-3)
    (python-indent-block-enders-4, python-indent-block-enders-5)
    (python-indent-dedenters-1, python-indent-dedenters-2)
    (python-indent-dedenters-3, python-indent-dedenters-4)
    (python-indent-dedenters-5, python-indent-dedenters-6)
    (python-indent-dedenters-7, python-indent-dedenters-8): Fix tests.
    (python-indent-base-case, python-indent-after-block-3)
    (python-indent-after-backslash-5, python-indent-inside-paren-3)
    (python-indent-inside-paren-4, python-indent-inside-paren-5)
    (python-indent-inside-paren-6, python-indent-inside-string-1)
    (python-indent-inside-string-2, python-indent-inside-string-3)
    (python-indent-dedent-line-backspace-1): New Tests.
    5485e3e5
python-tests.el 146 KB