From 4857c99a1d1d2da3d5680662d9c45c8569848b15 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 3 Mar 2026 22:20:51 -0500 Subject: [PATCH] mode-hooks/python-mode-hooks.el: use "onetwo" style for docstrings I greatly prefer this, particularly for Sage docstrings, and it's annoying to have to "git add -i" around it all the time. --- mode-hooks/python-mode-hooks.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mode-hooks/python-mode-hooks.el b/mode-hooks/python-mode-hooks.el index 9c3cf70..1968762 100644 --- a/mode-hooks/python-mode-hooks.el +++ b/mode-hooks/python-mode-hooks.el @@ -4,10 +4,14 @@ ;; my minibuffer in the process. (eldoc-mode 0) - ;; Use "django" style for python docstrings. This ensures that the + ;; Use "onetwo" style for python docstrings. This ensures that the ;; leading triple quotes remain on their own line when you paragraph- - ;; fill the first paragraph of the docstring. - (setq python-fill-docstring-style 'django) + ;; fill the first paragraph of the docstring, and that there is always + ;; a blank line at the end of the doctring before the trailing triple- + ;; quotes. This can look "wrong" in rare scenarios, but generally when + ;; you have several paragraphs and/or code blocks that are bounded + ;; above and below by whitespace, this will be more consistent. + (setq python-fill-docstring-style 'onetwo) ) -- 2.51.0