texinfo-commits
[Top][All Lists]
Advanced

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

texinfo update (Wed Jun 20 16:23:02 EDT 2007)


From: Karl Berry
Subject: texinfo update (Wed Jun 20 16:23:02 EDT 2007)
Date: Wed, 20 Jun 2007 16:23:04 -0400

Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.707
retrieving revision 1.708
diff -u -r1.707 -r1.708
--- ChangeLog   18 Jun 2007 13:07:13 -0000      1.707
+++ ChangeLog   20 Jun 2007 20:05:41 -0000      1.708
@@ -1,3 +1,16 @@
+2007-06-20  Karl Berry  <address@hidden>
+       
+       * lang.c (default_country_for_lang): just return country code, not
+       whole locale string.
+       
+       * makeinfo.h (output_head_p): new global.
+       * makeinfo.c (info_output_head, output_head): new fns.
+       (add_char): call it.  This is so we can translate the file header
+       ("produced by Makeinfo ...") in Info output as well as HTML.
+       * html.c,
+       * html.h, 
+       * cmds.c: change usage of html_output_head_p to output_head_p, etc.
+
 2007-06-17  Karl Berry  <address@hidden>
 
        * makeinfo/lang.c (default_country_for_lang): implement using the
Index: makeinfo/.gdbinit
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/.gdbinit,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- makeinfo/.gdbinit   15 Jun 2007 01:04:41 -0000      1.36
+++ makeinfo/.gdbinit   20 Jun 2007 20:05:42 -0000      1.37
@@ -261,5 +261,4 @@
 set args --no-split --html -o $ttests/chart.out $ttests/chart.tex
 
 #set env LANG de
-set args -o - --docbook $ttests/doclang.tex
-
+set args -o - --no-headers $ttests/doclang.tex
Index: makeinfo/cmds.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- makeinfo/cmds.c     29 Apr 2007 18:36:21 -0000      1.70
+++ makeinfo/cmds.c     20 Jun 2007 20:05:42 -0000      1.71
@@ -1,5 +1,5 @@
 /* cmds.c -- Texinfo commands.
-   $Id: cmds.c,v 1.70 2007/04/29 18:36:21 karl Exp $
+   $Id: cmds.c,v 1.71 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
@@ -607,7 +607,7 @@
   /* For HTML, do not output comments before HTML header is written,
      otherwise comments before @settitle cause an empty <title> in the
      header.  */
