emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/coding.c


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/coding.c
Date: Thu, 13 Apr 2006 06:47:01 +0000

Index: emacs/src/coding.c
diff -u emacs/src/coding.c:1.334 emacs/src/coding.c:1.335
--- emacs/src/coding.c:1.334    Thu Apr 13 04:57:52 2006
+++ emacs/src/coding.c  Thu Apr 13 06:47:00 2006
@@ -3607,6 +3607,8 @@
     {
       coding->eol_type = CODING_EOL_UNDECIDED;
       coding->common_flags = CODING_REQUIRE_DETECTION_MASK;
+      if (system_eol_type != CODING_EOL_LF)
+       coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
     }
   else if (XFASTINT (eol_type) == 1)
     {
@@ -3923,8 +3925,11 @@
   coding->category_idx = CODING_CATEGORY_IDX_BINARY;
   coding->common_flags = 0;
   coding->eol_type = NILP (coding_system) ? system_eol_type : CODING_EOL_LF;
+  if (coding->eol_type != CODING_EOL_LF)
+    coding->common_flags
+      |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
   coding->pre_write_conversion = coding->post_read_conversion = Qnil;
-  return -1;
+  return NILP (coding_system) ? 0 : -1;
 }
 
 /* Free memory blocks allocated for storing composition information.  */
@@ -7113,7 +7118,7 @@
   from = XFASTINT (start);
   to = XFASTINT (end);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return make_number (to - from);
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7168,7 +7173,7 @@
   CHECK_STRING (string);
   CHECK_SYMBOL (coding_system);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return (NILP (nocopy) ? Fcopy_sequence (string) : string);
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
@@ -7227,7 +7232,7 @@
   CHECK_STRING (string);
   CHECK_SYMBOL (coding_system);
 
-  if (NILP (coding_system))
+  if (NILP (coding_system) && system_eol_type == CODING_EOL_LF)
     return string;
 
   if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)




reply via email to

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