texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/makeinfo cmds.c,1.22,1.23 insertion.c,1.13,1.14 makeinfo.c,1.31,


From: dirt
Subject: texinfo/makeinfo cmds.c,1.22,1.23 insertion.c,1.13,1.14 makeinfo.c,1.31,1.32 makeinfo.h,1.3,1.4 multi.c,1.3,1.4 xml.c,1.16,1.17 xml.h,1.7,1.8
Date: Sat, 24 Jan 2004 16:58:12 +0100

Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv25433/makeinfo

Modified Files:
        cmds.c insertion.c makeinfo.c makeinfo.h multi.c xml.c xml.h 
Log Message:
2004-01-24  Alper Ersoy  <address@hidden>

        * makeinfo/multi.c (out_char): simple use add_char for XML and Docbook
        outputs too.

        * makeinfo/makeinfo.c (close_paragraph): just return when the output
        format is XML.

        * makeinfo/makeinfo.h: new variable xml_indendation_increment.

        * makeinfo/cmds.c (cm_comment): insert a newline before the comment,
        if there is not already one.
        (cm_noindent_cmd): skip whitespace after the command.

        * makeinfo/xml.c:
        * makeinfo/xml.h: new element DETAILMENU.

        * makeinfo/xml.c: menuentry and menucomment should not contain para.
        (xml_indent, xml_indent_end_para): use xml_indentation_increment
        value, and indent only if it is a positive number.
        (xml_start_para): apply indentation for XML output too.
        (xml_end_para): add newline if xml_indentation_increment is positive.
        (xml_insert_element_with_attribute): major indentation fixes.
        (xml_start_menu_entry): skip whitespace at the start of menu comments.
        (xml_add_char): fixed paragraph detection in menus, and added a check
        to detect multiple whitespaces after newline in menu comments.  Do not
        return when inside multitable to avoid concatenation of two lines
        without a space char in between.

        * makeinfo/insertion.c (cm_insert_copying, cm_lisp, cm_smalllisp)
        (cm_format, cm_smallformat, cm_display, cm_smalldisplay, cm_example)
        (cm_smallexample): do not insert newline when the output is XML.
        (end_insertion): ditto for the above mentioned block commands and
        @group.  Do not increment in_fixed_font for XML output.
        (begin_insertion, end_insertion): enclose @detailmenu in a detailmenu
        element.

        * util/texinfo.dtd: added detailmenu, and fixed menucomment and
        tableitem definitions.



Index: cmds.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** cmds.c      17 Jan 2004 11:03:54 -0000      1.22
--- cmds.c      24 Jan 2004 15:58:10 -0000      1.23
***************
*** 646,649 ****
--- 646,653 ----
            xml_dont_touch_items_defs++;
  
+           if (output_paragraph[output_paragraph_offset-1] != '\n'
+               && (!xml || xml_indentation_increment > 0))
+             insert ('\n');
+ 
            /* Crunch double hyphens in comments.  */
            add_html_block_elt ("<!-- ");
***************
*** 658,665 ****
                  just_after_dash = 0;
              }
!           add_word(" -->", line);
! 
!           if (html || docbook)
!             add_char ('\n');
  
            inhibit_paragraph_indentation = save_inhibit_indentation;
--- 662,666 ----
                  just_after_dash = 0;
              }
!           add_word (" -->");
  
            inhibit_paragraph_indentation = save_inhibit_indentation;
***************
*** 1279,1282 ****
--- 1280,1284 ----
    cm_noindent ();
    xml_no_indent = 1;
+   skip_whitespace_and_newlines();
  }
  

Index: insertion.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/insertion.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** insertion.c 17 Jan 2004 11:34:37 -0000      1.13
--- insertion.c 24 Jan 2004 15:58:10 -0000      1.14
***************
*** 455,462 ****
        if (xml)
          xml_insert_element (MENU, START);
  
        next_menu_item_number = 1;
        in_menu++;
-       in_fixed_width_font++;
        no_discard++;
        break;
--- 455,463 ----
        if (xml)
          xml_insert_element (MENU, START);
+       else
+         in_fixed_width_font++;
  
        next_menu_item_number = 1;
        in_menu++;
        no_discard++;
        break;
