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:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id cPf9HEQSYmOBxwAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 02 Nov 2022 07:46:28 +0100
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id yEj1HEQSYmNjzwAAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 02 Nov 2022 07:46:28 +0100
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 1C9A49EC6
	for <larch@yhetil.org>; Wed,  2 Nov 2022 07:46:27 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1oq7Vp-0003i6-Eu; Wed, 02 Nov 2022 02:46:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 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 1oq7Vk-0003f6-JW
 for guix-patches@gnu.org; Wed, 02 Nov 2022 02:46:05 -0400
Received: from debbugs.gnu.org ([209.51.188.43])
 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 1oq7Vi-0007TO-3b
 for guix-patches@gnu.org; Wed, 02 Nov 2022 02:46:04 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oq7Vh-0008Fb-IY
 for guix-patches@gnu.org; Wed, 02 Nov 2022 02:46:01 -0400
X-Loop: help-debbugs@gnu.org
Subject: [bug#57963] [PATCH v5 2/2] home: services: Support user's fontconfig
 configuration.
Resent-From: Liliana Marie Prikler <liliana.prikler@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Wed, 02 Nov 2022 06:46:01 +0000
Resent-Message-ID: <handler.57963.B57963.166737154531690@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: Taiju HIGASHI <higashi@taiju.info>
Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>, 57963@debbugs.gnu.org,
 Andrew Tropin <andrew@trop.in>
Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.166737154531690
 (code B ref 57963); Wed, 02 Nov 2022 06:46:01 +0000
Received: (at 57963) by debbugs.gnu.org; 2 Nov 2022 06:45:45 +0000
Received: from localhost ([127.0.0.1]:44745 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1oq7VR-0008F4-9c
 for submit@debbugs.gnu.org; Wed, 02 Nov 2022 02:45:45 -0400
Received: from mail-ed1-f65.google.com ([209.85.208.65]:37733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@gmail.com>) id 1oq7VQ-0008Es-FZ
 for 57963@debbugs.gnu.org; Wed, 02 Nov 2022 02:45:44 -0400
Received: by mail-ed1-f65.google.com with SMTP id l11so23769882edb.4
 for <57963@debbugs.gnu.org>; Tue, 01 Nov 2022 23:45:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
 :date:message-id:reply-to;
 bh=Ag4eIhWrJsefzjdkNRe61jHHucpuDwwrDs2th49naBk=;
 b=if5O9PEtYQ6r8YvPozSsd/54Yh3NX+QkprBwUW/iMXZs4SR6DsUyJl/XeDU9v8ixq4
 gpetSdCXcz2fiRaFUbkbj1KS6IANA3COAfgiaFi1nq9BCS9jL2jdtL5GocT2+CntBoqV
 DIRQnOlFptKtuD5t/ZOoLlrSXxfMTMVImyC38aUrI+4ezgcebcNB0NEvb5URfnpuoUfN
 yaIgALvQxpCYen41YAAabYYmXIru8BSKUkBdwEk5zRLmEBpRXhYVg48qyPjXl7ouVrMG
 Faaj31Jci77Ohr2l+bBhxQ5hw4gygrrmNEk4ULZ1nvFMR26hQcobdfpkyjinfskFxkiM
 FFpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=Ag4eIhWrJsefzjdkNRe61jHHucpuDwwrDs2th49naBk=;
 b=jZJH2Wm4/JWTeoz8Zr2yBL3Ttivje7ZrdjT7G2N7Dwkae+zmCiLJ6YT4NGNr+FGusG
 W6nSm3cc0dfTRDRBhbpP5ZP3XD0bJzPz3M0JjZWfLLm0oiTO8A05MIvAe5WtMLCZ7Jta
 uXWkRQpnK1583DX6Ekvafh23rxnHdYV7ZsGzxsLhknvUqPTMsV5axU38rvT+/UCOSFbY
 cHhQpVgvFYFQ11+g7oE0MY6IZoUDX7aHyWzz2vu05YU53A3ilSSpfz4/OhZobjys8xYj
 02hcvWyCjK+sJGjem620nNlcienfGJBLkcdO3BNRMHYANFaAlol8xs9TRWOEndQzrSXW
 hciQ==
X-Gm-Message-State: ACrzQf0Gia0bxAXhZsuifnC/3f6nvETh7nIB3rnbvBcYm0NCWRsLlLfs
 KjNbe/OOXm2CGMg5ydLvIoQ=
X-Google-Smtp-Source: AMsMyM7ByJqVhMWTiVrrvmNeONPtBUZQBFhAUPlZ2hDKNFLAPn7lES18Ke4GilTPvS6F6oAAbjbcoA==
X-Received: by 2002:a05:6402:386:b0:463:c43f:6628 with SMTP id
 o6-20020a056402038600b00463c43f6628mr5611748edv.53.1667371538262; 
 Tue, 01 Nov 2022 23:45:38 -0700 (PDT)
Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93]) by smtp.gmail.com with ESMTPSA id
 e17-20020a170906045100b007aa239cf4d9sm4998900eja.89.2022.11.01.23.45.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 01 Nov 2022 23:45:37 -0700 (PDT)
Message-ID: <0b28bb01db01fafe30acb45f4b12e259b79121a6.camel@gmail.com>
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
Date: Wed, 02 Nov 2022 07:45:34 +0100
In-Reply-To: <87y1sugmh2.fsf@taiju.info>
References: <87k053sxur.fsf@gnu.org> <87zgdzat99.fsf@trop.in>
 <87zgdxgx0l.fsf@taiju.info> <875ygiqur9.fsf@gnu.org>
 <87r0z5e23k.fsf@taiju.info> <87czanebhd.fsf@taiju.info>
 <871qqtapbo.fsf@taiju.info>
 <20a8312539654df3c98954620979078e3e41a150.camel@gmail.com>
 <87r0yt96iy.fsf@taiju.info>
 <c9ed26b9378d8af618498daebb36d416b826ca3e.camel@gmail.com>
 <87y1sugmh2.fsf@taiju.info>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.46.0 