-  if ((html && html_output_head_p) || xml)
+  if ((html && output_head_p) || xml)
     {
       char *line;
       get_rest_of_line (0, &line);
Index: makeinfo/html.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/html.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- makeinfo/html.c     30 Apr 2007 00:11:00 -0000      1.36
+++ makeinfo/html.c     20 Jun 2007 20:05:42 -0000      1.37
@@ -1,8 +1,8 @@
 /* html.c -- html-related utilities.
-   $Id: html.c,v 1.36 2007/04/30 00:11:00 karl Exp $
+   $Id: html.c,v 1.37 2007/06/20 20:05:42 karl Exp $
 
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
-   Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -190,20 +190,13 @@
 HSTACK *htmlstack = NULL;
 
 /* See html.h.  */
-int html_output_head_p = 0;
 int html_title_written = 0;
 
 void
 html_output_head (void)
 {
   static const char *html_title = NULL;
-  char *encoding;
-
-  if (html_output_head_p)
-    return;
-  html_output_head_p = 1;
-
-  encoding = current_document_encoding ();
+  char *encoding = current_document_encoding ();
 
   /* The <title> should not have markup, so use text_expansion.  */
   if (!html_title)
@@ -216,8 +209,8 @@
   add_html_block_elt_args ("<html lang=\"%s\">\n<head>\n",
       language_table[language_code].abbrev);
 
-  /* When splitting, add current node's name to title if it's available and not
-     Top.  */
+  /* When splitting, add current node's name to title if it's available
+     and not Top.  */
   if (splitting && current_node && !STREQ (current_node, "Top"))
     add_word_args ("<title>%s - %s</title>\n",
         escape_string (xstrdup (current_node)), html_title);
Index: makeinfo/html.h
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/html.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- makeinfo/html.h     15 May 2005 00:00:07 -0000      1.7
+++ makeinfo/html.h     20 Jun 2007 20:05:42 -0000      1.8
@@ -1,7 +1,7 @@
 /* html.h -- declarations for html-related utilities.
-   $Id: html.h,v 1.7 2005/05/15 00:00:07 karl Exp $
+   $Id: html.h,v 1.8 2007/06/20 20:05:42 karl Exp $
 
-   Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -28,9 +28,6 @@
   char *attribs;
 } HSTACK;
 
-/* Nonzero if we have output the <head>.  */
-extern int html_output_head_p;
-
 /* Nonzero if we have output a title, from @titlefont or @settitle.  */
 extern int html_title_written;
 
Index: makeinfo/lang.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/lang.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- makeinfo/lang.c     18 Jun 2007 13:07:13 -0000      1.24
+++ makeinfo/lang.c     20 Jun 2007 20:05:42 -0000      1.25
@@ -1,5 +1,5 @@
 /* lang.c -- language-dependent support.
-   $Id: lang.c,v 1.24 2007/06/18 13:07:13 karl Exp $
+   $Id: lang.c,v 1.25 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free
    Software Foundation, Inc.
@@ -724,8 +724,8 @@
 /* Given a language code LL_CODE, return a "default" country code (in
    new memory).  We use the same table as gettext, and return LL_CODE
    uppercased in the absence of any better possibility, with a warning.
-   gettext silently defaults to the C locale, but we want to give users
-   a shot at fixing ambiguities.  */
+   (gettext silently defaults to the C locale, but we want to give users
+   a shot at fixing ambiguities.)  */
 
 #define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
 
@@ -925,29 +925,41 @@
     "zap_MX"   /* Zapotec      Mexico */
   };
   int c;
+  int cc_len;
   int ll_len = strlen (ll_code);
   char *cc_code = xmalloc (ll_len + 1 + 1);
   int principal_len = SIZEOF (locales_with_principal_territory);
   
   strcpy (cc_code, ll_code);
   strcat (cc_code, "_");
+  cc_len = ll_len + 1;
   
   for (c = 0; c < principal_len; c++)
-    if (strncmp (cc_code, locales_with_principal_territory[c], ll_len) == 0)
-      {
-        free (cc_code);
-        cc_code = xstrdup (locales_with_principal_territory[c]);
-        break;
-      }
+    {
+      const char *principal_locale = locales_with_principal_territory[c];
+      if (strncmp (principal_locale, cc_code, cc_len) == 0)
+        {
+          const char *underscore = strchr (principal_locale, '_');
+          /* should always be there, but in case ... */
+          free (cc_code);
+          cc_code = xstrdup (underscore ? underscore + 1 : principal_locale);
+          break;
+        }
+    }
   
   /* If didn't find one to copy, warn and duplicate.  */
   if (c == principal_len)
     {
-      warning (_("no default territory known for locale `%s'"), ll_code);
-      for (c = 0; c < strlen (ll_code); c++)
-        cc_code[c] = toupper (ll_code[c]);
-      cc_code[c] = 0;
-      /* We're wasting a byte, oops.  */
+      if (strcasecmp (ll_code, "en"))
+        cc_code = xstrdup ("en_US");
+      else
+        {
+          warning (_("no default territory known for language `%s'"), ll_code);
+          for (c = 0; c < strlen (ll_code); c++)
+            cc_code[c] = toupper (ll_code[c]);
+          cc_code[c] = 0;
+          /* We're probably wasting a byte, oops.  */
+        }
     }
   
   return cc_code;
@@ -1007,6 +1019,11 @@
   if (c == last_language_code)
     warning (_("%s is not a valid ISO 639 language code"), ll_part);
 
+  /* Set the language our `getdocumenttext' function uses for
+     translating document strings.  */
+  document_language = xstrdup (locale_string);
+  free (locale_string);
+  
   if (xml && !docbook)
     { /* According to http://www.opentag.com/xfaq_lang.htm, xml:lang
          takes an ISO 639 language code, optionally followed by a dash
@@ -1022,13 +1039,8 @@
       free (xml_locale);
     }
 
-  /* Set the language our `getdocumenttext' function uses for
-     translating document strings.  */
-  document_language = xstrdup (locale_string);
-  
   free (ll_part);
   free (cc_part);
-  free (locale_string);
 }
 
 
Index: makeinfo/makeinfo.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- makeinfo/makeinfo.c 15 Jun 2007 01:04:41 -0000      1.98
+++ makeinfo/makeinfo.c 20 Jun 2007 20:05:42 -0000      1.99
@@ -1,5 +1,5 @@
 /* makeinfo -- convert Texinfo source into other formats.
-   $Id: makeinfo.c,v 1.98 2007/06/15 01:04:41 karl Exp $
+   $Id: makeinfo.c,v 1.99 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
@@ -1658,7 +1658,7 @@
     }
 
   set_current_output_filename (real_output_filename);
-
+  
   if (xml && !docbook)
     xml_begin_document (filename_part (output_filename));
 
@@ -1696,13 +1696,6 @@
         line_number++;
   }
 
-  /* html fixxme: should output this as trailer on first page.  */
-  if (!no_headers && !html && !xml)
-    add_word_args (__("This is %s, produced by makeinfo version %s from 
%s.\n"),
-                   output_filename, VERSION, input_filename);
-
-  close_paragraph ();
-
   if (xml && !docbook)
     {
       /* Just before the real main loop, let's handle the defines.  */
@@ -2024,7 +2017,8 @@
   /* We never heard of this command. */
   return (COMMAND *) -1;
 }
-
+
+
 /* input_text_offset is right at the command prefix character.
    Read the next token to determine what to do.  Return zero
    if there's no known command or macro after the prefix character.  */
@@ -2617,7 +2611,42 @@
   return 0;
 }
 
+/* Output the header for Info.
+   html fixxme: should output this as trailer on first page (at least).  */
+
+static void
+info_output_head (void)
+{
+  add_word_args (__("This is %s, produced by makeinfo version %s from %s.\n"),
+                 output_filename, VERSION, input_filename);
 
+  /* Start afresh with whatever real text we have.  */
+  close_paragraph ();
+
+  /* We do not want indentation in what follows, which is usually going
+     to be a node marker (CTRL-_).  */
+  if (inhibit_paragraph_indentation == 0)
+    inhibit_paragraph_indentation = -1;
+}
+
+void
+output_head (void)
+{
+  if (output_head_p) /* no-op if we're mistakenly called twice */
+    return;
+  output_head_p = 1;
+  
+  if (html)
+    html_output_head ();
+  else if (xml)
+    ; /* handled differently, via xml_begin_document */
+  else if (no_headers)
+    ; /* no header for plain text */
+  else
+    info_output_head ();
+}
+
+
 /* Add the character to the current paragraph.  If filling_enabled is
    nonzero, then do filling as well. */
 void
@@ -2725,15 +2754,19 @@
               }
           }
 
