[Top][All Lists]

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

Re: @anchor on @item line

From: Gavin Smith
Subject: Re: @anchor on @item line
Date: Sun, 12 Nov 2023 19:23:40 +0000

On Tue, Nov 07, 2023 at 11:29:24AM +0100, Patrice Dumas wrote:
> On Mon, Nov 06, 2023 at 07:29:50PM +0000, Gavin Smith wrote:
> > On Sun, Nov 05, 2023 at 11:30:42AM +0000, Ihor Radchenko wrote:
> > > May someone please explain the correct usage of @anchor in the above
> > > example and why the warning is being thrown?
> > 
> > I don't think there's really much wrong with it.  We added more warnings
> > for nested commands, trying to define which commands should occur in
> > certain contexts.  We have given the @item command a class of
> > "contain_basic_inline", which excludes anchor commands, as well as
> > the cross-reference commands.
> > 
> > I don't remember, or never knew to start with, what the justification
> > was for giving @item this class.
> I agree that accepting @anchor and @*ref on @item in @*table line would
> be ok.

There is actually a problem with @ftable and @vtable.  If you put an
@anchor on an @item line there, then it is the text of an index entry,
which is a real problem.

@node Top

@ftable @asis
@item AA @anchor{xy}

@item BB

@end ftable

@node Index

@printindex fn


This gives the warnings:

test.texi:4: warning: @anchor should not appear on @item line
test.texi:4: @anchor output more than once: xy

The anchor is processed a second time when the index is output.  Adding
further @printindex commands results in the same error being output again.

A warning is also given for @anchor in other index commands, like @cindex,
so this is consistent.

When I have time, I will look at how the warning could be given for
@ftable and @vtable only.

reply via email to

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