summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-09-08 10:42:19 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-09-12 20:25:30 -0400
commitcbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084 (patch)
treed03bb7aa2be38b6bb94936bc4fd51304f879d5c4 /test/lisp/progmodes/python-tests.el
parent421084d2cb160261b259bddb687bb2c234f8f1ef (diff)
downloademacs-cbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084.tar.gz
emacs-cbb8a8ad979ed7975bfc7e9fa6aeeb4d9d6b7084.tar.bz2
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.el13
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
expected)))))
-;;; Autofill
+;;; Filling
(ert-deftest python-auto-fill-docstring ()
(python-tests-with-temp-buffer
@@ -1368,6 +1368,17 @@ def some_function(arg1,
(forward-line 1)
(should (= docindent (current-indentation))))))
+(ert-deftest python-fill-docstring ()
+ (python-tests-with-temp-buffer
+ "\
+r'''aaa
+
+this is a test this is a test this is a test this is a test this is a test this is a test.
+'''"
+ (search-forward "test.")
+ (fill-paragraph)
+ (should (= (current-indentation) 0))))
+
;;; Mark