bug-texinfo
[Top][All Lists]
Advanced

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

Re: nested @ignore does not work


From: Patrice Dumas
Subject: Re: nested @ignore does not work
Date: Sun, 1 Jan 2023 18:36:05 +0100

On Wed, Dec 28, 2022 at 10:06:54PM +0000, Gavin Smith wrote:
> > I have done it, but I am not so happy with the result.  Indeed, nested
> > @ignore now appears in the tree, but the tree is quite complicated for a
> > case of an ignored block.  Maybe it would be better not to have an
> > explicit element in the tree, but keep count of the opened @ignore
> > blocks.
> 
> That sounds right.

This is done.

> > It is also not clear to me whether this is right to have nesting by type
> > of block command.  I am not sure that Texinfo TeX does it like that too.
> > Indeed, @if* nest together, @ignore nest with @ignore and @r?macro nest
> > together.  My guess is that in Texinfo TeX all should nest together.
> 
> Each type of ignored block (e.g. @ignore, @ifhtml) can nest through the
> \doignore macro in texinfo.tex, but only with other blocks of the same
> type.  So when ignoring @ignore, @ignore nested in @ignore is taken
> account of; likewise with ignoring @ifhtml.  If an @ifset or @ifclear
> conditional fails, the ignoring keeps track of nested @ifset, respectively
> @ifclear, blocks.

Ok, so this is much more similar to texi2any as I thought.  I would say
that there is nothing more to do then, although it is a bit different in
texi2any as the block conditionals can be mixed.

> > For example, if we want to have @ignore nesting to be able to ignore a
> > long slice of code, it will fail if there is in it
> > 
> > @macro a
> > @end ignore
> > @end macro
> 
> If this is inside an @ignore block in texinfo.tex, I expect the
> "@end ignore" line will terminate an @ignore block.  There is no
> handling of other block commands (like @macro in this case).
> 
> Such a macro appears to be useless, as it cannot be expanded to terminate
> an @ignore block.  If this macro @a{} is used following an @ignore line,
> it will be skipped over when looking for the @end ignore line.

Indeed, the code is pointless, but the point is that if the use case
is to put an @ignore and an @end ignore around any kind of code, it may
fail with some special use within @macro.

> See also (texinfo)Conditional Nesting in the manual.
> 
> 
> > @ifset notset
> > @end ignore
> > @end ifset
> 
> 
> I can't see how this is a useful use case.  If someone has a pair

Again it was not a useful use case, but an example to show that if the
point is to be able to put an @ignore and an @end ignore around any
kind of code, it des not really work.

In any case, and even though it is not fully clear to me that this is
the best, the most important is that texi2any and Texinfo TeX are
consistent.

-- 
Pat



reply via email to

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