aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorDeneb Meketa2021-05-27 01:21:59 +0200
committerLars Ingebrigtsen2021-05-27 01:21:59 +0200
commit7f11dea66298c2c9aeccab2b542ee8e73346f09f (patch)
treee21f734f54f16669b2339da6b08db55252f94c11 /lisp/progmodes/python.el
parent0dfe193ec42160bfaa30933c5ebfa7ae91cde88b (diff)
downloademacs-7f11dea66298c2c9aeccab2b542ee8e73346f09f.tar.gz
emacs-7f11dea66298c2c9aeccab2b542ee8e73346f09f.zip
Fix filling of overlong first lines in Python doc strings
* lisp/progmodes/python.el (python-fill-string): Fill overlong first lines correctly (bug#20860). Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 20ec339fffb..f7267bdef29 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4239,6 +4239,11 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
4239 (point))))) 4239 (point)))))
4240 (num-quotes (python-syntax-count-quotes 4240 (num-quotes (python-syntax-count-quotes
4241 (char-after str-start-pos) str-start-pos)) 4241 (char-after str-start-pos) str-start-pos))
4242 (str-line-start-pos
4243 (save-excursion
4244 (goto-char str-start-pos)
4245 (beginning-of-line)
4246 (point-marker)))
4242 (str-end-pos 4247 (str-end-pos
4243 (save-excursion 4248 (save-excursion
4244 (goto-char (+ str-start-pos num-quotes)) 4249 (goto-char (+ str-start-pos num-quotes))
@@ -4262,7 +4267,7 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
4262 ('symmetric (and multi-line-p (cons 1 1))))) 4267 ('symmetric (and multi-line-p (cons 1 1)))))
4263 (fill-paragraph-function)) 4268 (fill-paragraph-function))
4264 (save-restriction 4269 (save-restriction
4265 (narrow-to-region str-start-pos str-end-pos) 4270 (narrow-to-region str-line-start-pos str-end-pos)
4266 (fill-paragraph justify)) 4271 (fill-paragraph justify))
4267 (save-excursion 4272 (save-excursion
4268 (when (and (python-info-docstring-p) python-fill-docstring-style) 4273 (when (and (python-info-docstring-p) python-fill-docstring-style)