diff options
| author | Kenichi Handa | 2010-10-04 10:47:51 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-10-04 10:47:51 +0900 |
| commit | 5886ec9c0c7a250d987ac6180577b4574ea00f21 (patch) | |
| tree | f518647ecd98c743458cdfee5cb3d83a93c68df6 /src/coding.c | |
| parent | 58ff7eb1527a999044bbd99a07e372e7d442ca7a (diff) | |
| download | emacs-5886ec9c0c7a250d987ac6180577b4574ea00f21.tar.gz emacs-5886ec9c0c7a250d987ac6180577b4574ea00f21.zip | |
coding.c (complement_process_encoding_system): Fix previous change.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/src/coding.c b/src/coding.c index e2819f62e55..4b52c838d67 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -6122,51 +6122,55 @@ Lisp_Object | |||
| 6122 | complement_process_encoding_system (coding_system) | 6122 | complement_process_encoding_system (coding_system) |
| 6123 | Lisp_Object coding_system; | 6123 | Lisp_Object coding_system; |
| 6124 | { | 6124 | { |
| 6125 | Lisp_Object spec, attrs, coding_type, eol_type; | 6125 | Lisp_Object coding_base = Qnil, eol_base = Qnil; |
| 6126 | Lisp_Object spec, attrs; | ||
| 6126 | 6127 | ||
| 6127 | if (NILP (coding_system)) | 6128 | if (NILP (coding_system)) |
| 6128 | coding_system = Qundecided; | 6129 | coding_system = Qundecided; |
| 6129 | spec = CODING_SYSTEM_SPEC (coding_system); | 6130 | spec = CODING_SYSTEM_SPEC (coding_system); |
| 6130 | attrs = AREF (spec, 0); | 6131 | attrs = AREF (spec, 0); |
| 6131 | coding_type = CODING_ATTR_TYPE (attrs); | 6132 | if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided)) |
| 6132 | eol_type = AREF (spec, 2); | 6133 | coding_base = CODING_ATTR_BASE_NAME (attrs); |
| 6134 | if (! VECTORP (AREF (spec, 2))) | ||
| 6135 | eol_base = coding_system; | ||
| 6133 | 6136 | ||
| 6134 | if (EQ (coding_type, Qundecided)) | 6137 | if (NILP (coding_base)) |
| 6135 | { | 6138 | { |
| 6136 | /* We must decide the text-conversion part ar first. */ | 6139 | /* We must decide the text-conversion part ar first. */ |
| 6137 | if (CONSP (Vdefault_process_coding_system)) | 6140 | if (CONSP (Vdefault_process_coding_system) |
| 6141 | && ! NILP (XCDR (Vdefault_process_coding_system))) | ||
| 6138 | { | 6142 | { |
| 6139 | coding_system = XCDR (Vdefault_process_coding_system); | 6143 | coding_system = XCDR (Vdefault_process_coding_system); |
| 6140 | if (! NILP (coding_system)) | 6144 | spec = CODING_SYSTEM_SPEC (coding_system); |
| 6141 | { | 6145 | attrs = AREF (spec, 0); |
| 6142 | spec = CODING_SYSTEM_SPEC (coding_system); | 6146 | if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided)) |
| 6143 | attrs = AREF (spec, 0); | 6147 | coding_base = CODING_ATTR_BASE_NAME (attrs); |
| 6144 | coding_type = CODING_ATTR_TYPE (attrs); | 6148 | if (NILP (eol_base) && ! VECTORP (AREF (spec, 2))) |
| 6145 | eol_type = AREF (spec, 2); | 6149 | eol_base = coding_system; |
| 6146 | } | ||
| 6147 | } | 6150 | } |
| 6148 | if (EQ (coding_type, Qundecided)) | 6151 | if (NILP (coding_base)) |
| 6149 | { | 6152 | { |
| 6150 | coding_system = preferred_coding_system (); | 6153 | coding_system = preferred_coding_system (); |
| 6151 | spec = CODING_SYSTEM_SPEC (coding_system); | 6154 | spec = CODING_SYSTEM_SPEC (coding_system); |
| 6152 | attrs = AREF (spec, 0); | 6155 | attrs = AREF (spec, 0); |
| 6153 | coding_type = CODING_ATTR_TYPE (attrs); | 6156 | if (! EQ (CODING_ATTR_TYPE (attrs), Qundecided)) |
| 6154 | eol_type = AREF (spec, 2); | 6157 | coding_base = CODING_ATTR_BASE_NAME (attrs); |
| 6158 | if (NILP (eol_base) && ! VECTORP (AREF (spec, 2))) | ||
| 6159 | eol_base = coding_system; | ||
| 6155 | } | 6160 | } |
| 6156 | if (EQ (coding_type, Qundecided)) | 6161 | if (NILP (coding_base)) |
| 6157 | { | 6162 | { |
| 6158 | coding_system = Qraw_text; | 6163 | spec = CODING_SYSTEM_SPEC (Qraw_text); |
| 6159 | coding_type = Qraw_text; | 6164 | attrs = AREF (spec, 0); |
| 6160 | eol_type = Qnil; | 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; | ||
| 6161 | } | 6169 | } |
| 6162 | } | 6170 | } |
| 6163 | if (NILP (eol_type) || VECTORP (eol_type)) | ||
| 6164 | { | ||
| 6165 | /* We must decide the eol-conversion part. */ | ||
| 6166 | coding_system = coding_inherit_eol_type (coding_system, coding_system); | ||
| 6167 | } | ||
| 6168 | 6171 | ||
| 6169 | return coding_system; | 6172 | /* We must decide the eol-conversion part (if not yet done). */ |
| 6173 | return coding_inherit_eol_type (coding_base, eol_base); | ||
| 6170 | } | 6174 | } |
| 6171 | 6175 | ||
| 6172 | 6176 | ||