-        /* This is sad, but it seems desirable to not force any
-           particular order on the front matter commands.  This way,
-           the document can do @settitle, @documentlanguage, etc, in
-           any order and with any omissions, and we'll still output
-           the html <head> `just in time'.  */
+        /* This is a sad place to do this, but it seems highly desirable
+           to not force any particular order on the front matter
+           commands.  This way, the document can do @settitle,
+           @documentlanguage, etc, in any order and with any omissions,
+           and we'll still output the header ("produced by makeinfo",
+           HTML <head>, etc.) `just in time'.  */
         if ((executing_macro || !executing_string)
             && !only_macro_expansion
-            && html && !html_output_head_p && !defining_copying ())
-          html_output_head ();
+            && !defining_copying ()
+            && !output_head_p)
+          {
+            output_head ();
+          }
 
         if (!paragraph_is_open)
           {
@@ -4304,7 +4337,7 @@
 #endif
     {
       /* Fetch the translation.  */
-      result = gettext (msgid);
+      result = gettext ((char *) msgid);
     }
 
   /* Restore LC_ALL, LANGUAGE environment variables.  */
@@ -4324,5 +4357,5 @@
   free (old_locale);
 #endif
 
-  return result;
+  return (char *) result;
 }
Index: makeinfo/makeinfo.h
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/makeinfo.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- makeinfo/makeinfo.h 29 Apr 2007 18:41:58 -0000      1.24
+++ makeinfo/makeinfo.h 20 Jun 2007 20:05:42 -0000      1.25
@@ -1,8 +1,8 @@
 /* makeinfo.h -- declarations for Makeinfo.
-   $Id: makeinfo.h,v 1.24 2007/04/29 18:41:58 karl Exp $
+   $Id: makeinfo.h,v 1.25 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006 Free Software Foundation, Inc.
+   2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -73,6 +73,9 @@
    any attention to `close_paragraph' calls. */
 DECLARE (int, must_start_paragraph, 0);
 
+/* Nonzero if we have output the topmatter of the output file.  */
+DECLARE (int, output_head_p, 0);
+
 /* Nonzero means that we have seen "@top" once already. */
 DECLARE (int, top_node_seen, 0);
 
@@ -363,6 +366,7 @@
   discard_braces (void),
   replace_with_expansion (int from, int *to),
   fix_whitespace (char *string),
+  output_head (void),
   add_html_elt (char *string);
 
 extern int get_until (char *match, char **string),
Index: makeinfo/node.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/node.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- makeinfo/node.c     5 Jun 2007 23:03:02 -0000       1.33
+++ makeinfo/node.c     20 Jun 2007 20:05:42 -0000      1.34
@@ -1,5 +1,5 @@
 /* node.c -- nodes for Texinfo.
-   $Id: node.c,v 1.33 2007/06/05 23:03:02 karl Exp $
+   $Id: node.c,v 1.34 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
@@ -913,8 +913,8 @@
          if (!tag)
            {
              output_stream = fopen (filename, "w");
-             html_output_head_p = 0; /* so that we generate HTML preamble */
-             html_output_head ();
+             output_head_p = 0; /* so that we generate HTML preamble */
+             output_head ();
            }
          else if ((tag->flags & TAG_FLAG_ANCHOR) != 0)
            {
@@ -931,8 +931,8 @@
              free (tag->html_fname);
              tag->html_fname = NULL;
              output_stream = fopen (filename, "w");
-             html_output_head_p = 0; /* so that we generate HTML preamble */
-             html_output_head ();
+             output_head_p = 0; /* so that we generate HTML preamble */
+             output_head ();
            }
          else
            {
Index: makeinfo/xml.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- makeinfo/xml.c      13 Jun 2007 18:57:39 -0000      1.69
+++ makeinfo/xml.c      20 Jun 2007 20:05:42 -0000      1.70
@@ -1,5 +1,5 @@
-/* xml.c -- xml output.
-   $Id: xml.c,v 1.69 2007/06/13 18:57:39 karl Exp $
+/* xml.c -- xml output, both TexinfoML and Docbook.
+   $Id: xml.c,v 1.70 2007/06/20 20:05:42 karl Exp $
 
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    Foundation, Inc.
@@ -15,8 +15,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+   along with this program; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
    Originally written by Philippe Martin <address@hidden>.  */
 
Index: makeinfo/xml.h
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/xml.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- makeinfo/xml.h      6 Aug 2005 16:04:37 -0000       1.27
+++ makeinfo/xml.h      20 Jun 2007 20:05:42 -0000      1.28
@@ -1,7 +1,8 @@
-/* xml.h -- xml output declarations.
-   $Id: xml.h,v 1.27 2005/08/06 16:04:37 karl Exp $
+/* xml.h -- xml (including Docbook) output declarations.
+   $Id: xml.h,v 1.28 2007/06/20 20:05:42 karl Exp $
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,8 +15,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
    Originally written by Philippe Martin <address@hidden>.  */
 
P ChangeLog
P makeinfo/.gdbinit
P makeinfo/cmds.c
P makeinfo/html.c
P makeinfo/html.h
P makeinfo/lang.c
P makeinfo/makeinfo.c
P makeinfo/makeinfo.h
P makeinfo/node.c
P makeinfo/xml.c
P makeinfo/xml.h




reply via email to

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