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: Mon, 31 Aug 2015 23:21:25 +0200 Message-ID: <87egij2lyi.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> <87613wlmgv.fsf@gnu.org> <87zj18ik3d.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]:57578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWWWB-0003JT-AT for guix-devel@gnu.org; Mon, 31 Aug 2015 17:21:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWWWA-0008CR-Dy for guix-devel@gnu.org; Mon, 31 Aug 2015 17:21:31 -0400 In-Reply-To: <87zj18ik3d.fsf@openmailbox.org> (Mathieu Lirzin's message of "Sun, 30 Aug 2015 22:42:46 +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: >> Any performance figures? For instance, time of =E2=80=98guix package -s= =E2=80=99 before >> and after? > > With the updated patch I have obtained the following results for command > > time ./pre-inst-env guix package -s e > > - without patch: > real 0m25.381s > user 0m8.740s > sys 0m0.184s > > - with patch: > real 0m24.556s > user 0m10.448s > sys 0m0.220s Sounds good. [...] > +(define (package-description-string package) > + "Return a plain-text representation of PACKAGE description field." > + (and=3D> (package-description package) > + (compose stexi->plain-text texi-fragment->stexi P_))) > + > (define (string->recutils str) > "Return a version of STR where newlines have been replaced by newlines > followed by \"+ \", which makes for a valid multi-line field value in the > @@ -786,10 +795,8 @@ followed by \"+ \", which makes for a valid multi-li= ne field value in the > "Write to PORT a `recutils' record of package P, arranging to fit with= in > WIDTH columns." > (define (description->recutils str) > - (let ((str (P_ str))) > - (string->recutils > - (fill-paragraph str width > - (string-length "description: "))))) > + (string->recutils > + (fill-paragraph str width (string-length "description: ")))) One last thing (I swear!). AFAICS =E2=80=98stexi->plain-text=E2=80=99 already does paragraph filling, = so the call above is redundant (and could break the rendering.) However, the width of the rendered text is fixed, unlike what =E2=80=98string->recutils=E2=80=99 did so far. To work around that, we=E2= =80=99ll have to monkey-patch the =E2=80=98wrap*=E2=80=99 procedure of (texinfo plain-text),= along these lines: (define %text-width (make-parameter (or (and=3D> (getenv "WIDTH") string->number) 80))) (set! (@@ (texinfo plain-text) wrap*) (lambda strings ... #:line-width (%text-width) ...)) and then in =E2=80=98package->recutils=E2=80=99, we need to =E2=80=98parame= terize=E2=80=99 that. We need a similar hack for #:initial-indent, that would allow us to mimic the 3rd argument of =E2=80=98fill-paragraph=E2=80=99. Could you try it? > From 3c69e9f79f4d5bd5a75d4c083769caf32c1a63ec Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Thu, 27 Aug 2015 17:51:11 +0200 > Subject: [PATCH] website: packages: Support Texinfo's markup. > > * website/www/packages.scm (package->sxml): Adapt to new Texinfo's > markup in package description. LGTM! Thanks, Ludo=E2=80=99.