texinfo-commits
[Top][All Lists]
Advanced

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

[5670] tweaks to scanning node contents


From: Gavin D. Smith
Subject: [5670] tweaks to scanning node contents
Date: Tue, 17 Jun 2014 19:49:06 +0000

Revision: 5670
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5670
Author:   gavin
Date:     2014-06-17 19:49:05 +0000 (Tue, 17 Jun 2014)
Log Message:
-----------
tweaks to scanning node contents

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-06-17 19:08:55 UTC (rev 5669)
+++ trunk/ChangeLog     2014-06-17 19:49:05 UTC (rev 5670)
@@ -13,6 +13,11 @@
 
        * doc/info-stnd.texi (Node Commands): Document "M-x man".
 
+       * info/info-utils.c (scan_reference_target): [preprocess-nodes=On]:
+       Formatting tweak.
+       (scan_node_contents): Require whitespace after "*note" for it to be
+       recognized.  Make menus with no blank line after "* Menu:" work again.
+
 2014-06-15  Gavin Smith  <address@hidden>
 
        * info/t/search-after-tag.sh: New test.

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-06-17 19:08:55 UTC (rev 5669)
+++ trunk/info/info-utils.c     2014-06-17 19:49:05 UTC (rev 5670)
@@ -1447,16 +1447,12 @@
       if (node->flags & N_IsIndex)
         /* Show the name of the node the index entry refers to. */
         copy_input_to_output (length);
-      else if (node->flags & N_IsDir)
+      else
         {
           skip_input (length);
-          if (inptr[strspn (inptr, " ")] != '\n')
+
+          if ((node->flags & N_IsDir) && inptr[strspn (inptr, " ")] == '\n')
             {
-              for (i = 0; i < length; i++)
-                write_extra_bytes_to_output (" ", 1);
-            }
-          else
-            {
               /* For a dir node, if there is no more text in this line,
                  check if there is a menu entry description in the next
                  line to the right of the end of the label, and display it
@@ -1465,9 +1461,12 @@
               if (line_len <= strspn (inptr + 1, " "))
                 skip_input (1 + line_len);
             }
+          else
+            {
+              for (i = 0; i < length; i++)
+                write_extra_bytes_to_output (" ", 1);
+            }
         }
-      else
-        skip_input (length);
 
       /* Parse "(line ...)" part of menus, if any.  */
       {
@@ -1571,10 +1570,11 @@
 
   parse_top_node_line (node);
 
-  /* Search for menu items or cross references in buffer.
-     This is INFO_MENU_LABEL "|" INFO_XREF_LABEL, but
-     with '*' characters escaped. */
-  search_string = "\n\\* Menu:|\\*Note";
+  /* Search for menu items or cross references in buffer.  This is
+     INFO_MENU_LABEL "|" INFO_XREF_LABEL, but with '*' characters escaped.
+     Only match "*Note" if it is followed by a whitespace character so that it
+     will not be recognized if, e.g., it is surrounded in inverted commas. */
+  search_string = "\n\\* Menu:|(\\*Note[ \\t\\n])";
 
   s.buffer = node->contents;
   s.start = inptr - node->contents;
@@ -1595,7 +1595,9 @@
       if (!in_menu && match[0] == '\n')
         {
           in_menu = 1;
-          skip_input (strlen ("\n* Menu:\n"));
+          skip_input (strlen ("\n* Menu:"));
+          if (*inptr == '\n')
+            skip_input (strspn (inptr, "\n") - 1); /* Keep one newline. */
 
           /* This is INFO_MENU_ENTRY_LABEL "|" INFO_XREF_LABEL, but
              with '*' characters escaped. */




reply via email to

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