On Mon, Sep 28, 2026 at 10:39:36AM +0200, [email protected] wrote:
> On Mon, Sep 28, 2026 at 08:13:31AM +0300, Eli Zaretskii wrote:
> > What about the @detailmenu used by large manuals?  E.g., Emacs uses it
> > in 2 of its manuals.  This menu includes all the nodes from the entire
> > manual, but the automatically-generated nodes will be absent from
> > there, won't they?
> 
> No, they will be present, the addition of nodes for sectioning commands
> is done before the automatic generation of menu and detailmenu.
> 
> > There's also the issue of stuff that can appear in section names, but
> > is not recommended for node names (colons, Texinfo commands, etc.).
> 
> What needs to be protected in the Texinfo code is protected (comma,
> leading parenthesis, colons...), and in the generated Info, the node
> name is also quoted if needed.  Texinfo commands are fine in node names.

I checked that texi2any issues appropriate warnings for automatically
generated node names.  For example:

  \input texinfo
  
  @node Top
  @top
  
  in top.
  
  @node One:
  @chapter One:
  
  AA.
  
  
  @chapter Two:
  
  AA.
  
  @bye

Here warnings are issued both for the explicit node ("One:") and the implicit
node ("Two:").

$ ../tta/perl/texi2any.pl -c 
TREE_TRANSFORMATIONS=insert_nodes_for_sectioning_commands shadow-node-name.texi 
shadow-node-name.texi:8: warning: menu entry node name should not contain `:'
shadow-node-name.texi:14: warning: menu entry node name should not contain `:'

Hence the feature seems to work farily well with non-recommended
characters in node names.

I did find a possible bug with parentheses:

  \input texinfo
  
  @node Top
  @top
  
  in top.
  
  @node One:
  @chapter One:
  
  AA.
  
  @chapter (Two)
  
  AA.
  
  @bye

Here, "texi2any -c TREE_TRANSFORMATIONS=insert_nodes_for_sectioning_commands"
fails to issue a warning for the "(Two)" node, and the node name is output
in the menu in "Top" without any protection, as:

* (Two)::

This link then fails to work in "info".

With an explicit line "@node (Two)" preceding the @chapter line, I get a
hard error:

shadow-node-name.texi:13: syntax for an external node used for `(Two)'

However, you can still get output by wrapping the opening ( with @asis{...}:

@node @asis{(}Two)

Again, here texi2any produces a non-functional menu entry to "(Two)", without
issuing a warning.

This suggests the lack of a warning is not specific to
insert_nodes_for_sectioning_commands.  The warning that does exist is probably
a syntax error of @node, not from a check of the resulting node name itself.

The correct output for a node name of "(Two)" would be for the node name to
be wrapped in DEL bytes in most contexts.

Similar use of @asis{...} to produce "forbidden" node names does lead to a
warning, as in "@node Two@asis{,}" (or "@chapter Two@asis{,}" with no @node),
so presumably the case of a node name beginning with what looks like an
external manual is just an omission from the node name validity checking.







Reply via email to