aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky2019-06-21 07:49:22 -0400
committerNoam Postavsky2019-06-22 19:25:44 -0400
commit0f01a58c390faf30c33b369fc81b2a14ec5b7f2e (patch)
tree358768de2c6ca522218c2dfc5dad8af523c518e7 /test/lisp/progmodes/python-tests.el
parentf46b16b9fb00d341f222422a9514f5bd62f29971 (diff)
downloademacs-0f01a58c390faf30c33b369fc81b2a14ec5b7f2e.tar.gz
emacs-0f01a58c390faf30c33b369fc81b2a14ec5b7f2e.zip
Fix python docstring auto-fill (Bug#36056)
* lisp/progmodes/python.el (python-mode): Set fill-indent-according-to-mode locally to t. This lets auto-fill do the right thing when auto-filling inside a docstring. The default was to nil on 2001-11-25 "(fill-indent-according-to-mode): Default to nil" with the comment that it "screws up CC-mode's filling tricks". But presumably it shouldn't be a problem for python-mode. * test/lisp/progmodes/python-tests.el (python-auto-fill-docstring): New test.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index a5179097172..87cee189eac 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1341,6 +1341,24 @@ this is an arbitrarily
1341 expected))))) 1341 expected)))))
1342 1342
1343 1343
1344;;; Autofill
1345
1346(ert-deftest python-auto-fill-docstring ()
1347 (python-tests-with-temp-buffer
1348 "\
1349def some_function(arg1,
1350 arg2):
1351 \"\"\"
1352 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
1353 (auto-fill-mode +1)
1354 (goto-char (point-max))
1355 (newline)
1356 (search-backward "Lorem")
1357 (let ((docindent (current-indentation)))
1358 (forward-line 1)
1359 (should (= docindent (current-indentation))))))
1360
1361
1344;;; Mark 1362;;; Mark
1345 1363
1346(ert-deftest python-mark-defun-1 () 1364(ert-deftest python-mark-defun-1 ()