diff options
| author | Noam Postavsky | 2019-09-08 10:42:19 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-09-12 20:25:30 -0400 |
| commit | cbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084 (patch) | |
| tree | d03bb7aa2be38b6bb94936bc4fd51304f879d5c4 /test/lisp/progmodes/python-tests.el | |
| parent | 421084d2cb160261b259bddb687bb2c234f8f1ef (diff) | |
| download | emacs-cbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084.tar.gz emacs-cbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084.zip | |
Fix fill-paragraph in python docstrings (Bug#36056)
* lisp/progmodes/python.el (python-do-auto-fill): New function.
(python-mode): Set it as normal-auto-fill-function, and don't set
fill-indent-according-to-mode. Having the latter set during
fill-paragraph gives wrongs result, because python-indent-line doesn't
remove indentation added by filling.
* test/lisp/progmodes/python-tests.el (python-fill-docstring): New
test.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index b1cf7e8806a..c5ad1dfb862 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -1351,7 +1351,7 @@ this is an arbitrarily | |||
| 1351 | expected))))) | 1351 | expected))))) |
| 1352 | 1352 | ||
| 1353 | 1353 | ||
| 1354 | ;;; Autofill | 1354 | ;;; Filling |
| 1355 | 1355 | ||
| 1356 | (ert-deftest python-auto-fill-docstring () | 1356 | (ert-deftest python-auto-fill-docstring () |
| 1357 | (python-tests-with-temp-buffer | 1357 | (python-tests-with-temp-buffer |
| @@ -1368,6 +1368,17 @@ def some_function(arg1, | |||
| 1368 | (forward-line 1) | 1368 | (forward-line 1) |
| 1369 | (should (= docindent (current-indentation)))))) | 1369 | (should (= docindent (current-indentation)))))) |
| 1370 | 1370 | ||
| 1371 | (ert-deftest python-fill-docstring () | ||
| 1372 | (python-tests-with-temp-buffer | ||
| 1373 | "\ | ||
| 1374 | r'''aaa | ||
| 1375 | |||
| 1376 | this is a test this is a test this is a test this is a test this is a test this is a test. | ||
| 1377 | '''" | ||
| 1378 | (search-forward "test.") | ||
| 1379 | (fill-paragraph) | ||
| 1380 | (should (= (current-indentation) 0)))) | ||
| 1381 | |||
| 1371 | 1382 | ||
| 1372 | ;;; Mark | 1383 | ;;; Mark |
| 1373 | 1384 | ||