texinfo-commits
[Top][All Lists]
Advanced

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

[7396] parsetexi update


From: gavinsmith0123
Subject: [7396] parsetexi update
Date: Tue, 20 Sep 2016 11:37:41 +0000 (UTC)

Revision: 7396
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7396
Author:   gavin
Date:     2016-09-20 11:37:41 +0000 (Tue, 20 Sep 2016)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/parsetexi/commands.c
    trunk/tp/parsetexi/commands.h
    trunk/tp/parsetexi/handle_commands.c

Modified: trunk/tp/parsetexi/commands.c
===================================================================
--- trunk/tp/parsetexi/commands.c       2016-09-20 11:16:48 UTC (rev 7395)
+++ trunk/tp/parsetexi/commands.c       2016-09-20 11:37:41 UTC (rev 7396)
@@ -44,6 +44,19 @@
 
   target.cmdname = cmdname;
 
+  /* Check for user-defined commands: macros, indexes, etc. */
+  /* Do this before looking in the built-in commands, in case the user uses 
+     @definfoenclose or similar to override a command.
+     If speed is a problem, then we could set a bit in the flags on the
+     builtin command (maybe reusing CF_INFOENCLOSE) to say to look in the
+     user commands instead. */
+
+  for (i = 0; i < user_defined_number; i++)
+    {
+      if (!strcmp (user_defined_command_data[i].cmdname, cmdname))
+        return ((enum command_id) i) | USER_COMMAND_BIT;
+    }
+
   c = (COMMAND *) bsearch (&target, builtin_command_data + 1,
         /* number of elements */
         sizeof (builtin_command_data) / sizeof (builtin_command_data[0]) - 1,
@@ -53,12 +66,6 @@
   if (c)
     return c - &builtin_command_data[0];
 
-  /* Check for user-defined commands: macros, indexes, etc. */
-  for (i = 0; i < user_defined_number; i++)
-    {
-      if (!strcmp (user_defined_command_data[i].cmdname, cmdname))
-        return ((enum command_id) i) | USER_COMMAND_BIT;
-    }
 
   return 0;
 }

Modified: trunk/tp/parsetexi/commands.h
===================================================================
--- trunk/tp/parsetexi/commands.h       2016-09-20 11:16:48 UTC (rev 7395)
+++ trunk/tp/parsetexi/commands.h       2016-09-20 11:37:41 UTC (rev 7396)
@@ -82,6 +82,8 @@
 /* NOTE: We've run out of spaces for flags, but some of these may not
    be used, or may not be necessary. For example, region could be done
    as BLOCK_region in data instead.
+     CF_code_style, CF_deprecated are hardly used.
+
    Candidates for flags:
      CF_close_paragraph
 

Modified: trunk/tp/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/parsetexi/handle_commands.c        2016-09-20 11:16:48 UTC (rev 
7395)
+++ trunk/tp/parsetexi/handle_commands.c        2016-09-20 11:37:41 UTC (rev 
7396)
@@ -1165,14 +1165,12 @@
                  && command_data(tmp->parent->cmd).data != BRACE_context)
             {
               if (command_flags(tmp->parent) & CF_code_style)
-                goto yes_kbd_code;
+                {
+                  add_extra_string (e, "code", "1");
+                  break;
+                }
               tmp = tmp->parent->parent;
             }
-          if (0)
-            {
-yes_kbd_code:
-              add_extra_string (e, "code", "1");
-            }
         }
     }
   else if (command_data(cmd).flags & CF_INFOENCLOSE)




reply via email to

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