unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Re: 2a73673 Change how thread-first/thread-last indent the first argument
Date: Wed, 06 Oct 2021 05:49:15 -0500	[thread overview]
Message-ID: <87k0iqv36c.fsf@alphapapa.net> (raw)
In-Reply-To: 87bl42frku.fsf@gnus.org

Lars Ingebrigtsen <larsi@gnus.org> writes:

> That's true of any indentation change, but we do make those, anyway.  In
> Emacs 28 we changed how
>
> '( foo
>    bar)
>
> is indented

I would argue that that's introducing a new feature rather than changing
how an existing form is indented, because such a form with a space
before the first element didn't indent differently than one without a
space, so there was no reason to write a form that way before this
change.

> and in Emacs 29 we've changed how cl-flet is indented.

> (The first change probably didn't entail any churn because nobody wrote
> something like that before, but the cl-flet one does introduce churn.)

Yes, but that's fixing a longstanding bug, a clear incompatibility with
CL, and the unfixed cl-flet indentation is purely a drawback (causing
too-long lines where they'd otherwise be within fill-column).

> So the question is whether the old indentation was a bug or not, and it
> looks like a bug to me.  That is, the only documentation of the form we
> have indents the way it does now (after the change).  On the other hand,
> the documentation could be incorrect.

Looking at vc-region-history for thread-last, it's only been touched 3
times: most recently in this indentation change, then in 2014 when Paul
Eggert fixed a typo in the docstring, and firstly in the same year when
Fabián Ezequiel Gallina introduced the macro.  I would argue that Fabián
wrote "(declare (indent 1))" intentionally, and the fact that the "5" in
the docstring example was not indented by two more spaces was an
oversight, probably explained by having manually indented the code in
the docstring.

So I would argue that the bug was in the example in the docstring, not
in the code.  And given that offsetting the first form is more useful,
and that it's in line with other macros whose first form is special
(e.g. `prog1'), the indentation for `thread-first' and `thread-last'
should not be changed to match the erroneous docstring.  It would be
preferable to just fix the docstring.




      parent reply	other threads:[~2021-10-06 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  6:58 2a73673 Change how thread-first/thread-last indent the first argument Adam Porter
2021-10-05  7:35 ` Lars Ingebrigtsen
2021-10-05  8:41   ` Adam Porter
2021-10-05 14:50     ` Basil L. Contovounesios
2021-10-06  9:08     ` Lars Ingebrigtsen
2021-10-06 10:27       ` Stefan Kangas
2021-10-06 11:32         ` Adam Porter
2021-10-06 10:49       ` Adam Porter [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87k0iqv36c.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).