public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [DOC] fix formatting problems in invoke.texi
@ 2007-10-01  2:28 Manuel López-Ibáñez
  2007-10-06 13:06 ` Gerald Pfeifer
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel López-Ibáñez @ 2007-10-01  2:28 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

:ADDPATCH doc:

The normal text within @gccoptlist{} is printed bold in the manpage.
That doesn't look nice, so I surround it with @r{} and now the manpage
looks much better. Also, the PDF output inserts an extra space if a
newline follows the opening brace of @gccoptlist{}. I noticed other
problems that come from the script texi2pod.pl. @asis is not handled
properly, and some commands within @gccoptlist{} are not converted.

This patch fixes all this.

OK to commit? I was not sure whether this was trivial.

Manuel.


2007-10-01  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

 * doc/invoke.texi (Wall): fix formatting issues.

contrib/
 * texi2pod.pl: Handle @asis.
 (postprocess): Move @gccoptlist{} after all formatting commands.

[-- Attachment #2: fix-doc.diff --]
[-- Type: text/plain, Size: 3429 bytes --]

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 128895)
+++ gcc/doc/invoke.texi	(working copy)
@@ -2601,34 +2601,34 @@
 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
 
 @option{-Wall} turns on the following warning flags:
-@gccoptlist{ 
--Waddress @gol
--Warray-bounds (only with @option{-O2}) @gol
--Wc++0x-compat @gol
--Wchar-subscripts @gol
--Wimplicit-int @gol
--Wimplicit-function-declaration @gol
--Wcomment @gol
--Wformat  @gol
--Wmain (only for C/ObjC and unless @option{-ffreestanding}) @gol
--Wmissing-braces @gol
--Wnonnull @gol
--Wparentheses @gol
--Wpointer-sign
--Wreorder  @gol
--Wreturn-type @gol
--Wsequence-point @gol
--Wsign-compare (only in C++) @gol
--Wstrict-aliasing @gol
--Wstrict-overflow @gol
--Wswitch @gol
--Wtrigraphs @gol
--Wuninitialized (only with @option{-O1}, @option{-O2} or @option{-O3}) @gol
--Wunknown-pragmas @gol
--Wunused-function @gol
--Wunused-label    @gol
--Wunused-value    @gol
--Wunused-variable @gol
+
+@gccoptlist{-Waddress   @gol
+-Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
+-Wc++0x-compat  @gol
+-Wchar-subscripts  @gol
+-Wimplicit-int  @gol
+-Wimplicit-function-declaration  @gol
+-Wcomment  @gol
+-Wformat   @gol
+-Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
+-Wmissing-braces  @gol
+-Wnonnull  @gol
+-Wparentheses  @gol
+-Wpointer-sign  @gol
+-Wreorder   @gol
+-Wreturn-type  @gol
+-Wsequence-point  @gol
+-Wsign-compare @r{(only in C++)}  @gol
+-Wstrict-aliasing  @gol
+-Wstrict-overflow  @gol
+-Wswitch  @gol
+-Wtrigraphs  @gol
+-Wuninitialized @r{(only with} @option{-O1}@r{,} @option{-O2} @r{or} @option{-O3}@r{)}  @gol
+-Wunknown-pragmas  @gol
+-Wunused-function  @gol
+-Wunused-label     @gol
+-Wunused-value     @gol
+-Wunused-variable  @gol
 }
 
 @item -Wno-import
Index: contrib/texi2pod.pl
===================================================================
--- contrib/texi2pod.pl	(revision 128895)
+++ contrib/texi2pod.pl	(working copy)
@@ -297,6 +297,7 @@
 	$ic =~ s/\@(?:code|kbd)/C/;
 	$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
 	$ic =~ s/\@(?:file)/F/;
+	$ic =~ s/\@(?:asis)//;
 	$_ = "\n=over 4\n";
     };
 
@@ -319,8 +320,12 @@
 
     /^\@itemx?\s*(.+)?$/ and do {
 	if (defined $1) {
-	    # Entity escapes prevent munging by the <> processing below.
-	    $_ = "\n=item $ic\&LT;$1\&GT;\n";
+            if ($ic) {
+                # Entity escapes prevent munging by the <> processing below.
+                $_ = "\n=item $ic\&LT;$1\&GT;\n";
+            } else {
+                $_ = "\n=item $1\n";
+            }
 	} else {
 	    $_ = "\n=item $ic\n";
 	    $ic =~ y/A-Ya-y/B-Zb-z/;
@@ -376,7 +381,7 @@
     s/\@r\{([^\}]*)\}/R<$1>/g;
     s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
     s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
+    s/\@(?:samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
     s/\@sc\{([^\}]*)\}/\U$1/g;
     s/\@file\{([^\}]*)\}/F<$1>/g;
     s/\@w\{([^\}]*)\}/S<$1>/g;
@@ -412,6 +417,10 @@
     s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
     s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
 
+    # Handle gccoptlist here, so it can contain the above formatting
+    # commands.
+    s/\@gccoptlist\{([^\}]*)\}/B<$1>/g;
+
     # Un-escape <> at this point.
     s/&LT;/</g;
     s/&GT;/>/g;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DOC] fix formatting problems in invoke.texi
  2007-10-01  2:28 [DOC] fix formatting problems in invoke.texi Manuel López-Ibáñez
@ 2007-10-06 13:06 ` Gerald Pfeifer
  2007-10-06 14:37   ` Joseph S. Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Gerald Pfeifer @ 2007-10-06 13:06 UTC (permalink / raw)
  To: Manuel López-Ibáñez, Joseph S. Myers; +Cc: gcc-patches

[-- Attachment #1: Type: TEXT/PLAIN, Size: 737 bytes --]

On Mon, 1 Oct 2007, Manuel López-Ibáñez wrote:
> The normal text within @gccoptlist{} is printed bold in the manpage.
> That doesn't look nice, so I surround it with @r{} and now the manpage
> looks much better.

That sounds fair.

> Also, the PDF output inserts an extra space if a newline follows the 
> opening brace of @gccoptlist{}.

As well as that.  Let's go for these two.

:REVIEWPATCH:

> I noticed other problems that come from the script texi2pod.pl. @asis is 
> not handled properly, and some commands within @gccoptlist{} are not 
> converted.

For this aspect, I'd prefer Joseph to chime in.

> contrib/
>  * texi2pod.pl: Handle @asis.
>  (postprocess): Move @gccoptlist{} after all formatting commands.

Thanks,
Gerald

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3429 bytes --]

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 128895)
+++ gcc/doc/invoke.texi	(working copy)
@@ -2601,34 +2601,34 @@
 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
 
 @option{-Wall} turns on the following warning flags:
-@gccoptlist{ 
--Waddress @gol
--Warray-bounds (only with @option{-O2}) @gol
--Wc++0x-compat @gol
--Wchar-subscripts @gol
--Wimplicit-int @gol
--Wimplicit-function-declaration @gol
--Wcomment @gol
--Wformat  @gol
--Wmain (only for C/ObjC and unless @option{-ffreestanding}) @gol
--Wmissing-braces @gol
--Wnonnull @gol
--Wparentheses @gol
--Wpointer-sign
--Wreorder  @gol
--Wreturn-type @gol
--Wsequence-point @gol
--Wsign-compare (only in C++) @gol
--Wstrict-aliasing @gol
--Wstrict-overflow @gol
--Wswitch @gol
--Wtrigraphs @gol
--Wuninitialized (only with @option{-O1}, @option{-O2} or @option{-O3}) @gol
--Wunknown-pragmas @gol
--Wunused-function @gol
--Wunused-label    @gol
--Wunused-value    @gol
--Wunused-variable @gol
+
+@gccoptlist{-Waddress   @gol
+-Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
+-Wc++0x-compat  @gol
+-Wchar-subscripts  @gol
+-Wimplicit-int  @gol
+-Wimplicit-function-declaration  @gol
+-Wcomment  @gol
+-Wformat   @gol
+-Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
+-Wmissing-braces  @gol
+-Wnonnull  @gol
+-Wparentheses  @gol
+-Wpointer-sign  @gol
+-Wreorder   @gol
+-Wreturn-type  @gol
+-Wsequence-point  @gol
+-Wsign-compare @r{(only in C++)}  @gol
+-Wstrict-aliasing  @gol
+-Wstrict-overflow  @gol
+-Wswitch  @gol
+-Wtrigraphs  @gol
+-Wuninitialized @r{(only with} @option{-O1}@r{,} @option{-O2} @r{or} @option{-O3}@r{)}  @gol
+-Wunknown-pragmas  @gol
+-Wunused-function  @gol
+-Wunused-label     @gol
+-Wunused-value     @gol
+-Wunused-variable  @gol
 }
 
 @item -Wno-import
Index: contrib/texi2pod.pl
===================================================================
--- contrib/texi2pod.pl	(revision 128895)
+++ contrib/texi2pod.pl	(working copy)
@@ -297,6 +297,7 @@
 	$ic =~ s/\@(?:code|kbd)/C/;
 	$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
 	$ic =~ s/\@(?:file)/F/;
+	$ic =~ s/\@(?:asis)//;
 	$_ = "\n=over 4\n";
     };
 
@@ -319,8 +320,12 @@
 
     /^\@itemx?\s*(.+)?$/ and do {
 	if (defined $1) {
-	    # Entity escapes prevent munging by the <> processing below.
-	    $_ = "\n=item $ic\&LT;$1\&GT;\n";
+            if ($ic) {
+                # Entity escapes prevent munging by the <> processing below.
+                $_ = "\n=item $ic\&LT;$1\&GT;\n";
+            } else {
+                $_ = "\n=item $1\n";
+            }
 	} else {
 	    $_ = "\n=item $ic\n";
 	    $ic =~ y/A-Ya-y/B-Zb-z/;
@@ -376,7 +381,7 @@
     s/\@r\{([^\}]*)\}/R<$1>/g;
     s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
     s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
-    s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
+    s/\@(?:samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
     s/\@sc\{([^\}]*)\}/\U$1/g;
     s/\@file\{([^\}]*)\}/F<$1>/g;
     s/\@w\{([^\}]*)\}/S<$1>/g;
@@ -412,6 +417,10 @@
     s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
     s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
 
+    # Handle gccoptlist here, so it can contain the above formatting
+    # commands.
+    s/\@gccoptlist\{([^\}]*)\}/B<$1>/g;
+
     # Un-escape <> at this point.
     s/&LT;/</g;
     s/&GT;/>/g;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DOC] fix formatting problems in invoke.texi
  2007-10-06 13:06 ` Gerald Pfeifer
@ 2007-10-06 14:37   ` Joseph S. Myers
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph S. Myers @ 2007-10-06 14:37 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Manuel López-Ibáñez, gcc-patches

On Sat, 6 Oct 2007, Gerald Pfeifer wrote:

> > I noticed other problems that come from the script texi2pod.pl. @asis is 
> > not handled properly, and some commands within @gccoptlist{} are not 
> > converted.
> 
> For this aspect, I'd prefer Joseph to chime in.

The texi2pod.pl changes look OK to me.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-06 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-01  2:28 [DOC] fix formatting problems in invoke.texi Manuel López-Ibáñez
2007-10-06 13:06 ` Gerald Pfeifer
2007-10-06 14:37   ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).