texinfo-commits
[Top][All Lists]
Advanced

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

[5886] look for menu marker and menu entries together


From: Gavin D. Smith
Subject: [5886] look for menu marker and menu entries together
Date: Wed, 22 Oct 2014 22:41:36 +0000

Revision: 5886
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5886
Author:   gavin
Date:     2014-10-22 22:41:35 +0000 (Wed, 22 Oct 2014)
Log Message:
-----------
look for menu marker and menu entries together

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-10-22 22:21:20 UTC (rev 5885)
+++ trunk/ChangeLog     2014-10-22 22:41:35 UTC (rev 5886)
@@ -30,6 +30,11 @@
        * info/indices.c (info_indices_of_file_buffer): Look for nodes 
        with "index" in the name as well as "Index".
 
+       * info/info-utils.c (forward_to_info_syntax): Don't search for 
+       "\n* Menu:" label separately, as this is comprised under 
+       searching for "\n* ".
+       (scan_node_contents): Conditional reordered.
+
 2014-10-21  Karl Berry  <address@hidden>
 
        * tp/texi2any.pl (makeinfo_help),

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-10-22 22:21:20 UTC (rev 5885)
+++ trunk/info/info-utils.c     2014-10-22 22:41:35 UTC (rev 5886)
@@ -1591,7 +1591,6 @@
       /* Menu entry comes first to optimize for the case of looking through a 
          long index node. */
       if (looking_at_string (contents, INFO_MENU_ENTRY_LABEL)
-          || looking_at_string (contents, INFO_MENU_LABEL)
           || looking_at_string (contents, INFO_XREF_LABEL)
           || !memcmp (contents, "\0\b[", 3))
         return contents;
@@ -1679,22 +1678,9 @@
       /* Write out up to match */
       copy_input_to_output (match - inptr); 
 
-      /* Was "* Menu:" seen?  If so, search for menu entries hereafter. */
-      if (!in_menu && !strncmp (match, INFO_MENU_LABEL,
-                                strlen (INFO_MENU_LABEL)))
+      if ((in_menu && match[0] == '\n') || match[0] == '*')
         {
-          in_menu = 1;
-          skip_input (strlen ("\n* Menu:"));
-          if (*inptr == '\n')
-            skip_input (strspn (inptr, "\n") - 1); /* Keep one newline. */
-
-        }
-      else if (match[0] == '\0') /* Info tag */
-        {
-          scan_info_tag (node, &in_index, fb);
-        }
-      else if (match[0] != '\n' || in_menu)
-        {
+          /* Menu entry or cross reference. */
           /* Create REFERENCE entity. */
           entry = info_new_reference (0, 0);
 
@@ -1719,6 +1705,20 @@
 
           add_pointer_to_array (entry, refs_index, refs, refs_slots, 50);
         }
+      /* Was "* Menu:" seen?  If so, search for menu entries hereafter. */
+      else if (!in_menu && !memcmp (match, INFO_MENU_LABEL,
+                               strlen (INFO_MENU_LABEL)))
+        {
+          in_menu = 1;
+          skip_input (strlen ("\n* Menu:"));
+          if (*inptr == '\n')
+            skip_input (strspn (inptr, "\n") - 1); /* Keep one newline. */
+
+        }
+      else if (match[0] == '\0') /* Info tag */
+        {
+          scan_info_tag (node, &in_index, fb);
+        }
       else
         copy_input_to_output (1);
     }




reply via email to

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