4823 |
coding->head_ascii = -1; |
coding->head_ascii = -1; |
4824 |
coding->common_flags |
coding->common_flags |
4825 |
= (VECTORP (eol_type) ? CODING_REQUIRE_DETECTION_MASK : 0); |
= (VECTORP (eol_type) ? CODING_REQUIRE_DETECTION_MASK : 0); |
4826 |
|
if (! NILP (CODING_ATTR_POST_READ (attrs))) |
4827 |
|
coding->common_flags |= CODING_REQUIRE_DECODING_MASK; |
4828 |
|
if (! NILP (CODING_ATTR_PRE_WRITE (attrs))) |
4829 |
|
coding->common_flags |= CODING_REQUIRE_ENCODING_MASK; |
4830 |
|
|
4831 |
val = CODING_ATTR_SAFE_CHARSETS (attrs); |
val = CODING_ATTR_SAFE_CHARSETS (attrs); |
4832 |
coding->max_charset_id = XSTRING (val)->size - 1; |
coding->max_charset_id = XSTRING (val)->size - 1; |
6231 |
EMACS_INT chars, bytes; |
EMACS_INT chars, bytes; |
6232 |
{ |
{ |
6233 |
int count = specpdl_ptr - specpdl; |
int count = specpdl_ptr - specpdl; |
6234 |
|
Lisp_Object attrs; |
6235 |
Lisp_Object buffer; |
Lisp_Object buffer; |
6236 |
|
|
6237 |
buffer = Fcurrent_buffer (); |
buffer = Fcurrent_buffer (); |
6243 |
coding->src_pos = -chars; |
coding->src_pos = -chars; |
6244 |
coding->src_pos_byte = -bytes; |
coding->src_pos_byte = -bytes; |
6245 |
coding->src_multibyte = chars < bytes; |
coding->src_multibyte = chars < bytes; |
6246 |
coding->dst_object = coding->src_object; |
coding->dst_object = buffer; |
6247 |
coding->dst_pos = PT; |
coding->dst_pos = PT; |
6248 |
coding->dst_pos_byte = PT_BYTE; |
coding->dst_pos_byte = PT_BYTE; |
6249 |
coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
6254 |
|
|
6255 |
decode_coding (coding); |
decode_coding (coding); |
6256 |
|
|
6257 |
|
attrs = CODING_ID_ATTRS (coding->id); |
6258 |
|
if (! NILP (CODING_ATTR_POST_READ (attrs))) |
6259 |
|
{ |
6260 |
|
struct gcpro gcpro1; |
6261 |
|
EMACS_INT prev_Z = Z, prev_Z_BYTE = Z_BYTE; |
6262 |
|
Lisp_Object val; |
6263 |
|
|
6264 |
|
TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte); |
6265 |
|
GCPRO1 (buffer); |
6266 |
|
val = call1 (CODING_ATTR_POST_READ (attrs), |
6267 |
|
make_number (coding->produced_char)); |
6268 |
|
UNGCPRO; |
6269 |
|
CHECK_NATNUM (val); |
6270 |
|
coding->produced_char += Z - prev_Z; |
6271 |
|
coding->produced += Z_BYTE - prev_Z_BYTE; |
6272 |
|
} |
6273 |
|
|
6274 |
unbind_to (count, Qnil); |
unbind_to (count, Qnil); |
6275 |
return coding->result; |
return coding->result; |
6276 |
} |
} |