MIME-Version: 1.0
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>
Sender: "Guix-patches" <guix-patches-bounces@gnu.org>
Errors-To: 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=1667371588;
	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=Ag4eIhWrJsefzjdkNRe61jHHucpuDwwrDs2th49naBk=;
	b=VZlAmexBG0oZISpqSJQ8Sm/J6wXy4f5tpjA8+UlLX/IFMvmW/9GSrPuAwdOEiwoopfxQPs
	H+0Nd5YcmTmM4fU+QGlA71C5gThHQYlbMoRtwonSCBNSOjcwLZUs9FDMCzVJIHrHzdU4VO
	1qLwpXA8nhfUocVc1JkzXvQ1aWUtrozfCiaUqiGa9BU18r9hFtRVlXN5lX6EItF3mNtxyX
	QEMRysPMyAZBeht4mIfobLxw4gxMQ3q8AqkjaL4WUuvpvKzAFUaVihaWtEmEmztL7AtiTw
	32Zq7pEeOIEPawv4mQMptSU9LZS48WkP52k0pmHg5M3VjUULxmJ3feC0BzJVcg==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667371588; a=rsa-sha256; cv=none;
	b=JGBVJ62iMj/nbuCj7vdBFkKCa6DBrakgCX44l2JQVFY/TjLlJEsPlTpInqKYe/SBlpsF42
	bwbQOKKbOARDOI3s6i5QavAvsCcd8/2EztidypioMOM4y2viSKk/eVTnWMR9PZ1v8C1R46
	RjYiInMKw4DyisrBpeO5DgWg8TxRcQnW7ENrw1RFxmYViGRVrZrQaxvqqZWJe4L/OPaQ2Y
	GhvpmazPUGa0oJ8ki2RqJd2gcQuPaKk5N771CsA4rwq1f+/3JcMmt6o+UsAv/lL8tLoTHM
	6Iy8h8HRuH4QCedvdSQxz0ViF89FtkoIK4MiUoVQ9/MPf7n/20PkatdoIcrlNQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=if5O9PEt;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 6.02
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=if5O9PEt;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 1C9A49EC6
X-Spam-Score: 6.02
X-Migadu-Scanner: scn1.migadu.com
X-TUID: iQPpJUenXDWX

Am Mittwoch, dem 02.11.2022 um 10:43 +0900 schrieb Taiju HIGASHI:
> Hi,
>=20
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
>=20
> > Am Donnerstag, dem 27.10.2022 um 14:31 +0900 schrieb Taiju HIGASHI:
> > > Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> > >=20
> > > > Am Donnerstag, dem 27.10.2022 um 13:00 +0900 schrieb Taiju
> > > > HIGASHI:
> > > > > Sorry for the long time it has taken to resolve the issue.
> > > > > What do you think about it?
> > > > Putting the discussion with Declan aside, the last thing
> > > > mentioned
> > > > was
> > > > not trying to mix SXML and XML-in-strings.=C2=A0 Ludo offered the
> > > > solutions:
> > > > 1. Taking a <fontconfig-configuration> or a file-like object
> > > > 2. (Optionally) using a gexp-compiler for the former
> > > >=20
> > > > Cheers
> > >=20
> > > Sorry for the lack of clarity.
> > > I had sent you a past email confirming that the direction of the
> > > implementation was correct and was waiting for your response.
> > >=20
> > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D57963#239
> > Ahh, I missed that.=C2=A0 If you pull in the XML declarations and the
> > <fontconfig></fontconfig> stuff to the serialization, you should
> > basically have most of what you'd need for a G-Exp compiler, but
> > even
> > if not it'd simplify this to
> >=20
> > (match
> > =C2=A0 ((? home-font-config-configuration? config)
> > =C2=A0=C2=A0 (serialize-... config ...))
> > =C2=A0 ((? file-like? config) config))
> >=20
> > Not sure if a match for type-checking would be needed since it's
> > already taken care of elsewhere, so writing it just in case.
> >=20
> > Cheers
>=20
> Sorry for my response delay.
> Is my recognition correct?=C2=A0 I have plan to rewrite it as below.
>=20
> --8<---------------cut here---------------start------------->8---
> (define (serialize-fontconfig-configuration config)
> =C2=A0 (define start-of-fontconfig "<?xml version=3D'1.0'?>
> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> <fontconfig>")
>=20
> =C2=A0 (define end-of-fontconfig "</fontconfig>\n")
>=20
> =C2=A0 (mixed-text-file
> =C2=A0=C2=A0 "fonts.conf"
> =C2=A0=C2=A0 start-of-fontconfig
> =C2=A0=C2=A0 (serialize-configuration config home-fontconfig-configuratio=
n-
> fields)
> =C2=A0=C2=A0 end-of-fontconfig))
>=20
> (define (add-fontconfig-config-file user-config)
> =C2=A0 `(("fontconfig/fonts.conf"
> =C2=A0=C2=A0=C2=A0=C2=A0 ,(match user-config
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? home-fontconfi=
g-configuration? user-config)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (serialize-f=
ontconfig-configuration user-config))
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? file-like? user-config) us=
er-config)))))
> --8<---------------cut here---------------end--------------->8---
More or less.  For one, I don't think start-of-fontconfig and end-of-
fontconfig need to be declared.  The (serialize-configuration ) call is
a little opaque atm, but let's suppose it returns properly formatted
XML.  Finally, as hinted already and since you're returning a file-like
object anyway, you may want to make this serializer a gexp-compiler
instead.

Cheers