guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Texinfo in descriptions?


From: Mathieu Lirzin
Subject: Re: Texinfo in descriptions?
Date: Fri, 04 Sep 2015 21:43:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Mathieu Lirzin <address@hidden> skribis:
>
>> From e691c2080929dd1390184ab4669de8b2695a237f Mon Sep 17 00:00:00 2001
>> From: Mathieu Lirzin <address@hidden>
>> Date: Fri, 7 Aug 2015 00:10:43 +0200
>> Subject: [PATCH] ui: Add package-description-string.
>>
>> Provide support for Texinfo's markup in package description.
>>
>> * guix/ui.scm (%text-width, %initial-indent): New parameters.
>>   (package-description-string): New variable.
>>   (package->recutils): Use them.
>> * emacs/guix-main.scm (%package-param-alist): Use it.
>> * gnu/packages/databases.scm (perl-dbd-pg): Adapt to Texinfo's markup.
>> * gnu/packages/perl.scm (perl-devel-globaldestruction)
>>   (perl-devel-lexalias, perl-exporter-lite): Likewise.
>> * gnu/packages/python.scm (python2-empy): Likewise.
>
> [...]
>
>> +++ b/gnu/packages/databases.scm
>> @@ -578,7 +578,7 @@ columns, primary keys, unique constraints and 
>> relationships.")
>>         ("postgresql" ,postgresql)))
>>      (home-page "http://search.cpan.org/dist/DBD-Pg";)
>>      (synopsis "DBI PostgreSQL interface")
>> -    (description "")
>> +    (description #f)
>
> Weird, and doesn’t really match the commit log.  Maybe this hunk can be
> removed?

I get an error with "guix package -s perl-dbd-pg" without this change

--8<---------------cut here---------------start------------->8---
Backtrace:
In unknown file:
   ?: 19 [apply-smob/1 #<catch-closure 1cfa9a0>]
In ice-9/boot-9.scm:
  63: 18 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 17 [eval # #]
In ice-9/boot-9.scm:
2401: 16 [save-module-excursion #<procedure 1d18940 at ice-9/boot-9.scm:4045:3 
()>]
4050: 15 [#<procedure 1d18940 at ice-9/boot-9.scm:4045:3 ()>]
1724: 14 [%start-stack load-stack ...]
1729: 13 [#<procedure 1d2eea0 ()>]
In unknown file:
   ?: 12 [primitive-load "/home/mthl/src/gnu/guix/scripts/guix"]
In guix/ui.scm:
1058: 11 [run-guix-command package "-s" "perl-dbd-pg"]
In ice-9/boot-9.scm:
 157: 10 [catch srfi-34 #<procedure 3b1a180 at guix/ui.scm:384:2 ()> ...]
 157: 9 [catch system-error ...]
In guix/scripts/package.scm:
 995: 8 [#<procedure 3b1e6f0 at guix/scripts/package.scm:994:4 ()>]
 967: 7 [process-query (# # # # ...)]
In ice-9/boot-9.scm:
 157: 6 [catch system-error ...]
In srfi/srfi-1.scm:
 619: 5 [for-each #<procedure 3b1e630 at guix/scripts/package.scm:968:22 
(t-139858)> ...]
In guix/ui.scm:
 859: 4 [package->recutils # #<output: file /dev/pts/0> 80]
 790: 3 [texi->plain-text "description: Project-Id-Version: guix-packages 
0.8\nReport-Msgid-Bugs-To: address@hidden: 2015-07-21 
21:35+0200\nPO-Revision-Date: 2014-12-20 22:00+0100\nLast-Translator: Rémy 
Chevalier <address@hidden>\nLanguage-Team: French <address@hidden>\nLanguage: 
fr\nMIME-Version: 1.0\nContent-Type: text/plain; 
charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"]
In unknown file:
   ?: 2 [call-with-input-string "description: Project-Id-Version: guix-packages 
0.8\nReport-Msgid-Bugs-To: address@hidden: 2015-07-21 
21:35+0200\nPO-Revision-Date: 2014-12-20 22:00+0100\nLast-Translator: Rémy 
Chevalier <address@hidden>\nLanguage-Team: French <address@hidden>\nLanguage: 
fr\nMIME-Version: 1.0\nContent-Type: text/plain; 
charset=UTF-8\nContent-Transfer-Encoding: 8bit\n" ...]
In texinfo.scm:
1131: 1 [parse #<input: string 4517ea0>]
 965: 0 [loop #<input: string 4517ea0> (*fragment*) ...]

texinfo.scm:965:23: In procedure loop:
texinfo.scm:965:23: Throw to key `parser-error' with args `(#f "Unknown 
command" gnu)'.
--8<---------------cut here---------------end--------------->8---


It's not directly related to texinfo description since

 (package-description-string perl-dbd-pg) => "" 

but caused by the fact there is this in "po/packages/fr.po"...

--8<---------------cut here---------------start------------->8---
msgid ""
msgstr ""
"Project-Id-Version: guix-packages 0.8\n"
"Report-Msgid-Bugs-To: address@hidden"
"POT-Creation-Date: 2014-11-10 15:37+0100\n"
"PO-Revision-Date: 2014-12-20 22:00+0100\n"
"Last-Translator: Rémy Chevalier <address@hidden>\n"
"Language-Team: French <address@hidden>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
--8<---------------cut here---------------end--------------->8---

which fails to be parsed by texinfo. 

What is your recommandation about this?

>
>> +(set! (@@ (texinfo plain-text) wrap*)
>> +      ;; Monkey patch this private procedure to let 'package->recutils'
>            ^
> Please prepend “XXX” here to make the kludge more visible.  (Eventually
> we should fix it in Guile.)

Done.

> I tried adding an @itemize list in a description and noticed that the
> initial indent is not working the way I thought:
> [...]

I should have test such case before proposing a patch sorry about that.

> I wonder if using ‘fill-paragraph’ instead of ‘fill-string’ would solve
> this.

I don't remember exactly the result I got with that but it wasn't
convincing.

> Could you look into it?

Here is "something" that seems to work. The idea is to append
"description: " to package description before 'stexi->plain-text' fills
the text.

Attachment: 0001-ui-Add-package-description-string.patch
Description: Text Data

What do you think?

--
Mathieu Lirzin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]