From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id sEwOBLuUOWNn9wAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 02 Oct 2022 15:40:11 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id +ELkA7uUOWNfeAEAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 02 Oct 2022 15:40:11 +0200
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 CE94C45F51
	for <larch@yhetil.org>; Sun,  2 Oct 2022 15:40:10 +0200 (CEST)
Received: from localhost ([::1]:55134 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	id 1oezCT-0007g8-VB
	for larch@yhetil.org; Sun, 02 Oct 2022 09:40:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59858)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1oezCM-0007fy-LM
 for guix-patches@gnu.org; Sun, 02 Oct 2022 09:40:02 -0400
Received: from debbugs.gnu.org ([209.51.188.43]:47448)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1oezCM-0007O9-DI
 for guix-patches@gnu.org; Sun, 02 Oct 2022 09:40:02 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oezCL-0000L2-Ur
 for guix-patches@gnu.org; Sun, 02 Oct 2022 09:40:01 -0400
X-Loop: help-debbugs@gnu.org
Subject: [bug#57963] [PATCH v4 2/2] home: fontutils: Support user's fontconfig.
Resent-From: Taiju HIGASHI <higashi@taiju.info>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Sun, 02 Oct 2022 13:40:01 +0000
Resent-Message-ID: <handler.57963.B57963.16647179611244@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 57963
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>
Cc: 57963@debbugs.gnu.org, liliana.prikler@gmail.com, andrew@trop.in
Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.16647179611244
 (code B ref 57963); Sun, 02 Oct 2022 13:40:01 +0000
Received: (at 57963) by debbugs.gnu.org; 2 Oct 2022 13:39:21 +0000
Received: from localhost ([127.0.0.1]:46526 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1oezBg-0000Jz-Su
 for submit@debbugs.gnu.org; Sun, 02 Oct 2022 09:39:21 -0400
Received: from mail-pj1-f54.google.com ([209.85.216.54]:39497)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@taiju.info>) id 1oezBQ-0000JG-SQ
 for 57963@debbugs.gnu.org; Sun, 02 Oct 2022 09:39:19 -0400
Received: by mail-pj1-f54.google.com with SMTP id
 v10-20020a17090a634a00b00205e48cf845so13101530pjs.4
 for <57963@debbugs.gnu.org>; Sun, 02 Oct 2022 06:39:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject
 :date; bh=sRiIWpUf/Uge/aDdarosjM/VnHNY5oJUfbNXFwzIqrU=;
 b=m5e8AIGQBPKtJqBwYlbhJwlSu8ksKt2VsfdkC+CJcPJsz4WiQCHZSgbjFouf8E7J2v
 3txF/lSJJiBtIOtU5A+0LOVEH2b6eLgJunCcsofwsMibnN5At7iefsH71iuO60D5EVky
 1mjkP9gl6MPQpEgkW/6h+zs9uI1OxUUzgLChrnihJeHfUQREVlgQJkssay0rGUus5ZpX
 njLH3ASV5gvra3EW9mp9jxtMqAqXB7UX3chGU68ekd/8HptOgfMXpEpbNcuv1Mv/fBaq
 hV2fG44OpzK5+pi1CSqwlHbbU2m4Y8o47cwDDzSMgd8lMBylqdyWODiNufY/qdrt6XYe
 lw2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state
 :from:to:cc:subject:date;
 bh=sRiIWpUf/Uge/aDdarosjM/VnHNY5oJUfbNXFwzIqrU=;
 b=lf6V0W88olWbF3wcDT0znXalgYMU8cDMVuEh70rrJVHMll2/DT0Oiwchu+V4UCXJXS
 vnjetmgIvYqrIaOU3+rNZZnXaybaOJUl+UPVXCtx0dezpcVWDM8ld03mSNJg8KPWktL2
 IPrMtmLQzrk7X2sEQHl0JGhSMZSLtv8aNgVc0qjtCvM5l4gvGq9OauLVPlM4NSTUOxxj
 +anJxfoA1/shvkn1TzUKYJBdSnJBW19NMeCi58ks8TAhgPBCOv5pzi/R7zTetR74omCW
 kz8V0EV6CxRFHfGVenu5lLUpldpXz/eTVSOXxFxe5ownm9bYR5qS/PWWQcEYGzSZsjbO
 /Z6Q==
X-Gm-Message-State: ACrzQf1r33DZb3jAQU7SWH5bFwWhfrbwfMWQP5xcNQ5u5skNZ3o5vO/C
 sngP2JRb9SkulmsFN+ZmDrgQ3Q==
X-Google-Smtp-Source: AMsMyM47I6oyjR1pojPS+9giV6Liked/VeyI3g7Ku7K/OdN+TCe6LAocKP6qTTJYPS5oH8/5LRUhLA==
X-Received: by 2002:a17:903:124b:b0:179:da2f:2457 with SMTP id
 u11-20020a170903124b00b00179da2f2457mr17607878plh.156.1664717938931; 
 Sun, 02 Oct 2022 06:38:58 -0700 (PDT)
Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 d79-20020a621d52000000b0056012d934fasm2548462pfd.156.2022.10.02.06.38.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 02 Oct 2022 06:38:58 -0700 (PDT)
From: Taiju HIGASHI <higashi@taiju.info>
References: <20220929143633.28844-1-higashi@taiju.info>
 <20220929143633.28844-2-higashi@taiju.info> <87ill3b41t.fsf@gnu.org>
Date: Sun, 02 Oct 2022 22:38:55 +0900
In-Reply-To: <87ill3b41t.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s
 message of "Sat, 01 Oct 2022 23:57:18 +0200")
