diff src/file-coding.c @ 4959:bd169a24a554

merge
author Ben Wing <ben@xemacs.org>
date Thu, 28 Jan 2010 04:27:30 -0600
parents 304aebb79cd3
children 0d4c9d0f6a8d
line wrap: on
line diff
--- a/src/file-coding.c	Thu Jan 28 04:02:14 2010 -0600
+++ b/src/file-coding.c	Thu Jan 28 04:27:30 2010 -0600
@@ -301,7 +301,7 @@
 
   write_fmt_string_lisp (printcharfun, "#<coding-system %s ", 1, c->name);
   print_coding_system_properties (obj, printcharfun);
-  write_c_string (printcharfun, ">");
+  write_ascstring (printcharfun, ">");
 }
 
 /* Print an abbreviated version of a coding system (but still containing
@@ -313,7 +313,7 @@
 {
   write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs));
   print_coding_system_properties (cs, printcharfun);
-  write_c_string (printcharfun, "]");
+  write_ascstring (printcharfun, "]");
 }
 
 #ifndef NEW_GC
@@ -521,18 +521,12 @@
 
               if (flags & QUERY_METHOD_ERRORP)
                 {
-                  DECLARE_EISTRING (error_details);
-
-                  eicpy_ascii (error_details, "Cannot encode ");
-                  eicat_lstr (error_details,
-                              make_string_from_buffer (buf, fail_range_start,
-                                                       pos -
-                                                       fail_range_start));
-                  eicat_ascii (error_details, " using coding system");
-
-                  signal_error (Qtext_conversion_error, 
-                                (const CIbyte *)(eidata (error_details)),
-                                XCODING_SYSTEM_NAME (codesys));
+                  signal_error_2
+		    (Qtext_conversion_error,
+		     "Cannot encode using coding system",
+		     make_string_from_buffer (buf, fail_range_start,
+					      pos - fail_range_start),
+		     XCODING_SYSTEM_NAME (codesys));
                 }
 
               if (NILP (result))
@@ -679,7 +673,7 @@
                 }
             }
 
-          coding_system_or_name = intern_int (eidata (desired_base));
+          coding_system_or_name = intern_istring (eidata (desired_base));
 
           /* Remove this coding system and its subsidiary coding
              systems from the hash, to avoid calling this code recursively. */
@@ -697,7 +691,7 @@
           /* Keep around the form so it doesn't disappear from under
              #'eval's feet. */
           GCPRO1 (lookup);