***************
*** 474,478 ****
          }
  
!       in_fixed_width_font++;
        in_detailmenu++;
        break;
--- 475,486 ----
          }
  
!       if (xml)
!         {
!           xml_insert_element (DETAILMENU, START);
!           skip_whitespace_and_newlines();
!         }
!       else
!         in_fixed_width_font++;
! 
        in_detailmenu++;
        break;
***************
*** 1072,1075 ****
--- 1080,1086 ----
  
      case detailmenu:
+       if (xml)
+         xml_insert_element (DETAILMENU, END);
+ 
        in_detailmenu--;          /* No longer hacking menus. */
        if (!in_menu)
***************
*** 1118,1122 ****
  
      case group:
!       close_insertion_paragraph ();
        break;
  
--- 1129,1134 ----
  
      case group:
!       if (!xml || docbook)
!         close_insertion_paragraph ();
        break;
  
***************
*** 1185,1190 ****
  
        /* The ending of one of these insertions always marks the
!          start of a new paragraph. */
!       close_insertion_paragraph ();
        break;
  
--- 1197,1203 ----
  
        /* The ending of one of these insertions always marks the
!          start of a new paragraph, except for the XML output. */
!       if (!xml || docbook)
!         close_insertion_paragraph ();
        break;
  
***************
*** 1323,1327 ****
        /* Make sure example text is starting on a new line
           for improved readability.  */
!       add_char ('\n');
      }
  
--- 1336,1341 ----
        /* Make sure example text is starting on a new line
           for improved readability.  */
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1341,1345 ****
          output_paragraph_offset--;
        xml_insert_element (SMALLEXAMPLE, START);
!       add_char ('\n');
      }
  
--- 1355,1360 ----
          output_paragraph_offset--;
        xml_insert_element (SMALLEXAMPLE, START);
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1359,1363 ****
          output_paragraph_offset--;
        xml_insert_element (LISP, START);
!       add_char ('\n');
      }
  
--- 1374,1379 ----
          output_paragraph_offset--;
        xml_insert_element (LISP, START);
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1377,1381 ****
          output_paragraph_offset--;
        xml_insert_element (SMALLLISP, START);
!       add_char ('\n');
      }
  
--- 1393,1398 ----
          output_paragraph_offset--;
        xml_insert_element (SMALLLISP, START);
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1442,1446 ****
          insert_string (copying_text);
  
!       insert ('\n');
        
        /* Update output_position so that the node positions in the tag
--- 1459,1464 ----
          insert_string (copying_text);
  
!       if (!xml || docbook)
!         insert ('\n');
        
        /* Update output_position so that the node positions in the tag
***************
*** 1466,1470 ****
              output_paragraph_offset--;
            xml_insert_element (FORMAT, START);
!           add_char ('\n');
          }
      }
--- 1484,1489 ----
              output_paragraph_offset--;
            xml_insert_element (FORMAT, START);
!           if (docbook)
!             add_char ('\n');
          }
      }
***************
*** 1481,1485 ****
          output_paragraph_offset--;
        xml_insert_element (SMALLFORMAT, START);
!       add_char ('\n');
      }
  
--- 1500,1505 ----
          output_paragraph_offset--;
        xml_insert_element (SMALLFORMAT, START);
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1496,1500 ****
          output_paragraph_offset--;
        xml_insert_element (DISPLAY, START);
!       add_char ('\n');
      }
  
--- 1516,1521 ----
          output_paragraph_offset--;
        xml_insert_element (DISPLAY, START);
!       if (docbook)
!         add_char ('\n');
      }
  
***************
*** 1511,1515 ****
          output_paragraph_offset--;
        xml_insert_element (SMALLDISPLAY, START);
!       add_char ('\n');
      }
  
--- 1532,1537 ----
          output_paragraph_offset--;
        xml_insert_element (SMALLDISPLAY, START);
!       if (docbook)
!         add_char ('\n');
      }
  

Index: makeinfo.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** makeinfo.c  23 Jan 2004 13:33:44 -0000      1.31
--- makeinfo.c  24 Jan 2004 15:58:10 -0000      1.32
***************
*** 3021,3024 ****
--- 3021,3027 ----
    int i;
  
+   if (xml && !docbook)
+     return;
+ 
    /* The insertion paragraph is no longer closed. */
    insertion_paragraph_closed = 0;

