gnutls-devel
[Top][All Lists]
Advanced

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

Re: Default record version


From: Martin von Gagern
Subject: Re: Default record version
Date: Mon, 23 Feb 2009 23:33:26 +0100
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

Simon Josefsson schrieb:
> This seems to break texinfo building:
> 
> http://autobuild.josefsson.org/gnutls/log-200902222047566880000.txt
> 
> /Simon

Probably because percent signs introduce a comment in texinfo, as they
do in tex. The attached patch might fix that. Haven't tested it myself,
as I only have remote access over a slow link to my build environment
right now.

I have to admit that things become even more hackish with this patch in
place, as there are now even more places where the sequence "% receives
special treatment. The main reason for this is that the replacements are
stored in hashes, not lists, so I can't rely on the order of
substitutions, therefore I can't first replace the constants and then
replace all remaining percent signs.

Maybe the replacement of % were better done somewhere in the
corresponding output function, along with sepcial treatment for any
other kind of special characters for the corresponding output language.
Maybe those highlighting substitutions were better saved as arrays.
Maybe those arrays should employ qr/.../ and '...' to avoid half of the
backslashes and make things more readable.

As you can see, there is a lot which could be improved about that
script. And most improvements are not obvious, but require some kind of
design decision, like what characters are special, how to escape them,
where to handle what special cases, what other documentation syntax to
emulate, stuff like that.

If I don't forget it, maybe I can write a major patch for some of this
some time next week. Before I start that, I would like to hear that you
are interested in such a general improvement. You should also voice any
thoughts you have as to what direction such improvements should take.

Of course, I'd be more than happy if you fix this yourself. I'm not that
eager to read and understand someone else's Perl code, even if that
script seems to be a fairly tame specimen.

Greetings,
 Martin
diff --git a/doc/scripts/gdoc b/doc/scripts/gdoc
index b2416a0..b436440 100755
--- a/doc/scripts/gdoc
+++ b/doc/scripts/gdoc
@@ -152,13 +152,15 @@ $blankline_html = "<p>";
 %highlights_texinfo = ( $type_constant, "address@hidden",
                        $type_func, "address@hidden",
                        $type_struct, "address@hidden",
-                       $type_param, "address@hidden" );
+                       $type_param, "address@hidden",
+                       "\"\%", "\"\\\%" );
 $blankline_texinfo = "";
 
 %highlights_tex = ( $type_constant, "{\\\\it \$1}",
                     $type_func, "{\\\\bf \$1}",
                     $type_struct, "{\\\\it \$1}",
-                    $type_param, "{\\\\bf \$1}" );
+                    $type_param, "{\\\\bf \$1}",
+                    "\"\%", "\"\\\%" );
 $blankline_tex = "\\\\";
 
 # sgml, docbook format

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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