diff options
| author | Fabián Ezequiel Gallina | 2014-09-01 19:51:46 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2014-09-01 19:51:46 -0300 |
| commit | 0e4c8f1856c46900f9530977e5ac9f83ca13bbfd (patch) | |
| tree | 529ec7bc3cad3c868e1662d3e8ff6e83c29323ce /test/automated/python-tests.el | |
| parent | ad5c82a8cc3f78172dc872c7fe3c6e774f50fe15 (diff) | |
| download | emacs-0e4c8f1856c46900f9530977e5ac9f83ca13bbfd.tar.gz emacs-0e4c8f1856c46900f9530977e5ac9f83ca13bbfd.zip | |
* lisp/progmodes/python.el (python-indent-post-self-insert-function):
Avoid electric colon at beginning-of-defun.
* test/automated/python-tests.el:
(python-indent-electric-colon-1): New test. (Bug#18228)
Diffstat (limited to 'test/automated/python-tests.el')
| -rw-r--r-- | test/automated/python-tests.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 47dfa4b64ed..39195fd7086 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -711,6 +711,20 @@ if a: | |||
| 711 | (should (= (python-indent-calculate-indentation) 0)) | 711 | (should (= (python-indent-calculate-indentation) 0)) |
| 712 | (should (equal (python-indent-calculate-levels) '(0))))) | 712 | (should (equal (python-indent-calculate-levels) '(0))))) |
| 713 | 713 | ||
| 714 | (ert-deftest python-indent-electric-colon-1 () | ||
| 715 | "Test indentation case from Bug#18228." | ||
| 716 | (python-tests-with-temp-buffer | ||
| 717 | " | ||
| 718 | def a(): | ||
| 719 | pass | ||
| 720 | |||
| 721 | def b() | ||
| 722 | " | ||
| 723 | (python-tests-look-at "def b()") | ||
| 724 | (goto-char (line-end-position)) | ||
| 725 | (python-tests-self-insert ":") | ||
| 726 | (should (= (current-indentation) 0)))) | ||
| 727 | |||
| 714 | 728 | ||
| 715 | ;;; Navigation | 729 | ;;; Navigation |
| 716 | 730 | ||