From unknown Sat Jun 21 03:30:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18819 <18819@debbugs.gnu.org> To: bug#18819 <18819@debbugs.gnu.org> Subject: Status: 24.3.93; python-mode: fill-paragraph breaks comments in a way that annoys "flake8" Reply-To: bug#18819 <18819@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:30:36 +0000 retitle 18819 24.3.93; python-mode: fill-paragraph breaks comments in a way= that annoys "flake8" reassign 18819 emacs submitter 18819 Eric Hanchrow severity 18819 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 24 15:21:15 2014 Received: (at submit) by debbugs.gnu.org; 24 Oct 2014 19:21:15 +0000 Received: from localhost ([127.0.0.1]:34313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XhkQD-0003d2-Fg for submit@debbugs.gnu.org; Fri, 24 Oct 2014 15:21:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43642) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XhkQA-0003co-Av for submit@debbugs.gnu.org; Fri, 24 Oct 2014 15:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhkQ3-0004nj-TQ for submit@debbugs.gnu.org; Fri, 24 Oct 2014 15:21:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:47203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkQ3-0004nf-Q6 for submit@debbugs.gnu.org; Fri, 24 Oct 2014 15:21:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkQ2-00083s-D0 for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhkQ0-0004n3-NA for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:21:02 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:35473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkQ0-0004ms-CZ for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:21:00 -0400 Received: by mail-wi0-f182.google.com with SMTP id bs8so2084948wib.3 for ; Fri, 24 Oct 2014 12:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=gOchg52EFjldJYoU3ryf68zm+FKCFGO0Dam4cPUz7Cg=; b=LdRf37xM52fYL8M2UXRgCSCBeWr6MbYCaPgb3E2qACZCC9k4CHDKknGQUEhX6C3iir qR8RR6qq4tBVaDBBdWtcOf1AR0Eb5FflAzZ2KAPpl4U9ymAMYONJr5SWBQRjPHlEnPa9 8WBnLVkmgtLp4RJV2kETBS4+Ceyoq6YI1l2ffSTc4+AdSRWx2bTdNQVrul1Ta+EunfOs JMEY0v+HEEG6M88LlmlbuXRWfKlAbI07wTMlLlDeHMsOhLAAIVJzsTfCBzVZdvHpm3C5 yYIIrgWmHxCS/gogMMBw/y5iWCuU2OpbdayOUhcmNwwC1uhB5i839cCE89RudGZorxa0 tH8A== X-Received: by 10.180.206.171 with SMTP id lp11mr5763600wic.33.1414178458699; Fri, 24 Oct 2014 12:20:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.43.163 with HTTP; Fri, 24 Oct 2014 12:20:38 -0700 (PDT) From: Eric Hanchrow Date: Fri, 24 Oct 2014 12:20:38 -0700 Message-ID: Subject: 24.3.93; python-mode: fill-paragraph breaks comments in a way that annoys "flake8" To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Some background: "flake8" (http://flake8.readthedocs.org/en/2.2.3/) is a tool that examines a Python program, and complains about bad style. I use it frequently to ensure that my Python code conforms to the standard conventions. Anyhoo ... I noticed that filling a comment paragraph, in a way that seems natural to me, leaves me with code that flake8 complains about. Here's how to see what I saw: * start `emacs -q` * type C-x C-f /tmp/frotz.py RET * enter the below two lines of Python code, including the absurdly-long comment, into the python-mode buffer: =3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D= =3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D= =3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D def yow(): when =3D time.time() # hey you hey you hey you hey you hey you hey you = hey you =3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D= =3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D= =3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D * put point at the end of the second line, then type M-q, and then save with C-x Cs You'll see =3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D= =3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D= =3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D def yow(): when =3D time.time() # hey you hey you hey you hey you hey you hey # you hey you =3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D= =3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D=3D=3D= =3D=3D8-<=3D=3D=3D=3D=3D=3D=3D8-<=3D=3D=3D ... to be honest, that looks good to me; but (assuming you've got flake8 installed -- "pip install flake8" is the easiest way) if you then do M-x compile RET flake8 frotz.py RET, you'll see (along with a few other lines that aren't relevant here) frotz.py:3:24: E111 indentation is not a multiple of four frotz.py:3:24: E113 unexpected indentation So, in a perfect world, M-q would have ... somehow ... fiddled the indentation so that flake8 was happy. I can't offhand think of a way to do that that wouldn't perplex the na=C3=AFve user, but there you go :-) In GNU Emacs 24.3.93.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-06 on Eric-Hanchrows-iMac.local Repository revision: eliz@gnu.org-20140929191028-lti2lybtzzrnjppc Windowing system distributor `Apple', version 10.3.1343 Configured using: `configure --with-ns' Important settings: locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f / t m p / f r o t z . p y C-j C-y C-p C-p C-p C-p C-o d e f SPC y o w M-( C-e : C-M-p M-\ C-n C-n C-n C-n M-m C-SPC C-p C-p C-f C-f C-x r d C-n C-n M-^ M-^ M-^ M-; M-> C-x C-s C-p C-p C-e M-q C-x C-s M-x c o m p i l e C-a C-k f l a k e 8 7 SPC f r M-x c o l u m n M-m C-h c M-q C-d C-p C-d C-n M-^ M-^ M-> C-p C-p M-f M-f M-f M-f M-b C-k h e y SPC y o u SPC M-b M-b C-k C-y C-y C-y C-y C-y C-y C-y C-x C-s M-q C-x C-s C-x o g C-x o M-m C-d M-^ C-x C-s M-x r e p o e r t - e m Recent messages: M-q runs the command fill-paragraph Mark set [8 times] Saving file /tmp/frotz.py... Wrote /tmp/frotz.py Saving file /tmp/frotz.py... Wrote /tmp/frotz.py (No files need saving) Compilation exited abnormally with code 1 Saving file /tmp/frotz.py... Wrote /tmp/frotz.py Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cus-start cus-load shell pcomplete compile rect python easymenu json comint ring cl-loaddefs cl-lib ansi-color time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 109477 8810) (symbols 48 28490 0) (miscs 40 62 307) (strings 32 32817 4135) (string-bytes 1 594338) (vectors 16 11023) (vector-slots 8 401785 5355) (floats 8 62 391) (intervals 56 330 8) (buffers 960 13)) From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 15 17:17:29 2014 Received: (at 18819-done) by debbugs.gnu.org; 15 Nov 2014 22:17:29 +0000 Received: from localhost ([127.0.0.1]:34187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xpler-0007De-C5 for submit@debbugs.gnu.org; Sat, 15 Nov 2014 17:17:29 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:56620) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xplep-0007DW-1B for 18819-done@debbugs.gnu.org; Sat, 15 Nov 2014 17:17:27 -0500 Received: from [190.246.172.180] (port=39389 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Xplen-0001rl-EJ for 18819-done@debbugs.gnu.org; Sat, 15 Nov 2014 17:17:26 -0500 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: 18819-done@debbugs.gnu.org Subject: 24.3.93; python-mode: fill-paragraph breaks comments in a way that annoys "flake8" Date: Sat, 15 Nov 2014 19:17:23 -0300 Message-ID: <87fvdk153g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 18819-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello Eric, Note that inline comments are pretty much discouraged[0]. Leaving that aside, the problem is that inline comments should fit in their own line. In the example you provided, you are trying to make an inline comment that's too large to fit the line and in that case the recommendation would be to turn it into a normal comment just before the statement. So, surprisingly, it seems in this case both flake8 and python.el are right :) [0] https://www.python.org/dev/peps/pep-0008#inline-comments Thanks, Fabi=C3=A1n From unknown Sat Jun 21 03:30:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 14 Dec 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator