bug-texinfo
[Top][All Lists]
Advanced

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

Re: another serious `texi2dvi -E' bug


From: Werner LEMBERG
Subject: Re: another serious `texi2dvi -E' bug
Date: Mon, 24 Nov 2008 08:41:07 +0100 (CET)

> In fact I was thinking, along the lines of the other thread, that
> maybe the best macro solution is to make it convenient to preprocess
> Texinfo documents with m4, which will surely support macros better
> than Texinfo ever will.

Sounds good.  Does m4 exist as a library which could be easily
integrated into makeinfo?

>     An alternative (and perhaps easier to implement) is to make
>     option `-E' act as my proposed --only-ifformat option.
> 
> I see that you already implemented it, but I admit I'm not crazy
> about this approach.

As you can see in the patch, the changes are very small and completely
painless.

>     However, this is not backwards compatible...
> 
> Ordinarily I try very hard to preserve backwards compatibility, but
> in this case I don't think it's a problem: a document would both
> have to use @FORMAT (very few day) *and* macros (very few do, in any
> nontrivial way) *and* rely on macro expansion within the @FORMAT --
> I suspect the intersection of all that is the empty set.

OK.  Below is an even simpler patch which modifies makeinfo's -E
option accordingly.

> However, if we can avoid the whole issue in some other way, such as
> using m4, so much the better.

This, I believe, is a major task to implement, and it seems that noone
has really time to do that right now.  Independent of a forthcoming
reimplementation of macros, flag -E stays, thus I believe that my
patch is useful and could be part of the next texinfo release (which
appears soon, I hope :-).


    Werner


======================================================================


2008-11-24  Werner Lemberg  <address@hidden>

        Make option `-E' process @ifFORMAT but ignore @FORMAT.

        * makeinfo/insertion.c (cm_html, cm_xml, cm_docbook, cm_tex):
        Implement it.

        * doc/texinfo.txi, NEWS: Document it.


--- ./doc/texinfo.txi.old       2008-11-24 08:02:04.000000000 +0100
+++ ./doc/texinfo.txi   2008-11-24 08:22:14.000000000 +0100
@@ -15642,8 +15642,14 @@
 @opindex -E @var{file}
 Output the Texinfo source with all the macros expanded to the named
 file.  Normally, the results of macro expansion are used internally by
address@hidden and then discarded.  This option is used by
address@hidden
address@hidden and then discarded.
+
+If this option is active, no @code{@@@var{format}} environments are
+processed.  For example, if you combine it with option
address@hidden, @code{@@iftex} blocks are handled but @code{@@tex}
+blocks are ignored.
+
address@hidden uses this option.
 
 @item --no-headers
 @item --plaintext
--- ./makeinfo/insertion.c.old  2008-04-24 07:01:44.000000000 +0200
+++ ./makeinfo/insertion.c      2008-11-24 08:00:58.000000000 +0100
@@ -1772,7 +1772,7 @@
 void
 cm_html (int arg)
 {
-  if (process_html)
+  if (process_html && !macro_expansion_output_stream)
     begin_insertion (rawhtml);
   else
     command_name_condition ();
@@ -1781,7 +1781,7 @@
 void
 cm_xml (int arg)
 {
-  if (process_xml)
+  if (process_xml && !macro_expansion_output_stream)
     begin_insertion (rawxml);
   else
     command_name_condition ();
@@ -1790,7 +1790,7 @@
 void
 cm_docbook (int arg)
 {
-  if (process_docbook)
+  if (process_docbook && !macro_expansion_output_stream)
     begin_insertion (rawdocbook);
   else
     command_name_condition ();
@@ -1874,7 +1874,7 @@
 void
 cm_tex (void)
 {
-  if (process_tex)
+  if (process_tex && !macro_expansion_output_stream)
     begin_insertion (rawtex);
   else
     command_name_condition ();
--- ./NEWS.old  2008-11-24 08:02:03.000000000 +0100
+++ ./NEWS      2008-11-24 08:27:32.000000000 +0100
@@ -36,6 +36,10 @@
   . language support for no removed/renamed to nb, per Norwegian translators.
   . new translation: id.
 
+* makeinfo:
+  . option -E now implies that @FORMAT blocks are ignored (for example,
+    `makeinfo --iftex -E foo bar' only handles @iftex but ignores @tex).
+
 
 4.13 (18 September 2008)
 




reply via email to

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