From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.bugs Subject: bug#18819: 24.3.93; python-mode: fill-paragraph breaks comments in a way that annoys "flake8" Date: Fri, 24 Oct 2014 12:20:38 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1414178535 29827 80.91.229.3 (24 Oct 2014 19:22:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2014 19:22:15 +0000 (UTC) To: 18819@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 21:22:10 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XhkR7-0004E3-Ki for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Oct 2014 21:22:09 +0200 Original-Received: from localhost ([::1]:50220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkR7-0008H7-7X for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Oct 2014 15:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkR2-0008Gr-NL for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhkR1-0004y9-1A for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:22:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhkR0-0004xs-Tx for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XhkR0-0003eM-GW for bug-gnu-emacs@gnu.org; Fri, 24 Oct 2014 15:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Hanchrow Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Oct 2014 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18819 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141417847513958 (code B ref -1); Fri, 24 Oct 2014 19:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2014 19:21:15 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-Received: by 10.194.43.163 with HTTP; Fri, 24 Oct 2014 12:20:38 -0700 (PDT) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95042 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))