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: Fri, 1 Jun 2018 16:34:31 +0200 Message-ID: References: <83sh66g8wb.fsf@gnu.org> <87bmcuc0bo.fsf@gmail.com> <83lgbyfz3w.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005fa5ab056d957c6c" X-Trace: blaine.gmane.org 1527863652 26411 195.159.176.226 (1 Jun 2018 14:34:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 14:34:12 +0000 (UTC) Cc: 31656@debbugs.gnu.org, npostavs@gmail.com To: eliz@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 01 16:34:07 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 1fOl82-0006k6-S1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 16:34:07 +0200 Original-Received: from localhost ([::1]:56057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOlA8-00012q-BB for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 10:36:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOl9x-00012f-Nm for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 10:36:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOl9u-0005kA-H4 for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 10:36:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOl9u-0005jl-Df for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 10:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fOl9t-0001z0-Uf for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 10:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Guath Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jun 2018 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31656 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31656-submit@debbugs.gnu.org id=B31656.15278637057541 (code B ref 31656); Fri, 01 Jun 2018 14:36:01 +0000 Original-Received: (at 31656) by debbugs.gnu.org; 1 Jun 2018 14:35:05 +0000 Original-Received: from localhost ([127.0.0.1]:58121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOl8y-0001xZ-L5 for submit@debbugs.gnu.org; Fri, 01 Jun 2018 10:35:05 -0400 Original-Received: from [85.112.160.81] (port=43814 helo=mail.automata.se) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOl8w-0001x1-3G for 31656@debbugs.gnu.org; Fri, 01 Jun 2018 10:35:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.automata.se (Postfix) with ESMTP id 1164F3A123 for <31656@debbugs.gnu.org>; Fri, 1 Jun 2018 16:34:56 +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 BT93hYpDGTjX for <31656@debbugs.gnu.org>; Fri, 1 Jun 2018 16:34:49 +0200 (CEST) Original-Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by mail.automata.se (Postfix) with ESMTPSA id 2C6BD3A125 for <31656@debbugs.gnu.org>; Fri, 1 Jun 2018 16:34:48 +0200 (CEST) Original-Received: by mail-wr0-f176.google.com with SMTP id y15-v6so36558311wrg.11 for <31656@debbugs.gnu.org>; Fri, 01 Jun 2018 07:34:48 -0700 (PDT) X-Gm-Message-State: ALKqPwepKe/sikmp2kwM5eioK1l6roMnmQD9sAIsUHyaKDHM2OLNRPlX /MCVamlWR0HG2WVek+AGcd9a1cN9/19Cg2wIUOI= X-Google-Smtp-Source: ADUXVKLhxcUwv+p2Cd9RMMT2MVW16ieKDxyFxRGLyIQ52VGF2/xAKkNnHDq4oqpwpvaczxWglEgE7hl/wASxUtnJvuw= X-Received: by 2002:adf:b0da:: with SMTP id j26-v6mr8314707wra.3.1527863687749; Fri, 01 Jun 2018 07:34:47 -0700 (PDT) In-Reply-To: <83lgbyfz3w.fsf@gnu.org> X-Gmail-Original-Message-ID: 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:146830 Archived-At: --0000000000005fa5ab056d957c6c Content-Type: text/plain; charset="UTF-8" On Fri, Jun 1, 2018 at 2:52 PM Eli Zaretskii wrote: > > From: Stefan Guath > > Date: Fri, 1 Jun 2018 12:36:00 +0200 > > Cc: eliz@gnu.org, 31656@debbugs.gnu.org > > > > The very idea of shadowing the global `fill-column' in the first place > breaks the Principle Of Least > > Astonishment > > If that is so, then we should have gobs of astonished users since 1995. > Yes, the streets are flooded with them! But Emacs users are a tough crowd that don't complain :) > > and introduces annoyance and extra work for the user when trying to > understand why the > > explicit setting of `fill-column' is not respected. > > Documenting the current behavior should go a long way towards helping > users understand that, right? > Sure, but I guess I don't understand exactly what that behavior is though (see below)... > > So, I guess my basic question is what value > `emacs-lisp-docstring-fill-column' tries to add? > > From my POV, the answer is clear: it allows users to have different > customizable defaults for fill-column in Emacs Lisp and elsewhere. > If that was the only intention, that functionality was already present (I guess way long before 1995) by just doing: (add-hook 'emacs-lisp-mode-hook (lambda () (setq fill-column 80))) ;fill-column is buffer-local > E.g., in text modes, it is customary to enlarge the default to 79 or > thereabouts, but in Emacs Lisp we generally say that good style is to > make lines in doc strings no wider than 60 characters (see the ELisp > manual). > Doc strings, sure. But outside doc string, as it behaves now? Nah. But even if that was the case, then just use the buffer local fill-column in a hook (as above). No need to introduce redundant mechanisms. > > To me this entire functionality should either be removed or fixed so > that its behavior reflects its current docs. In > > its current state it just malformats elisp files in unexpected ways. Or > am I missing something? > > I'm sorry, but after so many years we had this working, But it has never been working. If we by "working" mean "behaves as its name suggest, and as the doc describes" that is. removing this > functionality is out of the question. Yes, I can see that. Sorry, that was a bad suggestion from me. > I suggested to fix the docs to > match the implementation; if someone has other suggestions that don't > break existing behavior, or at least let users get back existing > behavior, please describe those suggestions. > > Thanks. > Ok, I'll take a stab at the easy way out and just update the docs. When looking at the implementation in the function lisp-fill-paragraph, the outer or-clause seems to separate two cases: 1) if in a comment use fill-column, else 2) bind fill-column to emacs-lisp-docstring-fill-column and call fill-paragraph. Does that seem to be correct? In that case the current doc could be changed from "Value of `fill-column' to use when filling a docstring..." to "Value of `fill-column' to use in emacs-elisp-mode except in comments". But I still think the original intent of emacs-lisp-docstring-fill-column (as described in its current doc) is useful, and would of course prefer if we rather could update the implementation to reflect that functionality instead. I'm just not knowledgeable enough to do a PR. Would it be difficult? BTW, as a side note, I just wanted to add that this bug report is of course a very small detail. Also, if my language sounds a bit harsh, its just because I'm in a hurry. I'm really grateful to you and the community for putting in all the hard work so that people like me can use such a superior tool - thanks a million! --0000000000005fa5ab056d957c6c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, Jun 1, 2018 at 2:52 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Stef= an Guath <stefan= @automata.se>
> Date: Fri, 1 Jun 2018 12:36:00 +0200
> Cc: eliz@gnu.org= , 31656@debbugs.= gnu.org
>
> The very idea of shadowing the global `fill-column' in the first p= lace breaks the Principle Of Least
> Astonishment

If that is so, then we should have gobs of astonished users since 1995.
=

Yes, the streets are flooded with them! Bu= t Emacs users are a tough crowd that don't complain :)
= =C2=A0
> and introduces annoyance and extra work for the user when trying to un= derstand why the
> explicit setting of `fill-column' is not respected.

