bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20860: python.el's fill-paragraph incorrectly handles doc-strings wi


From: Deneb Meketa
Subject: bug#20860: python.el's fill-paragraph incorrectly handles doc-strings with long first lines
Date: Mon, 19 Apr 2021 17:12:24 -0700

Attached please find a patch for consideration.

I also ran into this issue, and found this fix.  When we narrow to perform the main fill, we need to preserve the entire first line.  Otherwise the fill operation won't see the beginning of the first line; it will think that line begins at the opening quote, and thus will allow the first line to be longer than it should.

I have tested this in 26.1 with docstrings and ordinary strings, single and triple quotes, auto-fill and fill-paragraph, docstring styles pep-257 and django.  As far as I can tell, this function has not changed since 26.1.

Proposed commit message:

Python: fix overlong first line in string fill.

When we narrow to perform filling, make sure to include the entire first line in
the narrowed view.  Otherwise the fill doesn't work correctly.

Attachment: emacs-bug20860.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]