-          call1_trapping_problems ((const CIbyte *)eidata (warning_info),
+          call1_trapping_problems ((const CIbyte *) eidata (warning_info),
                                    Qeval, lookup, 0);
           UNGCPRO;
 
@@ -1107,14 +1101,14 @@
       enum eol_type eol = coding_subsidiary_list[i].eol;
 
       qxestrcpy_ascii (codesys_name + len, extension);
-      codesys_name_sym = intern_int (codesys_name);
+      codesys_name_sym = intern_istring (codesys_name);
       if (mlen != -1)
 	qxestrcpy_ascii (codesys_mnemonic + mlen, mnemonic_ext);
 
       sub_codesys = Fcopy_coding_system (codesys, codesys_name_sym);
       if (mlen != -1)
 	XCODING_SYSTEM_MNEMONIC (sub_codesys) =
-	  build_intstring (codesys_mnemonic);
+	  build_istring (codesys_mnemonic);
 
       if (eol != EOL_LF)
 	{
@@ -1127,7 +1121,7 @@
 	      (sub_codesys, "internal-subsidiary-eol-wrapper",
 	       Qchain, Qunbound,
 	       mlen != -1 ?
-	       list6 (Qmnemonic, build_intstring (codesys_mnemonic),
+	       list6 (Qmnemonic, build_istring (codesys_mnemonic),
 		      Qchain, chain,
 		      Qcanonicalize_after_coding, sub_codesys) :
 	       list4 (Qchain, chain,
@@ -1213,7 +1207,7 @@
 			      XSTRING_DATA (Fsymbol_name (XCODING_SYSTEM_NAME
 							  (name_or_existing))),
 			      ++coding_system_tick);
-      name_or_existing = intern_int (newname);
+      name_or_existing = intern_istring (newname);
       xfree (newname, Ibyte *);
       
       if (UNBOUNDP (description))
@@ -1222,12 +1216,12 @@
 	    emacs_sprintf_malloc
 	      (NULL, "For Internal Use (%s)",
 	       XSTRING_DATA (Fsymbol_name (name_or_existing)));
-	  description = build_intstring (newname);
+	  description = build_istring (newname);
 	  xfree (newname, Ibyte *);
 	}
 
       newname = emacs_sprintf_malloc (NULL, "Int%d", coding_system_tick);
-      defmnem = build_intstring (newname);
+      defmnem = build_istring (newname);
       xfree (newname, Ibyte *);
     }
   else
@@ -1248,7 +1242,7 @@
   cs->internal_p = !!prefix;
 
   if (NILP (description))
-    description = build_string ("");
+    description = build_ascstring ("");
   else
     CHECK_STRING (description);
   CODING_SYSTEM_DESCRIPTION (cs) = description;
@@ -1376,7 +1370,7 @@
 	    (NULL, "internal-eol-copy-%s-%d",
 	     XSTRING_DATA (Fsymbol_name (name_or_existing)),
 	     ++coding_system_tick);
-	Lisp_Object newnamesym = intern_int (newname);
+	Lisp_Object newnamesym = intern_istring (newname);
 	Lisp_Object copied = Fcopy_coding_system (csobj, newnamesym);
 	xfree (newname, Ibyte *);
 	
@@ -2612,10 +2606,10 @@
 {
   int i;
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   for (i = 0; i < XCODING_SYSTEM_CHAIN_COUNT (cs); i++)
     {
-      write_c_string (printcharfun, i == 0 ? "" : "->");
+      write_ascstring (printcharfun, i == 0 ? "" : "->");
       print_coding_system_in_print_method (XCODING_SYSTEM_CHAIN_CHAIN (cs)[i],
 					   printcharfun, escapeflag);
     }
@@ -2624,13 +2618,13 @@
     if (!NILP (cac))
       {
 	if (i > 0)
-	  write_c_string (printcharfun, " ");
-	write_c_string (printcharfun, "canonicalize-after-coding=");
+	  write_ascstring (printcharfun, " ");
+	write_ascstring (printcharfun, "canonicalize-after-coding=");
 	print_coding_system_in_print_method (cac, printcharfun, escapeflag);
       }
   }
 
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static void
@@ -3270,27 +3264,27 @@
     XCODING_SYSTEM_TYPE_DATA (cs, undecided);
   int need_space = 0;
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   if (data->do_eol)
     {
-      write_c_string (printcharfun, "do-eol");
+      write_ascstring (printcharfun, "do-eol");
       need_space = 1;
     }
   if (data->do_coding)
     {
       if (need_space)
-	write_c_string (printcharfun, " ");
-      write_c_string (printcharfun, "do-coding");
+	write_ascstring (printcharfun, " ");
+      write_ascstring (printcharfun, "do-coding");
       need_space = 1;
     }
   if (!NILP (data->cs))
     {
       if (need_space)
-	write_c_string (printcharfun, " ");
-      write_c_string (printcharfun, "coding-system=");
+	write_ascstring (printcharfun, " ");
+      write_ascstring (printcharfun, "coding-system=");
       print_coding_system_in_print_method (data->cs, printcharfun, escapeflag);
     }      
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static void
@@ -3719,9 +3713,9 @@
   if (n > 0)
     {
       name[n] = '\0';
-      /* This call to intern_int() is OK because we already verified that
+      /* This call to intern_istring() is OK because we already verified that
 	 there are only ASCII characters in the string */
-      return find_coding_system_for_text_file (intern_int ((Ibyte *) name), 0);
+      return find_coding_system_for_text_file (intern_istring ((Ibyte *) name), 0);
     }
 
   return Qnil;
@@ -4312,12 +4306,12 @@
 {
   struct gzip_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, gzip);
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   if (data->level == -1)
-    write_c_string (printcharfun, "default");
+    write_ascstring (printcharfun, "default");
   else
     print_internal (make_int (data->level), printcharfun, 0);
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static int
@@ -4750,7 +4744,7 @@
   /* We always have file-coding support */
   Fprovide (intern ("file-coding"));
 
-  QScoding_system_cookie = build_string (";;;###coding system: ");
+  QScoding_system_cookie = build_ascstring (";;;###coding system: ");
   staticpro (&QScoding_system_cookie);
 
 #ifdef HAVE_DEFAULT_EOL_DETECTION
@@ -4838,12 +4832,12 @@
 {
   Fmake_coding_system_internal
     (Qconvert_eol_cr, Qconvert_eol,
-     build_msg_string ("Convert CR to LF"),
+     build_defer_string ("Convert CR to LF"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Converts CR (used to mark the end of a line on Macintosh systems) to LF\n"
 "(used internally and under Unix to mark the end of a line)."),
-		    Qmnemonic, build_string ("CR->LF"),
+		    Qmnemonic, build_ascstring ("CR->LF"),
 		    Qsubtype, Qcr),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4853,11 +4847,11 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_lf, Qconvert_eol,
-     build_msg_string ("Convert LF to LF (do nothing)"),
+     build_defer_string ("Convert LF to LF (do nothing)"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Do nothing."),
-		    Qmnemonic, build_string ("LF->LF"),
+		    Qmnemonic, build_ascstring ("LF->LF"),
 		    Qsubtype, Qlf),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4867,12 +4861,12 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_crlf, Qconvert_eol,
-     build_msg_string ("Convert CRLF to LF"),
+     build_defer_string ("Convert CRLF to LF"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Converts CR+LF (used to mark the end of a line on Macintosh systems) to LF\n"
 "(used internally and under Unix to mark the end of a line)."),
-		    Qmnemonic, build_string ("CRLF->LF"),
+		    Qmnemonic, build_ascstring ("CRLF->LF"),
 		    Qsubtype, Qcrlf),
 
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
@@ -4883,11 +4877,11 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_autodetect, Qconvert_eol,
-     build_msg_string ("Autodetect EOL type"),
+     build_defer_string ("Autodetect EOL type"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Autodetect the end-of-line type."),
-		    Qmnemonic, build_string ("Auto-EOL"),
+		    Qmnemonic, build_ascstring ("Auto-EOL"),
 		    Qsubtype, Qnil),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4897,11 +4891,11 @@
 
   Fmake_coding_system_internal
     (Qundecided, Qundecided,
-     build_msg_string ("Undecided (auto-detect)"),
+     build_defer_string ("Undecided (auto-detect)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list6 (Qdo_eol, Qt, Qdo_coding, Qt,
 		    /* We do EOL detection ourselves so we don't need to be
 		       wrapped in an EOL detector. (It doesn't actually hurt,
@@ -4910,43 +4904,43 @@
 
   Fmake_coding_system_internal
     (intern ("undecided-dos"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (CRLF)"),
+     build_defer_string ("Undecided (auto-detect) (CRLF)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of CRLF forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qcrlf)));
 
   Fmake_coding_system_internal
     (intern ("undecided-unix"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (LF)"),
+     build_defer_string ("Undecided (auto-detect) (LF)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of LF forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qlf)));
 
   Fmake_coding_system_internal
     (intern ("undecided-mac"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (CR)"),
+     build_defer_string ("Undecided (auto-detect) (CR)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of CR forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qcr)));
 
   /* Need to create this here or we're really screwed. */
   Fmake_coding_system_internal
     (Qraw_text, Qno_conversion,
-     build_msg_string ("Raw Text"),
+     build_defer_string ("Raw Text"),
      nconc2 (list4 (Qdocumentation,
-                    build_msg_string ("Raw text converts only line-break "
+                    build_defer_string ("Raw text converts only line-break "
                                       "codes, and acts otherwise like "
                                       "`binary'."),
-                    Qmnemonic, build_string ("Raw")),
+                    Qmnemonic, build_ascstring ("Raw")),
 #ifdef MULE
              list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1,
                                            Vcharset_latin_iso8859_1))));
@@ -4957,9 +4951,9 @@
 
   Fmake_coding_system_internal
     (Qbinary, Qno_conversion,
-     build_msg_string ("Binary"),
+     build_defer_string ("Binary"),
      nconc2 (list6 (Qdocumentation,
-                    build_msg_string (
+                    build_defer_string (
 "This coding system is as close as it comes to doing no conversion.\n"
 "On input, each byte is converted directly into the character\n"
 "with the corresponding code -- i.e. from the `ascii', `control-1',\n"
@@ -4967,7 +4961,7 @@
 "converted back to the corresponding bytes, and other characters\n"
 "are converted to the default character, i.e. `~'."),
                     Qeol_type, Qlf,
-                    Qmnemonic, build_string ("Binary")),
+                    Qmnemonic, build_ascstring ("Binary")),
 #ifdef MULE
              list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1,
                                            Vcharset_latin_iso8859_1))));