bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistent spaces in menu and in node and @-commands


From: Patrice Dumas
Subject: Re: inconsistent spaces in menu and in node and @-commands
Date: Wed, 17 Aug 2022 20:42:50 +0200

On Wed, Aug 17, 2022 at 06:35:31PM +0100, Gavin Smith wrote:
> On Wed, Aug 17, 2022 at 07:11:05PM +0200, Patrice Dumas wrote:
> > A case that could probably happen in practice (not necessarly the case I
> > present, but there are many variations).  In node names/anchors, the
> > spaces are in general collapsed into one space, while in a menu entry
> > they are not.  In general it is not a problem, but when there are
> > @-commands this can lead to strange situations in which the menu lines
> > that reach the node name are the one that also trigger an error and
> > conversely the lines that do not trigger an error do not reach the node.
> > Here is an example:
> > 
> > @menu
> > * chap  b::             Error on node name, found
> > * chap @: b::           found even if spacing in Info is different from
> >                          spacing in tag table
> > * label: chap @: b.     Not found
> > * label: chap b.        Error on node name, found
> > @end menu
> > 
> > @node chap @: b
> > 
> > 
> > I do not like that situation but I am not certain on what would be the
> > best course of action.  Change the Info readers such that the spaces
> > within node names in menu are always non significant?
> 
> This seems to be simple to do:
> 
> diff --git a/info/scan.c b/info/scan.c
> index e14641b3a4..f59fbb9ce8 100644
> --- a/info/scan.c
> +++ b/info/scan.c
> @@ -1298,6 +1298,7 @@ scan_reference_target (REFERENCE *entry, NODE *node, 
> int in_parentheses)
>                                      &entry->nodename);
>        if (inptr[length] == '.') /* A '.' terminating the entry. */
>          length++;
> +      canonicalize_whitespace (entry->nodename);
>  
>        if (node->flags & N_IsDir)
>          {
> 
> Could you check if that solves the issue?  I tested it with the input
> you sent and all of the menu entries work then.

It solves the issue.

> 
> > Check in texi2any
> > that the expansion of the node on the menu line match or not and
> > determine based on that information rather than on the Texinfo node name
> > whether an error should be output?
> 
> It's more complicated that way.
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]