aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2010-10-08 09:43:16 +0900
committerKenichi Handa2010-10-08 09:43:16 +0900
commit93d50df81d3aa5fa1db9e50e4107e262523e3ae9 (patch)
treef8d6f3bf3e0da57f87f370887a0a664399566c49 /src/coding.c
parentff06de4f50becfe9d5fc16699531ce9802ee0b7f (diff)
downloademacs-93d50df81d3aa5fa1db9e50e4107e262523e3ae9.tar.gz
emacs-93d50df81d3aa5fa1db9e50e4107e262523e3ae9.zip
coding.c (complement_process_encoding_system): Fix previous change.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c65
1 files changed, 22 insertions, 43 deletions
diff --git a/src/coding.c b/src/coding.c
index 4b52c838d67..8e6642bb80d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6124,53 +6124,32 @@ complement_process_encoding_system (coding_system)
6124{ 6124{
6125 Lisp_Object coding_base = Qnil, eol_base = Qnil; 6125 Lisp_Object coding_base = Qnil, eol_base = Qnil;
6126 Lisp_Object spec, attrs; 6126 Lisp_Object spec, attrs;
6127 int i;
6127 6128
6128 if (NILP (coding_system)) 6129 for (i = 0; i < 3; i++)
6129 coding_system = Qundecided;
6130 spec = CODING_SYSTEM_SPEC (coding_system);
6131 attrs = AREF (spec, 0);
6132 if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
6133 coding_base = CODING_ATTR_BASE_NAME (attrs);
6134 if (! VECTORP (AREF (spec, 2)))
6135 eol_base = coding_system;
6136
6137 if (NILP (coding_base))
6138 { 6130 {
6139 /* We must decide the text-conversion part ar first. */ 6131 if (i == 1)
6140 if (CONSP (Vdefault_process_coding_system) 6132 coding_system = CDR_SAFE (Vdefault_process_coding_system);
6141 && ! NILP (XCDR (Vdefault_process_coding_system))) 6133 else if (i == 2)
6142 { 6134 coding_system = preferred_coding_system ();
6143 coding_system = XCDR (Vdefault_process_coding_system); 6135 spec = CODING_SYSTEM_SPEC (coding_system);
6144 spec = CODING_SYSTEM_SPEC (coding_system); 6136 if (NILP (spec))
6145 attrs = AREF (spec, 0); 6137 continue;
6146 if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided)) 6138 attrs = AREF (spec, 0);
6147 coding_base = CODING_ATTR_BASE_NAME (attrs); 6139 if (NILP (coding_base) && ! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
6148 if (NILP (eol_base) && ! VECTORP (AREF (spec, 2))) 6140 coding_base = CODING_ATTR_BASE_NAME (attrs);
6149 eol_base = coding_system; 6141 if (NILP (eol_base) && ! VECTORP (AREF (spec, 2)))
6150 } 6142 eol_base = coding_system;
6151 if (NILP (coding_base)) 6143 if (! NILP (coding_base) && ! NILP (eol_base))
6152 { 6144 break;
6153 coding_system = preferred_coding_system ();
6154 spec = CODING_SYSTEM_SPEC (coding_system);
6155 attrs = AREF (spec, 0);
6156 if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
6157 coding_base = CODING_ATTR_BASE_NAME (attrs);
6158 if (NILP (eol_base) && ! VECTORP (AREF (spec, 2)))
6159 eol_base = coding_system;
6160 }
6161 if (NILP (coding_base))
6162 {
6163 spec = CODING_SYSTEM_SPEC (Qraw_text);
6164 attrs = AREF (spec, 0);
6165 if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
6166 coding_base = CODING_ATTR_BASE_NAME (attrs);
6167 if (NILP (eol_base) && ! VECTORP (AREF (spec, 2)))
6168 eol_base = coding_system;
6169 }
6170 } 6145 }
6171 6146
6172 /* We must decide the eol-conversion part (if not yet done). */ 6147 if (i > 0)
6173 return coding_inherit_eol_type (coding_base, eol_base); 6148 /* The original CODING_SYSTEM didn't specify text-conversion or
6149 eol-conversion. Be sure that we return a fully complemented
6150 coding system. */
6151 coding_system = coding_inherit_eol_type (coding_base, eol_base);
6152 return coding_system;
6174} 6153}
6175 6154
6176 6155