From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Texinfo in descriptions? Date: Sun, 30 Aug 2015 19:23:12 +0200 Message-ID: <87613wlmgv.fsf@gnu.org> References: <87wpy0nygt.fsf@gmail.com> <87y4ige2ux.fsf@openmailbox.org> <87wpy0t83c.fsf@gnu.org> <87r3o7pz3h.fsf@openmailbox.org> <87y4ietrdz.fsf_-_@gnu.org> <874mkx8a5o.fsf@openmailbox.org> <87wpxs9ux0.fsf@gnu.org> <87h9ov51j9.fsf@gnu.org> <87a8tcfnox.fsf@openmailbox.org> <87a8tbf5lu.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW6KA-0007cV-0Z for guix-devel@gnu.org; Sun, 30 Aug 2015 13:23:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW6K8-0005wS-RF for guix-devel@gnu.org; Sun, 30 Aug 2015 13:23:22 -0400 In-Reply-To: <87a8tbf5lu.fsf@openmailbox.org> (Mathieu Lirzin's message of "Fri, 28 Aug 2015 23:47:09 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org, Alex Kost Mathieu Lirzin skribis: > From e98c0ec3b609c077bf471cf838f12f54a89a0226 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Fri, 7 Aug 2015 00:10:43 +0200 > Subject: [PATCH] packages: Add package-description-string. > > * guix/packages.scm (package-description-string): New variable. > * guix/utils.scm (texi->plain-text): Likewise. > * guix/ui.scm (package->recutils): Use it. > * gnu/packages/perl.scm (perl-devel-globaldestruction) > (perl-devel-lexalias, perl-exporter-lite): Adapt to Texinfo's markup. > * gnu/packages/python.scm (python2-empy): Likewise. LGTM. We must also make sure that the Emacs UI (and guix-web, but that=E2=80=99s a different repo) use =E2=80=98package-description-string=E2=80=99 instead of =E2=80=98package-description=E2=80=99. For Emacs, I think it=E2=80=99s enough to s/package-description/package-description-string/ in guix-main.scm. Alex? > 5 files changed, 20 insertions(+), 5 deletions(-) I like that it=E2=80=99s all it takes. :-) Any performance figures? For instance, time of =E2=80=98guix package -s=E2= =80=99 before and after? > That was my first solution before realizing that this will lead to a > problem that this unrealistic example illustrates. > > ;; with fr_FR.UTF-8 locale > > (package-description foo) > =3D> "socks @code{foo}." > > (package-description-string foo) > =3D> "socks `foo'.\n\n" > > (N_ (package-description foo)) > =3D> "chaussettes @code{foo}." > > (N_ (package-description-string foo)) > =3D> "socks `foo'.\n\n" > > In the last evaluation gettext was unable to find the translated string > corresponding to msgid "socks `foo'.\n\n". What about moving =E2=80=98package-description-string=E2=80=99 to (guix ui)= and have it do both rendering and translation? If an application really needs rendered-but-not-translated stuff, it can always use (compose texi-fragment->text package-description); I think that=E2=80=99d be an unusual use case anyway. >> Also I think the same replacement should be done in (guix scripts >> lint) ... > > I think more can be done in (guix scripts lint). For example checking > if invoking 'package-description-string' fails which would indicate that > the markup is not correctly used. Sure, we should do that after. >> ... and (guix scripts package). > > This script uses 'package-description' to search in it. IIUC it was > suggested by Ludo to search using the raw Texinfo fragment and to > display using the plain-text version. > Right, since =E2=80=98package->recutils=E2=80=99 uses =E2=80=98package-desc= ription-string=E2=80=99, we know that all the output is correctly rendered and translated. Nice work, thanks! Ludo=E2=80=99.