From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Topher Brown Newsgroups: gmane.emacs.bugs Subject: bug#20860: 24.4; python.el's fill-paragraph incorrectly handles doc-strings with long first lines Date: Sat, 20 Jun 2015 12:51:50 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11347ce891b14c0518f5dcb6 X-Trace: ger.gmane.org 1434823161 16986 80.91.229.3 (20 Jun 2015 17:59:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jun 2015 17:59:21 +0000 (UTC) To: 20860@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 20 19:59:11 2015 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 1Z6N2s-0003RF-1s for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jun 2015 19:59:10 +0200 Original-Received: from localhost ([::1]:34346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6N2r-0007qR-Cz for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jun 2015 13:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6N2n-0007pb-25 for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 13:59:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6N2l-0005tU-AX for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 13:59:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6N2l-0005tQ-6R for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 13:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z6N2k-0007LS-Ll for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 13:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Topher Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jun 2015 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20860 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.143482309328176 (code B ref -1); Sat, 20 Jun 2015 17:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Jun 2015 17:58:13 +0000 Original-Received: from localhost ([127.0.0.1]:52838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6N1w-0007KN-0r for submit@debbugs.gnu.org; Sat, 20 Jun 2015 13:58:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42732) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6M0F-0005pr-DD for submit@debbugs.gnu.org; Sat, 20 Jun 2015 12:52:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6M08-0001Zr-2X for submit@debbugs.gnu.org; Sat, 20 Jun 2015 12:52:17 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6M07-0001Zg-Vu for submit@debbugs.gnu.org; Sat, 20 Jun 2015 12:52:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6M05-0002ft-VD for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 12:52:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6M04-0001UY-7J for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 12:52:13 -0400 Original-Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:36475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6M03-0001Sn-Pt for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2015 12:52:12 -0400 Original-Received: by lbbqq2 with SMTP id qq2so87686823lbb.3 for ; Sat, 20 Jun 2015 09:52:10 -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; bh=INiH2dujmo1mD5v10GtJ/2K/pGvE33jnOnEeAs0thLg=; b=ays+zCFo87+S9mULfo+XKyV4k+a4z6KaHnX5KoC7oxoCIQJD2+pAiydwY8TG+7Yb1R uioeU1908N75drqwGwY9bC/Xd+A6ZD3wJX+TNcr1R5YfY35DvNelhl7Glg8XaF/tlclH 7Moe4KFBBOJPMMHLnTeqYxGutmyIFeIXz5FebkvIiLouR6KyahcZA7YQpYlw91yqkBZ8 pT5vwTg3kEZqbGpW3eg0Mjh5hbPvyHD+Giyhj2nTZphe6jZNaNN1BUFO7QJzwGFTqoTl IhzjI9tpNQnQlQiPV0QNGkVD+QBb83UCIAHN4/AE/dmTyLlCGcD3s8jgZbULiNn/8x48 yHdg== X-Received: by 10.112.41.196 with SMTP id h4mr22894122lbl.36.1434819130141; Sat, 20 Jun 2015 09:52:10 -0700 (PDT) Original-Received: by 10.112.163.162 with HTTP; Sat, 20 Jun 2015 09:51:50 -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: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Sat, 20 Jun 2015 13:58:10 -0400 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:104153 Archived-At: --001a11347ce891b14c0518f5dcb6 Content-Type: text/plain; charset=UTF-8 Confirmed with `emacs -Q`. The default `fill-column` is 70 characters. So, running `fill-paragraph` on a doc-string line that is over 70 characters should wrap to leave under 70 characters. All the lines after the first one work correctly. However, the first line gets wrapped to 74 characters instead. An example function can be found here: https://gist.github.com/topher200/9b04870d74e26682adde In the example, running `fill-paragraph` should put my `SHOULDBEWRAPPED` string on a new line. It incorrectly stays on the first line; 74 characters remain on that line, way over our `fill-column` of 70. In GNU Emacs 24.4.1 (i686-pc-mingw32) of 2014-10-24 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.3.9600 Configured using: `configure --prefix=/c/usr' Important settings: value of $LANG: ENU locale-coding-system: cp1252 Major mode: Python Minor modes in effect: 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: SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d M-q f M-q M-q M-q M-q SPC M-q M-x b u g r e p o r e p o t r t - e m Recent messages: Hide or show this option. M-TAB: complete field; RET: enter value Change the state of this item. M-TAB: complete field; RET: enter value Auto-saving...done Auto-saving...done Auto-saving...done Making completion list... delete-backward-char: Text is read-only Making completion list... 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 mail-prsvr mail-utils help-fns cus-edit wid-edit help-mode cus-start cus-load python easymenu json comint ring cl-loaddefs cl-lib ansi-color time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars 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 w32notify w32 multi-tty emacs) Memory information: ((conses 8 102616 6180) (symbols 32 19900 0) (miscs 32 135 405) (strings 16 17338 3956) (string-bytes 1 467539) (vectors 8 11791) (vector-slots 4 403635 5512) (floats 8 67 341) (intervals 28 471 42) (buffers 508 15)) --001a11347ce891b14c0518f5dcb6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Confirmed with `emacs -Q`.

The default `fill-column` is 70 characters. So, running `fill-paragraph`=
on a doc-string line that is over 70 characters should wrap to l= eave
under 70 characters. All the lines after the first one work<= /div>
correctly. However, the first line gets wrapped to 74 characters<= /div>
instead.

