From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eHcNNfy8wGDoQgAAgWs5BA (envelope-from ) for ; Wed, 09 Jun 2021 15:07:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YGdYMPy8wGClDwAAB5/wlQ (envelope-from ) for ; Wed, 09 Jun 2021 13:07:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6302E23744 for ; Wed, 9 Jun 2021 15:07:08 +0200 (CEST) Received: from localhost ([::1]:36838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqxvH-0000ra-Eh for larch@yhetil.org; Wed, 09 Jun 2021 09:07:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqxvD-0000r8-0W for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqxvC-0007VN-Q4 for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqxvC-0002CX-Mi for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48934] [PATCH 2/2] services: configuration: Show default value when it is a Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Jun 2021 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48934 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48934@debbugs.gnu.org Received: via spool by 48934-submit@debbugs.gnu.org id=B48934.16232439978408 (code B ref 48934); Wed, 09 Jun 2021 13:07:02 +0000 Received: (at 48934) by debbugs.gnu.org; 9 Jun 2021 13:06:37 +0000 Received: from localhost ([127.0.0.1]:60764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxum-0002BR-LH for submit@debbugs.gnu.org; Wed, 09 Jun 2021 09:06:36 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:32944 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxuj-0002B1-Mc for 48934@debbugs.gnu.org; Wed, 09 Jun 2021 09:06:34 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1623243988; bh=kKET/OblmL+GlyxnFyNM/fc7x5/iatuyLGKm/wvouB0=; h=From:To:Subject:In-Reply-To:References:Date; b=giHjy4RVTYC9EFBI7bajmKHp1kxJLNxHurPnxv7OIK0Ie+m3HTTY0gOcgWQluDyia FQj1H8T40SXlrWzg8siP73LGr8f65sLEAu0fmV+PoyiioLdvoylivMTZlD9F1a/VOZ CYShK/4MRV+WJUojHNP3ZwULi0y4j84MUsUXWerk= In-Reply-To: References: Message-Id: <9de0174c0818edd7c3f1f58a264a6ea3c5c3be50.1623243063.git.public@yoctocell.xyz> Date: Wed, 09 Jun 2021 15:06:27 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623244028; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lfVx7xaB/92h8sPDgWIbofdlMGDarvdKR4s46Qqs40s=; b=JfACkRBHVFfMqD2HlTvp3Xw0f01bs/Uw+TPY17Tik/JTmU3Hh14cYV9at6jMWilZG0q2iV /BtPY3utjRxACA2lm8ynUOaOmlVqEtzAMYT+m3DMhafMSr7atXyHDObQHpOxGpMvLWqXe6 2Uvw+dLUZF9TfSN5adbZwCWiZ4HvsXoAWhpHWsCxdONu8kV1eHlRiujMhI/BH/P2S4HF2s 7xMeO1Pj81mssm3prBN5rNCFwBY1qwBDJgF/16PnlJxvvdgkG+RAm7WmXMpajP9yjCVXj5 VzFjs6c3k17r88aExTym/ORSljT+TwU6mrR5HY0UK4TMqdO9vu/EyxSQWScouQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623244028; a=rsa-sha256; cv=none; b=MjOGiPvGZsgQnSIukmQqYGQrqDF4VYtxylIAqbLOdetszOc7P9Wri0HTTPNXtLVrUsyDZx Kj11A1Q92UPJaLb1fovPCLpRw+IMeR2dj9X+FInaMW6Y1rc3Cmek2oI+YqF4sZsj9tkaWj pr0saFNPjeMt0TdKIUO8/VkDwpgWkVSYv+vzcZxb5dRpwC25/POYqF0QVM3VFNIDmhGEhQ pnXnwFTSK1QBCjrvCQ9KtPuI51wrNsF0oGtEaRE8W3kE/wOhP3SAE20fCS/XPLyvtYDTaI hvl5SRM/JQpLUZEC99hKrYKppcCQ+sIDEB9bN0uygRSO2Ke4k+W5Nl9CYlc3hg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=giHjy4RV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=giHjy4RV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 6302E23744 X-Spam-Score: -0.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: SXOeQfEczW6n * gnu/services/configuration.scm (generate-documentation): If the default value of a field is a package, show the value of the =E2=80=98name=E2=80= =99 field of the package. This might not be the correct name in some cases though. --- gnu/services/configuration.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index abcbc70520..99687d065a 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -252,12 +252,20 @@ does not have a default value" field kind))) (configuration-field-default-value= -thunk f) (lambda _ '%invalid)))) (define (show-default? val) - (or (string? val) (number? val) (boolean? val) + (or (string? val) (number? val) (boolean? val) = (package? val) (and (symbol? val) (not (eq? val '%invalid)= )) (and (list? val) (and-map show-default? val= )))) + + (define (show-default val) + (cond + ((package? val) + ;; Maybe not always correct. + (package-name val)) + (else (str val)))) + `(entry (% (heading (code ,(str field-name)) ,@(if (show-default? default) - `(" (default: " (code ,= (str default)) ")") + `(" (default: " (code ,= (show-default default)) ")") '()) " (type: " ,(str field-type) --=20 2.32.0