On Sat, Nov 21, 2026 at 09:50:04PM +0000, Gavin Smith wrote:
> I was able to check that the difference was due to the absence of
> $node_relations->{'associated_title_command'} with the implicitly
> added @node.

Indeed, it seems that I did not update
insert_nodes_for_sectioning_commands to set associated_title_command and
associated_anchor_command when I added associated_title_command (and
associated_anchor_command) in 7.3.

> So where it seems to go wrong is at the end of the "@top" line in the
> input, at these lines in Texinfo/ParserNonXS.pm:
> 
>     # associate the section (not part) with the current node.
>     if ($command ne 'node' and $command ne 'part') {
>       # associate section with the current node as its title.
>       if (exists($self->{'current_node'})) {
>         my $node_relations = $self->{'current_node'};
>         _associate_title_command_anchor($node_relations, $command_element,
>                                         $section_relations);
> 
> I haven't investigated any more, but I would expect that if @node commands
> are later added to the Texinfo tree, this association between @node and
> sectioning commands would have to be re-done.  It also seems possible that
> sectioning commands are associated to the wrong node, as well as no node
> at all.

I think that the sectioning commands without @node should not be
associated to another @node.  So it should only be a matter of adding
associated_title_command for the new node relations pointing to the
section relations, and associated_anchor_command for the section
relation pointing to the generated @node.  Having
associated_anchor_command set for the sectioning command relation would
show htat something is being modified, maybe unintentionally.

I can have a look tomorrow if not already fixed.

-- 
Pat

Reply via email to