An example function can be foun= d here:
<= div>
In the example, running `fill-paragraph` should put my `= SHOULDBEWRAPPED`
string on a new line. It incorrectly stays on th= e first line; 74
characters remain on that line, way over our `fi= ll-column` of 70.

In GNU Emacs 24.4.1 (i686-pc-min= gw32)
=C2=A0of 2014-10-24 on LEG570
Windowing system di= stributor `Microsoft Corp.', version 6.3.9600
Configured usin= g:
=C2=A0`configure --prefix=3D/c/usr'

Important settings:
=C2=A0 value of $LANG: ENU
=C2= =A0 locale-coding-system: cp1252

Major mode: Pytho= n

Minor modes in effect:
=C2=A0 tooltip-= mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-whe= el-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode= : t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-= lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-curs= or-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-= encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2= =A0 column-number-mode: t
=C2=A0 line-number-mode: t
= =C2=A0 transient-mark-mode: t

Recent input:
<= div><backspace> <backspace> <backspace> <backspace>= <backspace>=C2=A0
<backspace> <backspace> <= backspace> <backspace> <backspace>=C2=A0
<backs= pace> <backspace> <backspace> <backspace> <backspac= e>=C2=A0
<backspace> <backspace> <backspace>= <backspace> <backspace>=C2=A0
<backspace> <= backspace> <backspace> <backspace> <backspace>=C2=A0
SPC a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC=C2=A0
<= div>a s d SPC a s d SPC a s d SPC a s d SPC a s d SPC a=C2=A0
s d= SPC a s d SPC a s d SPC a s d SPC a s d SPC a s=C2=A0
d SPC a s = d SPC a s d SPC a s d SPC a s d SPC a s d=C2=A0
SPC a s d SPC a s= d SPC a s d SPC a s d SPC a s d SPC=C2=A0
a s d SPC a s d SPC a = s d SPC a s d SPC a s d SPC a=C2=A0
s d SPC a s d <down> &l= t;backspace> <backspace> <backspace>=C2=A0
<bac= kspace> <backspace> <backspace> <backspace> <backsp= ace>=C2=A0
<backspace> <backspace> <backspace&g= t; <backspace> <backspace>=C2=A0
<backspace> &l= t;backspace> <backspace> <backspace> <backspace>=C2=A0=
<backspace> <backspace> <backspace> <backsp= ace> <backspace>=C2=A0
<backspace> <backspace&g= t; <backspace> <backspace> <backspace>=C2=A0
&l= t;backspace> <backspace> M-q <up> <right> <right>= ; <right>=C2=A0
<right> <right> <right> &= lt;right> <right> <right> <right>=C2=A0
<= right> <right> <right> <right> <right> <right= > <right>=C2=A0
<right> <right> <right>= ; <right> <right> <right> <left>=C2=A0
&l= t;right> f M-q <down> <up> <right> <left> <le= ft> M-q=C2=A0
<down> M-q <down> <down> M-q &= lt;up> <up> <up> <down>=C2=A0
<left> &= lt;left> <left> <left> <left> <left> <left>= ; <left>=C2=A0
<left> <left> <left> <l= eft> <left> <left> <left> <left>=C2=A0
<left> <left> <left> <left> <backspace> SPC = M-q M-x=C2=A0
b u g <tab> <tab> <backspace> <= ;backspace> <backspace>=C2=A0
<backspace> <back= space> <backspace> <backspace> <backspace>=C2=A0
=
<backspace> <backspace> <backspace> <backspace>= ; <backspace>=C2=A0
<backspace> <backspace> r e= p o <tab> <tab> <tab> <backspace>=C2=A0
= <backspace> <backspace> <backspace> r e p o t <backspa= ce>=C2=A0
r t - e m <tab> <return>

<= /div>
Recent messages:
Hide or show this option.
M-= TAB: complete field; RET: enter value
Change the state of this it= em.
M-TAB: complete field; RET: enter value
Auto-saving= ...done
Auto-saving...done
Auto-saving...done
Making completion list...
delete-backward-char: Text is read-onl= y
Making completion list...

Load-path sh= adows:
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<= /div>
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util<= /div>
mail-prsvr mail-utils help-fns cus-edit wid-edit help-mode cus-st= art
cus-load python easymenu json comint ring cl-loaddefs cl-lib = ansi-color
time-date tooltip electric uniquify ediff-hook vc-hook= s lisp-float-type
mwheel dos-w32 ls-lisp w32-common-fns disp-tabl= e w32-win w32-vars
tool-bar dnd fontset image regexp-opt fringe t= abulated-list newcomment
lisp-mode prog-mode register page menu-b= ar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock s= yntax facemenu font-core frame cham
georgian utf-8-lang misc-lang= vietnamese tibetan thai tai-viet lao
korean japanese hebrew gree= k 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-proper= ties overlay sha1 md5 base64 format env code-pages mule
custom wi= dget hashtable-print-readable backquote make-network-process
w32n= otify w32 multi-tty emacs)

Memory information:
((conses 8 102616 6180)
=C2=A0(symbols 32 19900 0)
=C2=A0(miscs 32 135 405)
=C2=A0(strings 16 17338 3956)
=C2=A0(string-bytes 1 467539)
=C2=A0(vectors 8 11791)
=C2=A0(vector-slots 4 403635 5512)
=C2=A0(floats 8 67 341)
=C2=A0(intervals 28 471 42)
=C2=A0(buffers 508 15))
--001a11347ce891b14c0518f5dcb6--