On Sun, Nov 15, 2026 at 08:04:58PM +0100, Patrice Dumas wrote:
> On Wed, Nov 11, 2026 at 06:53:04PM +0000, Gavin Smith wrote:
> > This would be in nodes with explicit pointers given in @node, and which do
> > not have a @menu.  The nodes we need to reference are those created with
> > AUTO_SECTION_NODE, i.e. those without an explicit @node line.
> 
> I added code to remove explicit pointers in that case in the latest commit.

Thanks, it looks pretty good - the output for this manual is much improved.


> > We can further
> > restrict this to sectioning commands at a lower level - i.e. @unnumbered in
> > the @top node, or @section in a @chapter node.  This is because people using
> > sectioning commands for headings would be unlikely to use a higher or equal
> > level of sectioning command to that of the node they are in.
> 
> I did not actually understand that part.

The idea was that in input like

@node Explicit Node
@chapter Chapter

@chapheading Heading

- that the menu wouldn't be added, because @chapheading is at the same
heading of @chapter.  It would have to be @heading or lower.

I don't know how important the difference would be, without checking for
usage of this kind of construct in manuals.


> I added a warning when explicit directions are removed.  Maybe it could
> be checked.

The warning looks like this:

mtools.texi:66: warning: remove directions of `Top' to have an automatic menu 
for `Introduction'

One problem with this warning is that it isn't clear to users what the
connection may be between "directions" and "automatic menu", and the
connection seems to be an accident of how the feature is implemented.

I think your approach of removing node pointers so that a menu is generated
is good (although it would not be the only way).  One argument in favour of it
is that node pointers and menus are both structual relations of nodes.  (Another
similarity is in the Texinfo source, nodes are referenced with Info node
syntax - I'm not aware elsewhere in the Texinfo language of where the
"(MANUAL)NODENAME" construct would occur.)

So one way to make this simpler to understand would be to use a message
like this:

mtools.texi:66: warning: re-calculating node relations of `Top' to reference 
`Introduction'

"Node relations" here refers to both node pointers and the node menu.  It
would give users some justification for why we are discarding their explicit
node pointers, as it is plausible that node pointers and menus "come as a
package".


> Also maybe we could add as a continuation to the warning some
> information about setting AUTO_SECTION_NODE=0 as it is likely that the
> manual is best converted with AUTO_SECTION_NODE=0, as is the case for
> the Mtools manual?

Possibly, I'm not sure.


> There is another warning, which seems to me to be ok:
>  warning: node up pointer for `Location' is `Top' but up is `Introduction' in 
> menu
> We could detect that the Location node Up should be modified, as it was
> Next of Top before removing the automatic directions, but I do not think
> that it is worth it.  The manual author should investigate what is going
> on in that situation, I think.

Yes, there are obviously going to be warnings - as I said, the output is not
going to be quite right and the author should investigate.

Reply via email to