On Mon, Oct 12, 2026 at 03:36:24PM +0100, Gavin Smith wrote:
> If I understand correctly, you want a way to configure whether warnings are
> given for duplicate automatically added section targets in both the cases
> when they are made into nodes (AUTO_SECTION_NODE=1) and when they are not
> (AUTO_SECTION_NODE=0).

Actually, it is currently more relevant for the case of
AUTO_SECTION_NODE=0, for which I want to have a way to configure whether
warnings are given for duplicate automatically added section targets,
but even for AUTO_SECTION_NODE=1 it could be interesting as currently
there is no warning at all unless there is an explicit @*ref, and no
target set, it would be helpful to add the warning such that the user
understands that there will not be targets set.  The warning should be
very similar to the existing warning but could still be a little
different.

> It makes sense to add another boolean variable as you suggest.  We could
> probably come up with a shorter name: maybe WARN_DUPLICATE_SECTION_TARGET?

Good.

> I would suggest that if we had two variables affecting this feature,
> AUTO_SECTION_NODE and WARN_DUPLICATE_SECTION_TARGET, they should operate
> in an independent way.  The defaults could be different for different output
> formats (I don't know why that would be, but that is what you wanted to do
> for Info and HTML), but setting one shouldn't change the value of the other.

Indeed.

> I think this means the default for Info and HTML is AUTO_SECTION_NODE=1 and
> WARN_DUPLICATE_SECTION_TARGET=0.  For other formats it is AUTO_SECTION_NODE=0
> and WARN_DUPLICATE_SECTION_TARGET=1.

That would be my preference, too.

> When we document these variables and the "shadow target" functionality, I
> would like to avoid being specific about whether references to duplicate
> targets work or not.  So we shouldn't explicitly allow for this with different
> keyword values for one of the customisation variables, as you initially
> proposed above.

I do not think that it was in what I initially proposed, but I may have
misunderstood.  In the case where nodes are not added but sections are
used even if there are duplicates, reference to duplicate targets should
work by nature, but I agree that we should not be too specific
nevertheless.

> The functioning of WARN_DUPLICATE_SECTION_TARGET may be slightly different
> depending on the setting of AUTO_SECTION_NODE

It probably needs to be both most useful, and understandable, although
it is not a requirement either.

> but I believe the purpose
> of this variable would be clear enough to users in either case.

Agreed.

-- 
Pat

Reply via email to