Documenting the current behavior should go a long way towards helping
users understand that, right?

Sure, but= I guess I don't understand exactly what that behavior is though (see b= elow)...
=C2=A0
> So, I guess my basic question is what value `emacs-lisp-docstring-fill= -column' tries to add?

>From my POV, the answer is clear: it allows users to have different
customizable defaults for fill-column in Emacs Lisp and elsewhere.

If that was the only intention, that functional= ity was already present (I guess way long before 1995) by just doing:
=
(add-hook 'emacs-lisp-mode-hook (lambda () (setq fill-column 80)))= ;fill-column is buffer-local
=C2=A0
E.g., in text modes, it is customary to enlarge the default to 79 or
thereabouts, but in Emacs Lisp we generally say that good style is to
make lines in doc strings no wider than 60 characters (see the ELisp
manual).

Doc strings, sure. But outside= doc string, as it behaves now? Nah. But even if that was the case, then ju= st use the buffer local fill-column in a hook (as above). No need to introd= uce redundant mechanisms.
=C2=A0
> To me this entire functionality should either be removed or fixed so t= hat its behavior reflects its current docs. In
> its current state it just malformats elisp files in unexpected ways. O= r am I missing something?

I'm sorry, but after so many years we had this working,

But it has never been working. If we by "working"= ; mean "behaves as its name suggest, and as the doc describes" th= at is.

removing this
functionality is out of the question.

Yes, = I can see that. Sorry, that was a bad suggestion from me.
=C2= =A0
=C2=A0 I suggest= ed to fix the docs to
match the implementation; if someone has other suggestions that don't break existing behavior, or at least let users get back existing
behavior, please describe those suggestions.

Thanks.

Ok, I'll take a stab at the= easy way out and just update the docs. When looking at the implementation = in the function lisp-fill-paragraph, the outer or-clause seems to separate = two cases: 1) if in a comment use fill-column, else 2) bind fill-column to = emacs-lisp-docstring-fill-column and call fill-paragraph. Does that seem to= be correct? In that case the current doc could be changed from "Value= of `fill-column' to use when filling a docstring..." to "Val= ue of `fill-column' to use in emacs-elisp-mode except in comments"= .

But I still think the original intent of emacs-l= isp-docstring-fill-column (as described in its current doc) is useful, and = would of course prefer if we rather could update the implementation to refl= ect that functionality instead. I'm just not knowledgeable enough to do= a PR. Would it be difficult?

BTW, as a side n= ote, I just wanted to add that this bug report is of course a very small de= tail. Also, if my language sounds a bit harsh, its just because I'm in = a hurry. I'm really grateful to you and the community for putting in al= l the hard work so that people like me can use such a superior tool - thank= s a million!

--0000000000005fa5ab056d957c6c--