On Sat, Jun 28, 2025 at 09:45:03PM +0100, Gavin Smith wrote: > And now I have warnings with this manual (patch at the end of this mail): > > $ TEXINFO_XS_STRUCTURE=0 ../tta/perl/texi2any.pl info.texi > info.texi:461: warning: unexpected node `Help-]' in menu > info.texi:462: warning: unexpected node `Help-]' in menu > info.texi:623: warning: unexpected node `Help-FOO' in menu > info.texi:624: warning: unexpected node `Help-FOO' in menu > > The first two warnings are in relation to this menu: > > @menu > * ]: Help-]. Node telling about ]. > * stuff: Help-]. Same node. > * Help-]:: Yet again, same node. > @end menu > > The `Help-FOO' warnings are similar. This is an improvement > on previous warnings IMHO as the line number in the menu > is directly referenced. > > For a change like this, I regenerate the test results and > go through the results to see if they are satisfactory. I will > also have to write all of this in C for the XS code, as well.
Also if there is no such situation as the above, it could be relevant to add to the test suite. > Patrice: the > "$menu_node_relations->{'associated_section'}->{'section_directions'}->{'next'}->{'associated_node'}->{'element'}" > stuff is very verbose. All this is doing is finding the next > node based on sectioning. So I wonder if this relation > structure could be simplified. Maybe the "node relations" and > "section relations" could be "fused" so you don't have to > hop back and forth from one to the other? This kind of chain of links seems quite logical to me, so I am not really annoyed by this, even though it is somewhat lengthy. I can't see how it would be possible to fuse the "node relations" and "section relations" directly, they are different. It could be possible to add something else that would correspond to the node and associated section (and possibly the part), similar to element units, that would have all the directions. This is already what is done for element unit directions in HTML. I am not so convinced that it would be good to do it at this point, though. The information as it is now would need to stay anyway as it represents the relations in the tree, the relations found during parsing. Then this would add element units early on even for formats that do not really need them (DocBook for instance), and, in general add some redundancy and complexity, without much gain. The result could indeed be along $menu_node_relations->{'unit'}->{'section_directions'}->{'next'}->{'node_relation'}->{'element'} which isn't much better. It could be possible to duplicate the directions information, add section directions to nodes, and node directions to sections. That could reduce the chain length. However, I also think that it should be avoided, as it also duplicates information that is not so hard to find out. Overall, I am not really convinced that it is a good idea to add more information, as it is the minima information, and even if it is lengthy, it is easy to understand and get the job done. -- Pat