Message-ID: <87pmfapcpc.fsf@taiju.info>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
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: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: "Guix-patches" <guix-patches-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1664718010;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc: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=sRiIWpUf/Uge/aDdarosjM/VnHNY5oJUfbNXFwzIqrU=;
	b=AgisTAQMRU3glr5wDMPAtw/F8aU0Z9plnMsh3AlQ+2LvpGY7RRCRAmBw9ch5/HurZZEvaI
	d6aCNYlbdtnDAF2YEhBXc4IiQyXDlNHpskuJCLXlE8yEDPoXeoQ7K8LZsIz52XDROzBL29
	qSG5svR8c5QAaD4yDcp5ch7EJ+9LoRUot6xumJhV97Ctmuhi8x0H6iaMZeeiYP1Uo76phk
	p0zKPmdQyf9a7BCKegBtnEQwOUb96LI4jVSn4PLAq/FHhoz8Em6Ut4G16GXtX23LWBMFzF
	ExvH4C+7e1GiqGJc52ttAOYNOqCNi8iY0QP06qpKKkZvjgT5K3rO02uBjA80ng==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664718010; a=rsa-sha256; cv=none;
	b=esGR4pBknSSXHeFZXm9AgZlirsqF4OrhW+ARJFz0hQhCeK8M79OI7648olvlUAGnBGN7ds
	ulU1CJDgPq3NzhQpxHOuMHdg2V5xbaQhPnkVqiTi5PYsuS2QEph60sMVC4fwPmFDcMQz5e
	UU8bDDFbIfAQXA2CorrduDwE2qv7SeHG8jaTvk2xm7xrqS8h9QQ5Y0Ev+PYsELVyfUGm1W
	JC1axk0IrvZRU4kBH6xfKka8mukrQWzQ+FvXkmIow/zZRIAn+fuv5txJ9atuRRFqadizkT
	1qpnNYT0NdXy7zlW0bYEKc09mJhfcMD+7gSgasBQAszuelofZSqykI9QsCEsLQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=m5e8AIGQ;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Spam-Score: 3.36
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=m5e8AIGQ;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Queue-Id: CE94C45F51
X-Spam-Score: 3.36
X-Migadu-Scanner: scn0.migadu.com
X-TUID: nYLTFL3GogGr

Hi,

Ludovic Court=C3=A8s <ludo@gnu.org> writes:

> Taiju HIGASHI <higashi@taiju.info> skribis:
>
>> * gnu/home/services/fontutils.scm: Support user's fontconfig.
>
> I=E2=80=99m nitpicking a bit, but here we would describe all the
> variables/procedures added, removed, or modified.  Please check =E2=80=98=
git
> log=E2=80=99 for examples.
>
> Regarding code, there=E2=80=99s a convention to add a docstring to each
> top-level procedure:
>
>   https://guix.gnu.org/manual/devel/en/html_node/Formatting-Code.html
>
> It would be nice to follow it here.

I have listed them all in the v5 patch.
As for the serializer/predicate procedure, I did not add it because
there was no docstring in the existing procedure.

>> +(define (default-font-sanitizer type)
>> +  (lambda (value)
>> +    (if (null? value)
>> +        value
>> +        `(alias
>> +          (family ,type)
>> +          (prefer
>> +           (family ,value))))))
>
> Giving '() special meaning here looks quite unusual.  As Liliana wrote,
> we=E2=80=99d usually use #f as the value denoting =E2=80=9Cnothing=E2=80=
=9D.

I may have confused it with Common Lisp.  I have eliminated the field
with the empty list as the default value.

>> +(define (sxml->xmlstring sxml)
>> +  (if (null? sxml)
>> +      ""
>> +      (call-with-output-string
>> +        (lambda (port)
>> +          (sxml->xml sxml port)))))
>
> Same here.  Also, =E2=80=9Cxml-string=E2=80=9D rather than =E2=80=9Cxmlst=
ring=E2=80=9D.

Fixed to xml-string.

>> +(define font-directories? list?)
>
> Is it really needed?

I may not have addressed this point yet. Is it possible to not define a
predicate procedure to be used for a configuration field?

>> +(define (serialize-font-directories field-name value)
>> +  (sxml->xmlstring
>> +   (append
>> +       '((dir "~/.guix-home/profile/share/fonts"))
>> +       (map
>> +        (lambda (path)
>> +          `(dir ,path))
>> +        value))))
>
> The indentation would rather be:
>
>   (append '((dir =E2=80=A6))
>           (map (lambda (directory)
>                  `(dir ,directory))
>                value))

I think I fixed it by refactoring.

>> +   (map (match-lambda
>> +          ((? pair? sxml) sxml)
>> +          ((? string? xml) (xml->sxml xml))
>> +          (_ (error "extra-config value must be xml string or sxml list=
.")))
>
> Instead of =E2=80=98error=E2=80=99, which would lead to an ugly backtrace=
 and an
> untranslated error message, write:
>
>   (raise (formatted-message (G_ "'extra-config' =E2=80=A6")))
>
> without a trailing dot in the message.

I have fixed it.

> The rest LGTM!  Like I wrote, could you please add documentation in
> =E2=80=98doc/guix.texi=E2=80=99, with a configuration example like the on=
e you gave?

Since there were many points raised and interface changes in this case,
I will revise the document after the review is complete.

Thanks,
--
Taiju