Subject: Fwd: Problems with the maxima documentation
From: Robert Dodier
Date: Fri, 27 Jan 2012 09:21:16 -0700
Michel, I found the patch you sent. I've applied it & committed it
& pushed the commit. I didn't try to run make yet.
I mean this in the best way possible -- please don't send patches
to me personally, please post them on the mailing list or bug
tracker or some other public communication. It is not guaranteed
that they will get applied, but it does increase the chances of it.
best,
Robert Dodier
---------- Forwarded message ----------
From: Michel Talon <talon at lpthe.jussieu.fr>
Date: Sun, 18 Dec 2011 15:20:20 +0100
Subject: Problems with the maxima documentation
To: Robert Dodier <robert.dodier at gmail.com>
Hello
some time ago i mentioned there are problems building the maxima
documentation on
BSD and Mac OS X and it turned out that using gnu sed was able to fix
most or all of the problems.
I mentioned this problem on FreeBSD mailing list, and a developer,
Brendan Fabeny, looked
at the sed differenced between gnu sed and bsd sed, and came with a
patch which indeeds solves
most of the errors and also sent me explanations on the patch.
The culprits are extract_categories.sh and extract_categories1.sed in
doc/info, and here are the patches:
niobe% cat patch-doc__info__extract_categories.sh
--- doc/info/extract_categories.sh.orig 2011-08-01 00:39:51.000000000 -0400
+++ doc/info/extract_categories.sh 2011-12-16 09:05:05.000000000 -0500
@@ -17,9 +17,10 @@
if [ $f = "maxima.texi" ]
then echo SKIP OVER $f
else
- sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\
-\0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\
-\0/' "$f" > tmp.texi
+ sed 's/^@deffn *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \1}\
+&/; s/^@defvr *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \1}\
+&/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\
+&/' "$f" > tmp.texi
mv tmp.texi "$f"
fi
done
niobe% cat patch-doc__info__extract_categories1.sed
--- doc/info/extract_categories1.sed.orig 2011-08-01 00:39:51.000000000 -0400
+++ doc/info/extract_categories1.sed 2011-12-16 08:12:32.000000000 -0500
@@ -1,6 +1,9 @@
-s/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/items = ["\2"]/
-s/^@def\(fn\|vr\)x *{[^}]*} *\([^[:blank:]]*\).*/if not "\2" in
items: items.append ("\2")/
-s/^@end def\(fn\|vr\)/items = []/
+s/^@deffn *{[^}]*} *\([^[:blank:]]*\).*/items = ["\1"]/
+s/^@defvr *{[^}]*} *\([^[:blank:]]*\).*/items = ["\1"]/
+s/^@deffnx *{[^}]*} *\([^[:blank:]]*\).*/if not "\1" in items:
items.append ("\1")/
+s/^@defvrx *{[^}]*} *\([^[:blank:]]*\).*/if not "\1" in items:
items.append ("\1")/
+s/^@end deffn/items = []/
+s/^@end defvr/items = []/
s/^@node *\([^,]*\).*/items = ["\1"] # extracted from node/
s/@opencatbox//
s/@closecatbox//
and here are the explanations:
The explanations for the changes in my patch are:
-- In conformance with the Open Group specs, "|" is only a special
character indicating alternation when extended regular expressions
(EREs) are used, and FreeBSD sed(1) only uses EREs when invoked with
the "-E" or "-r" options.
-- a "\0" backreference, as nearly as I can tell from a few tests, is
a non-standard GNU extension that seems to be equivalent to "&". In
accordance with the Open Group specs, FreeBSD sed(1) interprets "\0"
as "0".
As far as i can see there is also replacement of \2 by \1, which i
don't know the rationale for.
Anyways, after applying these patches i still have some smaller
problems, as i mention in
a mail to B.F. that i also CC to you.
--
Michel Talon
talon at lpthe.jussieu.fr