From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: efraim@flashner.co.il
Cc: "Ludovic Courtès" <ludo@gnu.org>, guix-devel <guix-devel@gnu.org>
Subject: Re: Feedback on indentation rules
Date: Wed, 01 Mar 2023 10:17:08 -0500 [thread overview]
Message-ID: <87356oijrf.fsf@gmail.com> (raw)
In-Reply-To: <Y/0BMxFV2s838iRL@3900XT> (Efraim Flashner's message of "Mon, 27 Feb 2023 21:14:59 +0200")
Hi Efraim,
Efraim Flashner <efraim@flashner.co.il> writes:
> On Thu, Feb 23, 2023 at 05:20:55PM -0500, Maxim Cournoyer wrote:
>> -CC bug#61255
>> +CC guix-devel
>>
>> Hi Ludovic and guix-devel readers,
>>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>> > Hi,
>> >
>> > Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>> >
>> >> Ludovic Courtès <ludo@gnu.org> writes:
>> >>
>>
>> [...]
>>
>> >>> I’m not convinced by the indentation rule for ‘gexp->derivation’ added
>> >>> in 82daab42811a2e3c7684ebdf12af75ff0fa67b99: there’s no reason to treat
>> >>> ‘gexp->derivation’ differently from other procedures.
>> >>
>> >> The benefit I saw was that writing
>> >>
>> >> (gexp->derivation the-name
>> >> #~(begin
>> >> (the
>> >> (multi-line
>> >> (gexp)))))
>> >
>> > I understand, but you know, it’s best to avoid unilaterally changing
>> > established conventions. :-)
>> >
>> > If and when there’s consensus about this change, (guix read-print)
>> > should be updated.
>>
>> OK. I'm not against soliciting more opinions; I'm CC'ing guix-devel,
>> hoping some opinionated individuals tip in on this 2021
>> 82daab42811a2e3c7684ebdf12af75ff0fa67b99 commit, more specifically, the
>> part that change the indentation rules for .dir-locals.el like this:
>>
>> --8<---------------cut here---------------start------------->8---
>> + (eval . (put 'gexp->derivation 'scheme-indent-function 1))
>> --8<---------------cut here---------------end--------------->8---
>>
>> In the same spirit there was also
>> b1c25e2ce364741d1c257d3bb3ab773032807a80 (".dir-locals.el: Add
>> indentation rule for computed-file.") made more recently (last month).
>>
>> The idea was to be able to format gexp->derivation like this:
>>
>> --8<---------------cut here---------------start------------->8---
>> (gexp->derivation "check-deb-pack"
>> (with-imported-modules '((guix build utils))
>> #~(begin
>> (use-modules (guix build utils)
>> (ice-9 match)
>> (ice-9 popen)
>> (ice-9 rdelim)
>> (ice-9 textual-ports)
>> (rnrs base))
>> [...]
>> --8<---------------cut here---------------end--------------->8---
>>
>> Rather than like this:
>>
>> --8<---------------cut here---------------start------------->8---
>> (gexp->derivation "check-deb-pack"
>> (with-imported-modules '((guix build utils))
>> #~(begin
>> (use-modules (guix build utils)
>> (ice-9 match)
>> (ice-9 popen)
>> (ice-9 rdelim)
>> (ice-9 textual-ports)
>> (rnrs base))
>> --8<---------------cut here---------------end--------------->8---
>>
>> (or having to use another 'builder' variable, for example).
>>
>> What do you all think?
>
> The second one is waaaay to indented. For myself I sometimes end up
> wrapping the lines (although I don't love it) so it looks like this:
>
> (gexp->derivation
> "check-deb-pack"
> (with-imported-modules '((guix build utils))
> #~(begin
> (use-modules (guix build utils)
> (ice-9 match)
> (ice-9 popen)
> (ice-9 rdelim)
> (ice-9 textual-ports)
> (rnrs base))
Thanks for the feedback. I wonder if some are of the opinion that since
gexp->derivation is a plain function rather than a syntax having a
special form for its 2nd argument, we should leave the default
indentation rules untouched for it?
My take on this would be a pragmatic one: readable code trumps
indentation rules purity, but I'm interested to gather all the views.
--
Thanks,
Maxim
next prev parent reply other threads:[~2023-03-01 15:18 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 16:19 [bug#61255] [PATCH 0/5] Add support for the RPM format to "guix pack" Maxim Cournoyer
2023-02-03 22:14 ` [bug#61255] [PATCH 1/5] pack: Extract keyword-ref procedure from debian-archive Maxim Cournoyer
2023-02-03 22:14 ` [bug#61255] [PATCH 2/5] gexp: computed-file: Honor %guile-for-build Maxim Cournoyer
2023-02-04 1:11 ` Ludovic Courtès
2023-02-04 3:43 ` Maxim Cournoyer
2023-02-12 18:14 ` [bug#61255] [PATCH 0/5] Add support for the RPM format to "guix pack" Ludovic Courtès
2023-02-16 15:12 ` Maxim Cournoyer
2023-02-23 15:44 ` [bug#61255] (%guile-for-build) default in ‘computed-file’ Ludovic Courtès
2023-02-24 2:38 ` Maxim Cournoyer
2023-02-27 15:10 ` bug#61841: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" Ludovic Courtès
2023-02-27 16:41 ` Maxim Cournoyer
2023-02-27 21:08 ` bug#61841: ‘guix shell’ computes different package derivation than ‘guix build’ Ludovic Courtès
2023-02-28 2:25 ` Maxim Cournoyer
2023-02-03 22:14 ` [bug#61255] [PATCH 3/5] pack: Extract populate-profile-root from self-contained-tarball/builder Maxim Cournoyer
2023-02-03 22:14 ` [bug#61255] [PATCH 4/5] tests: pack: Fix indentation Maxim Cournoyer
2023-02-12 18:20 ` [bug#61255] [PATCH 0/5] Add support for the RPM format to "guix pack" Ludovic Courtès
2023-02-16 15:22 ` Maxim Cournoyer
2023-02-23 15:47 ` Ludovic Courtès
2023-02-23 22:20 ` Feedback on indentation rules (was: [PATCH 0/5] Add support for the RPM format to "guix pack") Maxim Cournoyer
2023-02-27 19:14 ` Efraim Flashner
2023-03-01 15:17 ` Maxim Cournoyer [this message]
2023-03-06 16:56 ` Feedback on indentation rules Ludovic Courtès
2023-03-07 13:46 ` Simon Tournier
2023-03-07 16:54 ` Maxim Cournoyer
2023-03-07 17:29 ` Simon Tournier
2023-03-09 13:55 ` Maxim Cournoyer
2023-03-15 16:15 ` Ludovic Courtès
2023-03-17 16:16 ` Maxim Cournoyer
2023-02-03 22:14 ` [bug#61255] [PATCH 5/5] pack: Add RPM format Maxim Cournoyer
2023-02-12 18:52 ` [bug#61255] [PATCH 0/5] Add support for the RPM format to "guix pack" Ludovic Courtès
2023-02-16 22:17 ` Maxim Cournoyer
2023-02-12 18:57 ` Ludovic Courtès
2023-02-16 15:25 ` Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 0/8] " Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 1/8] .dir-locals: Add let-keywords indentation rules Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 2/8] pack: Use let-keywords instead of keyword-ref Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 3/8] gexp: computed-file: Honor %guile-for-build Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 4/8] pack: Extract populate-profile-root from self-contained-tarball/builder Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 5/8] tests: pack: Fix indentation Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 6/8] pack: Add RPM format Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 7/8] etc: Add a news entry snippet Maxim Cournoyer
2023-02-17 1:49 ` [bug#61255] [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format Maxim Cournoyer
2023-02-17 6:34 ` Julien Lepiller
2023-02-17 17:32 ` Maxim Cournoyer
2023-02-17 15:12 ` pelzflorian (Florian Pelz)
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=87356oijrf.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=efraim@flashner.co.il \
--cc=guix-devel@gnu.org \
--cc=ludo@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 external index
https://git.savannah.gnu.org/cgit/guix.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.