bug-texinfo
[Top][All Lists]
Advanced

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

Re: html and Top, -html and @contents


From: Eli Zaretskii
Subject: Re: html and Top, -html and @contents
Date: Sat, 02 Feb 2002 12:47:34 +0200

> From: "pascal barbedor" <address@hidden>
> Date: Thu, 31 Jan 2002 23:25:41 +0100
> 
> > What exactly did you mean by ``the first entry of the toc is not
> > displayed''?  Can you show the problematic TOC entry produced by
> > makeinfo and tell what happens when you try to display it?
> 
> simply that the first chapter entry of the toc is not included in the toc
> list.
> for this file :
> ------------------------
> from here
> @contents
> 
> @node rac,node1,,(dir)

That's because your file doesn't have a Top node, and makeinfo 4.0f
always skips the first TOC entry (due to a bug), which normally is for
the Top node.  You don't have a Top node, so your first node is
omitted instead...

The patch below should fix the bug that causes the first entry to be
always skipped (but still leaves alone skipping the Top entry).

However, I'm wondering why is it a good idea to skip the TOC entry for
"Top".  Jan, it's your change (you posted it here about a year ago, see
http://mail.gnu.org/pipermail/bug-texinfo/2000-December/004124.html),
could you please help understand it?  Neither your message nor
ChangeLog explains the rationale for this change, so I wonder why did
you suggest that.  Shouldn't the user be able to return to the Top
node via the TOC?

2002-02-02  Eli Zaretskii  <address@hidden>

        * makeinfo/toc.c (contents_update_html): Fix the condition for
        omitting duplicate TOC entries.  Fix comparison with the TOC entry
        for "Top".


--- makeinfo/toc.c~1    Wed Jan 23 22:18:32 2002
+++ makeinfo/toc.c      Sat Feb  2 12:30:48 2002
@@ -242,10 +242,10 @@ contents_update_html (fp)
 
       /* No `Top' or double entries in toc.  */
       if (!(strncasecmp (toc_entry_alist[i]->name,
-                        "Top", sizeof ("Top") - 1) == 0
-           && toc_entry_alist[i]->name[sizeof ("Top")] == '"')
-          && i
-          && strcmp (toc_entry_alist[i]->name, toc_entry_alist[i-1]->name))
+                        /* name is of the form `Top">Something' */
+                        "Top\"", sizeof ("Top\"") - 1) == 0)
+          && !(i && strcmp (toc_entry_alist[i]->name,
+                           toc_entry_alist[i-1]->name) == 0))
         {
           /* each toc entry is a list item.  */
           fputs ("<li>", fp);
@@ -272,7 +272,7 @@ contents_update_html (fp)
                   splitting ? toc_entry_alist[i]->html_file : "",
                   toc_entry_alist[i]->name);
         }
-      
+
       last_level = toc_entry_alist[i]->level;
     }
 



reply via email to

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