unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Holger Schmidt <Holger.Schmidt@zmdi.com>
Cc: 21254@debbugs.gnu.org
Subject: bug#21254: 24.5; python.el: Docstring fill-paragraph not working with style pep-257-nn
Date: Thu, 26 Sep 2019 14:04:01 +0200	[thread overview]
Message-ID: <CADwFkm=hEyxf=CuZNLL11WXOuOCUW_RLdqZx-5dCJZFw9NAiEA@mail.gmail.com> (raw)
In-Reply-To: <jgyoaibz9qj.fsf@l53.i-did-not-set--mail-host-address--so-tickle-me>

tags 21254 confirmed
found 21254 26.1
quit

Holger Schmidt <Holger.Schmidt@zmdi.com> writes:

> I write a docstring of a class method in a buffer with Python mode.
> python-fill-docstring-style is set to 'pep-257-nn.  The
> cursor is at the end of the docstring after the three quotes.
> fill-paragraph does nothing, but it should format the docstring.
>
> I move the cursor inside the docstring.  fill-paragraph formats the
> docstring with four errors: There is no newline after the first
> sentence, the first line is longer (72) than fill-column (70), the
> second line and following lines are not indented (but start at column 0),
> there is no newline at the end.  A second fill-paragraph adds the
> missing newline at the end.
>
> Example (the docstring is one long line):
>
> class MyClass(object):
>     def __init__(self):
>         """Class initialization.  According to PEP 257 there should be a newline after the first sentence.  Following sentences are indented by 8 spaces in this case.  With python-fill-docstring-style set to 'pep-257-nn there should be a newline at the end."""
>         pass
>
> This should be formatted like this:
>
> class MyClass(object):
>     def __init__(self):
>         """Class initialization.
>
>         According to PEP 257 there should be a newline after the first
>         sentence.  Following sentences are indented by 8 spaces in
>         this case.  With python-fill-docstring-style set to
>         'pep-257-nn there should be a newline at the end.
>         """
>         pass
>
> But the result is this (fill-paragraph (M-q) inside docstring):
>
> class MyClass(object):
>     def __init__(self):
>         """Class initialization.  According to PEP 257 there should be a
> newline after the first sentence.  Following sentences are indented by
> 8 spaces in this case.  With python-fill-docstring-style set to
> 'pep-257-nn there should be a newline at the end."""
>         pass

I can reproduce this on Emacs 26.1 and current master.

Best regards,
Stefan Kangas





  reply	other threads:[~2019-09-26 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 11:52 bug#21254: 24.5; python.el: Docstring fill-paragraph not working with style pep-257-nn Holger Schmidt
2019-09-26 12:04 ` Stefan Kangas [this message]
2023-02-27 10:58 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=hEyxf=CuZNLL11WXOuOCUW_RLdqZx-5dCJZFw9NAiEA@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=21254@debbugs.gnu.org \
    --cc=Holger.Schmidt@zmdi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).