all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Guath <stefan@automata.se>
To: eliz@gnu.org
Cc: 31656@debbugs.gnu.org, npostavs@gmail.com
Subject: bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode
Date: Fri, 1 Jun 2018 16:34:31 +0200	[thread overview]
Message-ID: <CAD__r-8t7PDKDrkktuhwgj7W9X5FQgg0A3A8sNUQc=Sv-=_r8g@mail.gmail.com> (raw)
In-Reply-To: <83lgbyfz3w.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3659 bytes --]

On Fri, Jun 1, 2018 at 2:52 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Stefan 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 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!

[-- Attachment #2: Type: text/html, Size: 5419 bytes --]

  reply	other threads:[~2018-06-01 14:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 12:50 bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode Stefan Guath
2018-06-01  9:20 ` Eli Zaretskii
2018-06-01  9:39   ` Noam Postavsky
2018-06-01 10:36     ` Stefan Guath
2018-06-01 12:52       ` Eli Zaretskii
2018-06-01 14:34         ` Stefan Guath [this message]
2018-06-01 15:10           ` Eli Zaretskii
2018-06-01 12:43     ` Eli Zaretskii
2018-06-02  1:45       ` Noam Postavsky
2018-06-02  6:41         ` Eli Zaretskii
2018-06-02 13:07           ` Noam Postavsky
2018-06-02 13:25             ` martin rudalics
2018-06-02 13:34               ` Noam Postavsky
2018-06-02 14:09             ` Eli Zaretskii
2018-06-03 12:51               ` Stefan Guath
2020-08-22 15:23             ` Lars Ingebrigtsen
2022-04-13  3:06               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD__r-8t7PDKDrkktuhwgj7W9X5FQgg0A3A8sNUQc=Sv-=_r8g@mail.gmail.com' \
    --to=stefan@automata.se \
    --cc=31656@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.