From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: 2a73673 Change how thread-first/thread-last indent the first argument Date: Tue, 05 Oct 2021 03:41:20 -0500 Message-ID: <875yubx3rj.fsf@alphapapa.net> References: <87ee90vtye.fsf@alphapapa.net> <87czoj7wlk.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10698"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 05 10:54:52 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXgDq-0002XG-B4 for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Oct 2021 10:54:50 +0200 Original-Received: from localhost ([::1]:38604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXgDp-0000b9-9L for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Oct 2021 04:54:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXg0x-0003zw-9P for emacs-devel@gnu.org; Tue, 05 Oct 2021 04:41:31 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:37358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXg0v-0005Kj-53 for emacs-devel@gnu.org; Tue, 05 Oct 2021 04:41:30 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mXg0t-0005IW-1U for emacs-devel@gnu.org; Tue, 05 Oct 2021 10:41:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276313 Archived-At: Lars Ingebrigtsen writes: > Adam Porter writes: > >> In this commit, you changed the thread-last macro's indentation from >> (indent 1) to (indent 0). > > The change made the macro indent the way it was documented to indent (in > the doc string): > > "Thread FORMS elements as the first argument of their successor. > Example: > (thread-first > 5 > (+ 20) > (/ 25) > - > (+ 40)) It would only be a two-character, whitespace-only change to "fix" the docstring. ;) >> Could this be reverted, please? This change >> has two drawbacks: >> >> 1. The threaded form is no longer indented differently from the other >> forms, so it no longer stands out. > > I don't really have an opinion here -- I can revert the change if that's > what people that use the macro wants. It just looked really wrong to me > to indent the first element specially, but I don't use these macros in > Emacs. I don't think ->> indents the first element specially in > Clojure, for instance? (At least I don't remember them doing so.) You're right about Clojure. And, in fact, Dash.el does follow Clojure there in its implementation of `->>', et al. However, earlier this year, Basil adjusted its indentation to be in line with how `thread-last' used to indent, with the first form indented more: https://github.com/magnars/dash.el/pull/375 And perhaps ironically, it was me who convinced him to revert that change and restore the Clojure-like indentation. My reasoning was the same as my second reason posted here: it results in lots of whitespace churn downstream. At the same time, I agree with Basil that we need not follow Clojure's conventions, and using first-form indentation is more useful. Another issue is that, since older Emacs versions persist in the wild for years, this will result in code changing indentation between Emacs versions: if someone submits a patch based on Emacs <28, it will have one indentation, and if the maintainer uses Emacs 28, it will have another indentation. Finally, changing the indentation will break indentation linters. For example, in https://github.com/alphapapa/makem.sh I use the lint-indent rule to ensure that code is correctly indented, and I test some of my packages on multiple Emacs versions in CI. This change will cause linting to always fail on one Emacs version or another, so it won't be possible to have a clean linting anymore. So if this were reverted, I'd be grateful.