From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Guath Newsgroups: gmane.emacs.bugs Subject: bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode Date: Wed, 30 May 2018 14:50:01 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f31ae3056d6bcace" X-Trace: blaine.gmane.org 1527684549 13326 195.159.176.226 (30 May 2018 12:49:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 12:49:09 +0000 (UTC) To: 31656@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 30 14:49:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fO0XI-0003Mf-KK for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2018 14:49:04 +0200 Original-Received: from localhost ([::1]:38483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO0ZP-0001Yr-Rz for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2018 08:51:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO0ZF-0001Yf-AA for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO0ZC-0002T6-Kz for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fO0ZC-0002T0-Hf for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fO0ZC-00008q-Bw for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Guath Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 May 2018 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31656 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.1527684637510 (code B ref -1); Wed, 30 May 2018 12:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 May 2018 12:50:37 +0000 Original-Received: from localhost ([127.0.0.1]:54765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fO0Yn-00008A-Ci for submit@debbugs.gnu.org; Wed, 30 May 2018 08:50:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fO0Yk-00007w-8N for submit@debbugs.gnu.org; Wed, 30 May 2018 08:50:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO0Yd-00029l-RN for submit@debbugs.gnu.org; Wed, 30 May 2018 08:50:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fO0Yd-00029F-Cf for submit@debbugs.gnu.org; Wed, 30 May 2018 08:50:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO0Yb-0001Rs-Pl for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:50:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO0YZ-00021u-5x for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:50:25 -0400 Original-Received: from [85.112.160.81] (port=42030 helo=mail.automata.se) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fO0YY-0001xe-LI for bug-gnu-emacs@gnu.org; Wed, 30 May 2018 08:50:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.automata.se (Postfix) with ESMTP id 49D133A124 for ; Wed, 30 May 2018 14:50:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lux2.netcamp.se Original-Received: from mail.automata.se ([127.0.0.1]) by localhost (lux2.netcamp.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8vnJF8HwL9hn for ; Wed, 30 May 2018 14:50:17 +0200 (CEST) Original-Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mail.automata.se (Postfix) with ESMTPSA id C60E83A123 for ; Wed, 30 May 2018 14:50:17 +0200 (CEST) Original-Received: by mail-wm0-f54.google.com with SMTP id o78-v6so47621047wmg.0 for ; Wed, 30 May 2018 05:50:17 -0700 (PDT) X-Gm-Message-State: APt69E1Kzsp0EVFfbjMr1J3lGszKJPnT75ulNCuzs+lFM/Bk1K6zzt8I u3am7Z0afxG0HXsobwyw+wxetN8n09mEiJhCxXc= X-Google-Smtp-Source: ADUXVKJs/i+OdQNCodBrPF8IUCDfVxD3YZBnhsf/F/IE2wS2Yj6IU1MCDtbKueIoo7+F6UOfSWbKpAuEJobN7Gm8KOc= X-Received: by 2002:a1c:c46:: with SMTP id 67-v6mr1465759wmm.79.1527684617409; Wed, 30 May 2018 05:50:17 -0700 (PDT) X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] 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.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:146752 Archived-At: --000000000000f31ae3056d6bcace Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable VERSION GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-28 DESCRIPTION `emacs-lisp-docstring-fill-column' shadows `fill-column' in too many cases in emacs-lisp-mode. The documentation of `emacs-lisp-docstring-fill-column' states: "Value of =E2=80=98fill-column=E2=80=99 to use when filling a docst= ring". But it incorrectly seems to be used in a lot more cases than just in a docstring (the only case that I've found where =E2=80=98fill-column=E2=80=99 is actua= lly respected is within comments). A work-around is to set `emacs-lisp-docstring-fill-column' to nil, but it would be nice to have it working properly instead. I might be missing something, but think the incorrect behavior is to be found in `lisp-fill-paragraph' that is invoked by `fill-paragraph' through `fill-paragraph-function'. It seems like `lisp-fill-paragraph' unconditionally sets `fill-column' to `emacs-lisp-docstring-fill-column' without checking whether point is within a doc string first. The only requirements for enable shadowing currently seems to be "(and (integerp emacs-lisp-docstring-fill-column) (derived-mode-p 'emacs-lisp-mode))", which doesn't seems sufficient. TO REPRODUCE * emacs -q * C-x b (i.e. switch to *scratch* buffer) * M-x emacs-lisp-mode * M-x column-number-mode (optional) * (setq fill-column 80) ;used by `fill-paragraph' * (setq emacs-lisp-docstring-fill-column 40) ;should override `fill-column' in doc strings only! * Paste in the line "word00 word01 word02 word03 word04 word05 word06 word07 word08 word09 word10 word11" (i.e. 12 words, 83 chars) * M-x fill-paragraph (with point on pasted line above) * The value of `emacs-lisp-docstring-fill-column' (40) is incorrectly used when formatting. The value of `fill-column' (80) should have been used instead, since the point is not in a doc string. Note that the default value of `emacs-lisp-docstring-fill-column' is 65 (rather than nil), so this malformatting is enabled by default. --000000000000f31ae3056d6bcace Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
VERSION
GNU Emacs 26.1 (build 1, x86_64-app= le-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018= -05-28

DESCRIPTION
`emacs-lisp-docst= ring-fill-column' shadows `fill-column' in too many cases in emacs-= lisp-mode. The documentation of `emacs-lisp-docstring-fill-column' stat= es: "Value of =E2=80=98fill-column=E2=80=99 to use when filling a docs= tring". But it incorrectly seems to be used in a lot more cases than j= ust in a docstring (the only case that I've found where =E2=80=98fill-c= olumn=E2=80=99 is actually respected is within comments). A work-around is = to set `emacs-lisp-docstring-fill-column' to nil, but it would be nice = to have it working properly instead.

I might be mi= ssing something, but think the incorrect behavior is to be found in `lisp-f= ill-paragraph' that is invoked by `fill-paragraph' through `fill-pa= ragraph-function'. It seems like `lisp-fill-paragraph' unconditiona= lly sets `fill-column' to `emacs-lisp-docstring-fill-column' withou= t checking whether point is within a doc string first. The only requirement= s for enable shadowing currently seems to be "(and (integerp emacs-lis= p-docstring-fill-column) (derived-mode-p 'emacs-lisp-mode))", whic= h doesn't seems sufficient.

TO REPRODUCE
* emacs -q
* C-x b <return> (i.e. switch to *s= cratch* buffer)
* M-x emacs-lisp-mode
* M-x column-= number-mode (optional)
* (setq fill-column 80) ;used by `fill= -paragraph'
* (setq=C2=A0emacs-lisp-docstring-fill-c= olumn 40) ;should override `fill-column' in doc strings only!
=
* Paste in the line "word00 word01 word02 word03 word04 wor= d05 word06 word07 word08 word09 word10 word11" (i.e. 12 words, 83 char= s)
* M-x fill-paragraph (with point on pasted line above)
* The value of `emacs-lisp-docstring-fill-column' (40) is incorr= ectly used when formatting. The value of `fill-column' (80) should have= been used instead, since the point is not in a doc string.
<= br>
Note that the default value of `emacs-lisp-docstring-fill-col= umn' is 65 (rather than nil), so this malformatting is enabled by defau= lt.
--000000000000f31ae3056d6bcace--