From: Bruno Victal <mirai@makinata.eu>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 60582@debbugs.gnu.org
Subject: [bug#60582] [PATCH] Properly format list of packages & sync lightdm documentation.
Date: Fri, 13 Jan 2023 20:34:15 +0000 [thread overview]
Message-ID: <62b2b844-5024-f66b-7c48-a3ac5ff114c8@makinata.eu> (raw)
In-Reply-To: <87cz7ifaad.fsf_-_@gmail.com>
On 2023-01-13 20:29, Maxim Cournoyer wrote:
> Hi,
>
> Bruno Victal <mirai@makinata.eu> writes:
>
>> * gnu/services/configuration.scm
>> (generate-documentation): Format a list of packages by their names.
>> ---
>> gnu/services/configuration.scm | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
>> index 6b0291dc00..16e2380709 100644
>> --- a/gnu/services/configuration.scm
>> +++ b/gnu/services/configuration.scm
>> @@ -370,6 +370,9 @@ (define (show-default val)
>> (cond
>> ((package? val)
>> (symbol->string (package->symbol val)))
>> + ((and ((list-of package?) val) (not (null? val)))
>> + (format #f "(~{~a~^ ~})"
>> + (map package->symbol val)))
>
> The 'and' and (not (null? val)) don't seem to be necessary as in the
> empty list of packages, it'd produce the same as the else clause below:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(gnu services configuration)> (format #f "(~{~a~^ ~})" '())
> $1 = "()"
> scheme@(gnu services configuration)> (str '())
> $2 = "()"
> --8<---------------cut here---------------end--------------->8---
>
>> (else (str val))))
>>
>> `(entry (% (heading
>
It is necessary for non file-like fields whose default value is '().
Otherwise configuration->documentation will show blank spaces when it should show an empty list.
Cheers,
Bruno
next prev parent reply other threads:[~2023-01-13 20:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 21:01 [bug#60582] [PATCH] Properly format list of packages & sync lightdm documentation Bruno Victal
2023-01-05 21:06 ` [bug#60582] [PATCH 1/2] services: configuration: Format a list of packages by their names Bruno Victal
2023-01-13 20:29 ` [bug#60582] [PATCH] Properly format list of packages & sync lightdm documentation Maxim Cournoyer
2023-01-13 20:34 ` Bruno Victal [this message]
2023-01-05 21:06 ` [bug#60582] [PATCH 2/2] services: lightdm: Sync documentation with source Bruno Victal
2023-01-06 14:10 ` [bug#60582] [PATCH v2 1/2] services: configuration: Format a list of packages by their names Bruno Victal
2023-01-06 14:10 ` [bug#60582] [PATCH v2 2/2] services: lightdm: Sync documentation with source Bruno Victal
2023-01-13 21:34 ` [bug#60582] [PATCH v3 1/2] services: configuration: Format a list of packages by their names Bruno Victal
2023-01-13 21:34 ` [bug#60582] [PATCH v3 2/2] services: lightdm: Sync documentation with source Bruno Victal
2023-02-09 3:39 ` [bug#60582] [PATCH] Properly format list of packages & sync lightdm documentation Maxim Cournoyer
2023-02-09 16:17 ` Bruno Victal
2023-02-09 16:42 ` Maxim Cournoyer
2023-02-09 4:00 ` bug#60582: " Maxim Cournoyer
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://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62b2b844-5024-f66b-7c48-a3ac5ff114c8@makinata.eu \
--to=mirai@makinata.eu \
--cc=60582@debbugs.gnu.org \
--cc=maxim.cournoyer@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 public inbox
https://git.savannah.gnu.org/cgit/guix.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).