From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="235821"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 21254@debbugs.gnu.org To: Holger Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 26 14:05:28 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDSWT-000z5j-H3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Sep 2019 14:05:25 +0200 Original-Received: from localhost ([::1]:34810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDSWK-0003cT-P8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Sep 2019 08:05:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60620) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDSW8-0003Xo-4z for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 08:05:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDSW6-0003fI-T5 for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 08:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDSW6-0003dH-Pa for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 08:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iDSW5-0001iJ-Q7 for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 08:05:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Sep 2019 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21254 X-GNU-PR-Package: emacs Original-Received: via spool by 21254-submit@debbugs.gnu.org id=B21254.15694994656529 (code B ref 21254); Thu, 26 Sep 2019 12:05:01 +0000 Original-Received: (at 21254) by debbugs.gnu.org; 26 Sep 2019 12:04:25 +0000 Original-Received: from localhost ([127.0.0.1]:42842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDSVU-0001hF-LN for submit@debbugs.gnu.org; Thu, 26 Sep 2019 08:04:24 -0400 Original-Received: from mail-pg1-f195.google.com ([209.85.215.195]:40137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDSVP-0001gj-Af for 21254@debbugs.gnu.org; Thu, 26 Sep 2019 08:04:22 -0400 Original-Received: by mail-pg1-f195.google.com with SMTP id w10so1460284pgj.7 for <21254@debbugs.gnu.org>; Thu, 26 Sep 2019 05:04:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=ydRU8Oe1huopvTFEp99HOMZxgT2m6O8nhoY/35cZok8=; b=n4Kvic3m1LcOCPx6gq+LrNDTb6LptF05iw1iVZ2/a4TuLEoxSv3kKm+KBH/IfAvCbu 4Dc1x9Ur3rqFn523nD4kYghpUNR7qtZtcOqQ4yCrP40RMNxyKpyV94JI0H/BBlI6WjTO +zp/2hVou+/G8lyRSFn/SJOWHGnU2k+IxI+eu8v/DYKoUmtAgThL6eiitTVDPOUaZ2Ly /DmfukQXIgX9qm0NCCbq59aXJiuSj5GX+t1asyYWZOtYFfPfVtSsbp8XW9fU1jlQL3f+ K6subLg+8X8ZTXEcsddDo/IRH3+MnwFqS1c1/JSvjDOiLO/xs0s3XQaq9lkV5Cj3Yg2t t16w== X-Gm-Message-State: APjAAAWJ7MTjaBOASjGBP+jWjvnDJ//3B2M/z081PuP2RBaSMyUzBh7p edRfUVigSp6MGpWIrgixhzAnwNDzg0C8oOeBv427XOZK X-Google-Smtp-Source: APXvYqyFGVHviqryjRpOkhOwX6r0ym5g2WrUNInfSN7Bm9YF+zqsxUdACVAhNBZS7QWnfmhPn4Nal29I40DLSWkx4p4= X-Received: by 2002:a63:4f4b:: with SMTP id p11mr3183284pgl.333.1569499452622; Thu, 26 Sep 2019 05:04:12 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167231 Archived-At: tags 21254 confirmed found 21254 26.1 quit Holger Schmidt 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 sp= aces in this case. With python-fill-docstring-style set to 'pep-257-nn the= re 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