Mathieu Lirzin <m...@openmailbox.org> skribis: > From e98c0ec3b609c077bf471cf838f12f54a89a0226 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin <m...@openmailbox.org> > 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’s a different repo) use ‘package-description-string’ instead of ‘package-description’. For Emacs, I think it’s enough to s/package-description/package-description-string/ in guix-main.scm. Alex? > 5 files changed, 20 insertions(+), 5 deletions(-) I like that it’s all it takes. :-) Any performance figures? For instance, time of ‘guix package -s’ 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) > => "socks @code{foo}." > > (package-description-string foo) > => "socks `foo'.\n\n" > > (N_ (package-description foo)) > => "chaussettes @code{foo}." > > (N_ (package-description-string foo)) > => "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 ‘package-description-string’ 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’d 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. > <https://lists.gnu.org/archive/html/guix-devel/2015-07/msg00609.html> Right, since ‘package->recutils’ uses ‘package-description-string’, we know that all the output is correctly rendered and translated. Nice work, thanks! Ludo’.