comparison src/coding.c @ 90587:fe721cfad011

(setup_coding_system): Fix setting of coding->common_flags based on eol_type. (coding_inherit_eol_type): If PARENT is not nil, be sure to inherit from it.
author Kenichi Handa <handa@m17n.org>
date Mon, 21 Aug 2006 12:48:22 +0000
parents 858cb33ae39d
children a965377e6761
comparison
equal deleted inserted replaced
90586:1519f5723a89 90587:fe721cfad011
4961 attrs = CODING_ID_ATTRS (coding->id); 4961 attrs = CODING_ID_ATTRS (coding->id);
4962 eol_type = CODING_ID_EOL_TYPE (coding->id); 4962 eol_type = CODING_ID_EOL_TYPE (coding->id);
4963 4963
4964 coding->mode = 0; 4964 coding->mode = 0;
4965 coding->head_ascii = -1; 4965 coding->head_ascii = -1;
4966 coding->common_flags 4966 if (VECTORP (eol_type))
4967 = (VECTORP (eol_type) ? CODING_REQUIRE_DETECTION_MASK : 0); 4967 coding->common_flags = (CODING_REQUIRE_DECODING_MASK
4968 | CODING_REQUIRE_DETECTION_MASK);
4969 else if (! EQ (eol_type, Qunix))
4970 coding->common_flags = (CODING_REQUIRE_DECODING_MASK
4971 | CODING_REQUIRE_ENCODING_MASK);
4972 else
4973 coding->common_flags = 0;
4968 if (! NILP (CODING_ATTR_POST_READ (attrs))) 4974 if (! NILP (CODING_ATTR_POST_READ (attrs)))
4969 coding->common_flags |= CODING_REQUIRE_DECODING_MASK; 4975 coding->common_flags |= CODING_REQUIRE_DECODING_MASK;
4970 if (! NILP (CODING_ATTR_PRE_WRITE (attrs))) 4976 if (! NILP (CODING_ATTR_PRE_WRITE (attrs)))
4971 coding->common_flags |= CODING_REQUIRE_ENCODING_MASK; 4977 coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
4972 if (! NILP (CODING_ATTR_FOR_UNIBYTE (attrs))) 4978 if (! NILP (CODING_ATTR_FOR_UNIBYTE (attrs)))
5200 5206
5201 if (! NILP (parent)) 5207 if (! NILP (parent))
5202 { 5208 {
5203 Lisp_Object parent_spec; 5209 Lisp_Object parent_spec;
5204 5210
5205 parent_spec 5211 parent_spec = CODING_SYSTEM_SPEC (parent);
5206 = CODING_SYSTEM_SPEC (buffer_defaults.buffer_file_coding_system);
5207 parent_eol_type = AREF (parent_spec, 2); 5212 parent_eol_type = AREF (parent_spec, 2);
5208 } 5213 }
5209 else 5214 else
5210 parent_eol_type = system_eol_type; 5215 parent_eol_type = system_eol_type;
5211 if (EQ (parent_eol_type, Qunix)) 5216 if (EQ (parent_eol_type, Qunix))