Mercurial > emacs
comparison src/coding.c @ 110834:b997f43af473
Fix complementing of a coding system
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Sat, 02 Oct 2010 10:44:50 +0900 |
| parents | 4d672e9d91bf |
| children | 394a9ff3e3cf |
comparison
equal
deleted
inserted
replaced
| 110830:4665df4accaa | 110834:b997f43af473 |
|---|---|
| 6071 : EQ (eol_type, Qdos) ? AREF (raw_text_eol_type, 1) | 6071 : EQ (eol_type, Qdos) ? AREF (raw_text_eol_type, 1) |
| 6072 : AREF (raw_text_eol_type, 2)); | 6072 : AREF (raw_text_eol_type, 2)); |
| 6073 } | 6073 } |
| 6074 | 6074 |
| 6075 | 6075 |
| 6076 /* If CODING_SYSTEM doesn't specify end-of-line format but PARENT | 6076 /* If CODING_SYSTEM doesn't specify end-of-line format, return one of |
| 6077 does, return one of the subsidiary that has the same eol-spec as | 6077 the subsidiary that has the same eol-spec as PARENT (if it is not |
| 6078 PARENT. Otherwise, return CODING_SYSTEM. If PARENT is nil, | 6078 nil and specifies end-of-line format) or the system's setting |
| 6079 inherit end-of-line format from the system's setting | |
| 6080 (system_eol_type). */ | 6079 (system_eol_type). */ |
| 6081 | 6080 |
| 6082 Lisp_Object | 6081 Lisp_Object |
| 6083 coding_inherit_eol_type (coding_system, parent) | 6082 coding_inherit_eol_type (coding_system, parent) |
| 6084 Lisp_Object coding_system, parent; | 6083 Lisp_Object coding_system, parent; |
| 6097 { | 6096 { |
| 6098 Lisp_Object parent_spec; | 6097 Lisp_Object parent_spec; |
| 6099 | 6098 |
| 6100 parent_spec = CODING_SYSTEM_SPEC (parent); | 6099 parent_spec = CODING_SYSTEM_SPEC (parent); |
| 6101 parent_eol_type = AREF (parent_spec, 2); | 6100 parent_eol_type = AREF (parent_spec, 2); |
| 6101 if (VECTORP (parent_eol_type)) | |
| 6102 parent_eol_type = system_eol_type; | |
| 6102 } | 6103 } |
| 6103 else | 6104 else |
| 6104 parent_eol_type = system_eol_type; | 6105 parent_eol_type = system_eol_type; |
| 6105 if (EQ (parent_eol_type, Qunix)) | 6106 if (EQ (parent_eol_type, Qunix)) |
| 6106 coding_system = AREF (eol_type, 0); | 6107 coding_system = AREF (eol_type, 0); |
| 6130 coding_type = CODING_ATTR_TYPE (attrs); | 6131 coding_type = CODING_ATTR_TYPE (attrs); |
| 6131 eol_type = AREF (spec, 2); | 6132 eol_type = AREF (spec, 2); |
| 6132 | 6133 |
| 6133 if (EQ (coding_type, Qundecided)) | 6134 if (EQ (coding_type, Qundecided)) |
| 6134 { | 6135 { |
| 6135 /* We must decide the text-conversion part. */ | 6136 /* We must decide the text-conversion part ar first. */ |
| 6136 if (CONSP (Vdefault_process_coding_system)) | 6137 if (CONSP (Vdefault_process_coding_system)) |
| 6137 { | 6138 { |
| 6138 coding_system = XCDR (Vdefault_process_coding_system); | 6139 coding_system = XCDR (Vdefault_process_coding_system); |
| 6139 if (! NILP (coding_system)) | 6140 if (! NILP (coding_system)) |
| 6140 { | 6141 { |
| 6160 } | 6161 } |
| 6161 } | 6162 } |
| 6162 if (NILP (eol_type) || VECTORP (eol_type)) | 6163 if (NILP (eol_type) || VECTORP (eol_type)) |
| 6163 { | 6164 { |
| 6164 /* We must decide the eol-conversion part. */ | 6165 /* We must decide the eol-conversion part. */ |
| 6165 coding_system = coding_inherit_eol_type (coding_system, Qnil); | 6166 coding_system = coding_inherit_eol_type (coding_system, coding_system); |
| 6166 } | 6167 } |
| 6167 | 6168 |
| 6168 return coding_system; | 6169 return coding_system; |
| 6169 } | 6170 } |
| 6170 | 6171 |
