On Mon, Oct 12, 2026 at 09:30:18AM +0200, Patrice Dumas wrote:
> On Sun, Oct 11, 2026 at 10:03:36PM +0200, Patrice Dumas wrote:
> > Therefore another customization variable could be needed.  Another
> > possibility would be to use a string instead a boolean for
> > AUTO_SECTION_NODE, with 3 possibilities
> > * AUTO_SECTION_NODE=add: add nodes in Info and HTML only if not
> >   ambiguous (otherwise add nodes with postpended [+1+] and [+2+]),
> >   and for other formats add targets only if not ambiguous.  The default.
> > * AUTO_SECTION_NODE=warn: always add a target and warn if there are 
> > duplicate
> > * AUTO_SECTION_NODE=silent: always add a target if there are duplicate and 
> > do
> >   not warn
> 
> This is not good, it is not possible with this scheme to differenciate
> between HTML/Info (added nodes) and other formats (added targets only).  One
> possibility would be, instead, to add another boolean variable:
>  NO_WARN_DUPLICATE_ADDED_SECTION_TARGET
> 
> It could probably also be possible to have a string option with 4
> possibilities, but I can't come up with good names.

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).

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?

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.
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.  I'd be happy with
WARN_DUPLICATE_SECTION_TARGET=0 for all output formats, although, as I believe
we discussed, this should affect only a few manuals, so outputting a warning
is an acceptable choice.

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.

The functioning of WARN_DUPLICATE_SECTION_TARGET may be slightly different
depending on the setting of AUTO_SECTION_NODE but I believe the purpose
of this variable would be clear enough to users in either case.



Reply via email to