Index: makeinfo.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/makeinfo.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** makeinfo.h  8 Jan 2004 00:15:45 -0000       1.3
--- makeinfo.h  24 Jan 2004 15:58:10 -0000      1.4
***************
*** 95,98 ****
--- 95,102 ----
  DECLARE (int, default_indentation_increment, 5);
  
+ /* Amount by which xml indentation increases/decreases.
+    Zero means unnecessary whitespace is compressed.  */
+ DECLARE (int, xml_indentation_increment, 2);
+ 
  /* Nonzero indicates that filling a line also indents the new line. */
  DECLARE (int, indented_fill, 0);

Index: multi.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/multi.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** multi.c     30 Dec 2003 14:22:30 -0000      1.3
--- multi.c     24 Jan 2004 15:58:10 -0000      1.4
***************
*** 93,97 ****
      int ch;
  {
!   if (html)
      add_char (ch);
    else
--- 93,97 ----
      int ch;
  {
!   if (html || xml)
      add_char (ch);
    else

Index: xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** xml.c       23 Jan 2004 13:28:26 -0000      1.16
--- xml.c       24 Jan 2004 15:58:10 -0000      1.17
***************
*** 84,90 ****
  
    { "menu",                1, 0, 0 },
!   { "menuentry",           1, 0, 0 },
    { "menutitle",           0, 0, 0 },
!   { "menucomment",         1, 0, 0 },
    { "menunode",            0, 0, 0 },
    { "nodename",            0, 0, 0 },
--- 84,91 ----
  
    { "menu",                1, 0, 0 },
!   { "detailmenu",          1, 0, 0 },
!   { "menuentry",           0, 0, 0 },
    { "menutitle",           0, 0, 0 },
!   { "menucomment",         0, 0, 0 },
    { "menunode",            0, 0, 0 },
    { "nodename",            0, 0, 0 },
***************
*** 146,151 ****
    { "enumerate",           0, 0, 0 },
    { "table",               0, 0, 0 },
!   { "tableitem",           0, 0, 0 }, /* not used */ /* TABLEITEM */
!   { "tableterm",           0, 0, 0 }, /* not used */ /* TABLETERM */
  
    { "indexterm",           0, 1, 0 },
--- 147,152 ----
    { "enumerate",           0, 0, 0 },
    { "table",               0, 0, 0 },
!   { "tableitem",           0, 0, 0 },
!   { "tableterm",           0, 0, 0 },
  
    { "indexterm",           0, 1, 0 },
***************
*** 286,289 ****
--- 287,291 ----
  
    { "",                    1, 0, 0 }, /* MENU */
+   { "",                    1, 0, 0 }, /* DETAILMENU */
    { "",                    1, 0, 0 }, /* MENUENTRY */
    { "",                    0, 0, 0 }, /* MENUTITLE */
***************
*** 676,683 ****
  xml_indent ()
  {
!   int i;
!   insert ('\n');
!   for (i = 0; i < element_stack_index; i++)
!     insert (' ');
  }
  
--- 678,689 ----
  xml_indent ()
  {
!   if (xml_indentation_increment > 0)
!     {
!       int i;
!       if (output_paragraph[output_paragraph_offset-1] != '\n')
!         insert ('\n');
!       for (i = 0; i < element_stack_index * xml_indentation_increment; i++)
!         insert (' ');
!     }
  }
  
***************
*** 685,691 ****
  xml_indent_end_para ()
  {
!   int i;
!   for (i = 0; i < element_stack_index; i++)
!     insert (' ');
  }
  
--- 691,700 ----
  xml_indent_end_para ()
  {
!   if (xml_indentation_increment > 0)
!     {
!       int i;
!       for (i = 0; i < element_stack_index * xml_indentation_increment; i++)
!         insert (' ');
!     }
  }
  
***************
*** 696,705 ****
      return;
  
!   if (docbook)
!     {
!       while (output_paragraph[output_paragraph_offset-1] == '\n')
!         output_paragraph_offset--;
!       xml_indent ();
!     }
  
    insert_string ("<para");
--- 705,711 ----
      return;
  
!   while (output_paragraph[output_paragraph_offset-1] == '\n')
!     output_paragraph_offset--;
!   xml_indent ();
  
    insert_string ("<para");
***************
*** 723,726 ****
--- 729,734 ----
  
    insert_string ("</para>");
+   if (xml_indentation_increment > 0)
+     insert ('\n');
    xml_in_para = 0;
  }
***************
*** 808,812 ****
      return;
  
!   if (!xml_dont_touch_items_defs)
      if (xml_after_table_term && elt != TABLETERM)
        {
--- 816,820 ----
      return;
  
!   if (!xml_dont_touch_items_defs && arg == START)
      if (xml_after_table_term && elt != TABLETERM)
        {
***************
*** 814,818 ****
          xml_insert_element (ITEM, START);
        }
!     else if (xml_after_def_term && elt != DEFINITIONTERM && arg == START)
        {
          xml_after_def_term = 0;
--- 822,826 ----
          xml_insert_element (ITEM, START);
        }
!     else if (xml_after_def_term && elt != DEFINITIONTERM)
        {
          xml_after_def_term = 0;
***************
*** 847,851 ****
      xml_start_para ();
  
- 
    if (arg == START && xml_in_para && !xml_element_list[elt].contained_in_para)
      xml_end_para ();
--- 855,858 ----
***************
*** 854,860 ****
      xml_end_para ();
  
-   if (arg == START && docbook && !xml_in_para && 
!xml_element_list[elt].contained_in_para)
-     xml_indent ();
- 
    if (docbook && xml_table_level && !xml_in_item[xml_table_level] && 
!in_table_title
        && arg == START && elt != TABLEITEM && elt != TABLETERM
--- 861,864 ----
***************
*** 865,868 ****
--- 869,874 ----
      }
  
+   if (arg == START && !xml_in_para && 
!xml_element_list[elt].contained_in_para)
+     xml_indent ();
  
    if (arg == START)
***************
*** 871,874 ****
--- 877,900 ----
      xml_pop_current_element ();
  
+   /* Eat one newline before </example> and the like.  */
+   if (arg == END && (xml_element_list[elt].keep_space || elt == GROUP)
+       && output_paragraph[output_paragraph_offset-1] == '\n')
+     output_paragraph_offset--;
+ 
+   /* And eat whitespace before </entry> in @multitables.  */
+   if (arg == END && elt == ENTRY
+       && whitespace(output_paragraph[output_paragraph_offset-1]))
+     output_paragraph_offset--;
+ 
+   /* Indent elements that can contain <para>.  */
+   if (arg == END && !xml_in_para && xml_element_list[elt].contains_para)
+     xml_indent ();
+ 
+   /* Here are the elements we want indented.  These do not contain <para>
+      directly.  */
+   if (arg == END && (elt == MENUENTRY || elt == ITEMIZE || elt == ENUMERATE
+         || elt == TABLEITEM || elt == DEFINITION || elt == DEFINITIONTERM))
+     xml_indent ();
+ 
    insert ('<');
    if (arg == END)
***************
*** 900,904 ****
        insert_string (" id=\"");
        insert_string (xml_node_id);
!       insert_string ("\"");
        free (xml_node_id);
        xml_node_id = NULL;
--- 926,930 ----
        insert_string (" id=\"");
        insert_string (xml_node_id);
!       insert ('"');
        free (xml_node_id);
        xml_node_id = NULL;
***************
*** 918,921 ****
--- 944,951 ----
    insert ('>');
  
+   if (!xml_in_para && !xml_element_list[elt].contained_in_para
+       && xml_element_list[elt].contains_para && xml_indentation_increment > 0)
+     insert ('\n');
+ 
    xml_just_after_element = 1;
  }
***************
*** 1127,1130 ****
--- 1157,1161 ----
      }
    input_text_offset++;  /* discard the second colon or the period */
+   skip_whitespace_and_newlines();
    xml_insert_element (MENUCOMMENT, START);
    xml_in_menu_entry_comment ++;
***************
*** 1154,1159 ****
      int character;
  {
-   int xml_skip_newline = 0;
- 
    if (!book_started)
        return;
--- 1185,1188 ----
***************
*** 1215,1239 ****
      xml_start_para ();
  
!   if (xml_in_para)
      {
!       if (character == '\n')
!         {
!           if (xml_last_character == '\n' && !only_macro_expansion && 
!xml_no_para
!               && xml_element_list[xml_current_element()].contains_para )
!             {
!               xml_end_para ();
!               xml_just_after_element = 1;
!             xml_skip_newline = 1;
!               if (xml_in_menu_entry_comment)
!                 {
!                   xml_insert_element (MENUCOMMENT, END);
!                   xml_in_menu_entry_comment = 0;
!                   xml_insert_element (MENUENTRY, END);
!                   xml_in_menu_entry = 0;
!                 }
!             }
!         }
      }
  
    if (character == '\n' && !xml_in_para && !inhibit_paragraph_indentation)
      return;
--- 1244,1269 ----
      xml_start_para ();
  
!   if (xml_in_para && character == '\n' && xml_last_character == '\n'
!       && !only_macro_expansion && !xml_no_para
!       && xml_element_list[xml_current_element()].contains_para )
      {
!       xml_end_para ();
!       xml_just_after_element = 1;
!       if (!docbook)
!         return;
      }
  
+   if (xml_in_menu_entry_comment && character == '\n' && xml_last_character == 
'\n')
+     {
+       xml_insert_element (MENUCOMMENT, END);
+       xml_in_menu_entry_comment = 0;
+       xml_insert_element (MENUENTRY, END);
+       xml_in_menu_entry = 0;
+     }
+ 
+   if (xml_in_menu_entry_comment && whitespace(character)
+       && cr_or_whitespace(xml_last_character))
+     return;
+ 
    if (character == '\n' && !xml_in_para && !inhibit_paragraph_indentation)
      return;
***************
*** 1241,1247 ****
    xml_last_character = character;
  
-   if (xml_skip_newline && !docbook)
-     return;
- 
    if (character == '&' && escape_html)
        insert_string ("&amp;");
--- 1271,1274 ----
***************
*** 1250,1257 ****
    else if (character == '\n' && !xml_keep_space && !docbook)
      {
!       if (!xml_in_para && xml_just_after_element)
        return;
        else
!       insert_string (" ");
      }
    else
--- 1277,1284 ----
    else if (character == '\n' && !xml_keep_space && !docbook)
      {
!       if (!xml_in_para && xml_just_after_element && !multitable_active)
        return;
        else
!       insert (' ');
      }
    else

Index: xml.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** xml.h       9 Jan 2004 09:08:54 -0000       1.7
--- xml.h       24 Jan 2004 15:58:10 -0000      1.8
***************
*** 59,65 ****
    TITLEPAGE /* 26 */, AUTHOR, BOOKTITLE, BOOKSUBTITLE,
    /* Menu */
!   MENU /* 30 */, MENUENTRY, MENUTITLE, MENUCOMMENT, MENUNODE, NODENAME,
    /* -- */
!   ACRONYM/* 36 */, ACRONYMWORD, ACRONYMDESC,
    TT, CODE, COMMAND_TAG, ENV, FILE_TAG, OPTION, SAMP, KBD, URL, KEY,
    VAR, SC, DFN, EMPH, STRONG, CITE, NOTFIXEDWIDTH, I, B, R,  
--- 59,66 ----
    TITLEPAGE /* 26 */, AUTHOR, BOOKTITLE, BOOKSUBTITLE,
    /* Menu */
!   MENU /* 30 */, DETAILMENU, MENUENTRY, MENUTITLE, MENUCOMMENT, MENUNODE,
!   NODENAME,
    /* -- */
!   ACRONYM/* 37 */, ACRONYMWORD, ACRONYMDESC,
    TT, CODE, COMMAND_TAG, ENV, FILE_TAG, OPTION, SAMP, KBD, URL, KEY,
    VAR, SC, DFN, EMPH, STRONG, CITE, NOTFIXEDWIDTH, I, B, R,  



reply via email to

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