1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00
Commit graph

295 commits

Author SHA1 Message Date
Kenichi Handa
01378f4987 * coding.c (QCcategory): New variable.
(syms_of_coding): Defsym it.  Set all elements of
Vcoding_category_table and their symbol values.
(Fset_coding_system_priority): Doc fix.  Update symbol qvalues of
coding-category-XXX, and coding-category-list.
(Fdefine_coding_system_internal): Add category in the plist.
2003-06-06 02:13:40 +00:00
Kenichi Handa
ff563fced5 (Fset_coding_system_priority): Doc fix. Update values
of codng-category-XXX, and coding-category-list.
(syms_of_coding): Set all elements of Vcoding_category_table and
their symbol values.
2003-06-05 23:21:22 +00:00
Kenichi Handa
d3e4cb56a3 (decode_coding_iso_2022): Fix handling of invalid
bytes.
(raw_text_coding_system): Check NILP (coding_system).
(coding_inherit_eol_type): Check NILP (coding_system) and
NILP (parent).
(consume_chars): Fix for the case of raw-text.
2003-06-05 12:34:31 +00:00
Kenichi Handa
5e5c78beb4 (setup_coding_system): If coding has
post-read-conversion or pre-write-conversion, set
CODING_REQUIRE_DECODING_MASK and CODING_REQUIRE_ENCODING_MASK
respectively.
(decode_coding_gap): Run post-read-conversion if any.
2003-05-29 13:17:04 +00:00
Kenichi Handa
857dccb041 (make_conversion_work_buffer): Change the work buffer
name to the same one as that of Emacs 21.
2003-05-29 02:18:56 +00:00
Kenichi Handa
4776e6380a (detected_mask): Delete unused variable.
(decode_coding_iso_2022): Pay attention to the byte sequence of
CTEXT extended segment, and retain those bytes as is.
(decode_coding_ccl): Delete unused variable `valids'.
(setup_coding_system): Delete unused variable `category'.
(consume_chars): Delete unused variable `category'.  Make it work
for non-multibyte case.
(make_conversion_work_buffer): Argument changed.
(saved_coding): Delete unused variable.
(code_conversion_restore): Don't check saved_coding->destination.
(code_conversion_save): New function.
(decode_coding_gap, encode_coding_gap): Call code_conversion_save
instead of record_unwind_protect.
(decode_coding_object, encode_coding_object): Likewise.  Recover
PT.
(detect_coding_system): Delete unused variable `mask'.
(Fdefine_coding_system_internal): Delete unsed vaiable id;
2003-05-28 11:37:09 +00:00
Kenichi Handa
4187a77da7 (Fdefine_coding_system_internal): Fix for the case that
coding_type is Qcharset.
2003-05-20 13:05:14 +00:00
Kenichi Handa
b49a1807a9 (Qsignature, Qendian): Delete these variables.
(syms_of_coding): Don't initialize them.
(CATEGORY_MASK_UTF_16_AUTO): New macro.
(detect_coding_utf_16): Add CATEGORY_MASK_UTF_16_AUTO in
detect_info->found.
(decode_coding_utf_16): Don't detect BOM here.
(encode_coding_utf_16): Produce BOM if CODING_UTF_16_BOM (coding)
is NOT utf_16_without_bom.
(setup_coding_system): For a coding system of type utf-16, check
if the attribute :endian is Qbig or not (not nil or not), and set
CODING_REQUIRE_DETECTION_MASK if BOM detection is required.
(detect_coding): If coding type is utf-16 and BOM detection is
required, detect it.
(Fdefine_coding_system_internal): For a coding system of type
utf-16, check if the attribute :endian is Qbig or not (not nil or
not).
2003-05-06 12:28:11 +00:00
Kenichi Handa
2cb2605761 (coding_set_source): Fix for the case that the current
buffer is different from coding->src_object.
(decode_coding_object): Don't use the conversion work buffer if
DST_OBJECT is a buffer.
2003-05-06 08:16:37 +00:00
Kenichi Handa
880cf180d9 (Qutf_16_be_nosig, Qutf_16_be, Qutf_16_le_nosig)
(Qutf_16_le): Remove these variables.
(syms_of_coding): Don't DEFSYM them.
(decode_coding_utf_16): Fix handling of BOM.
(encode_coding_utf_16): Fix handling of BOM.
2003-03-28 04:09:32 +00:00
Dave Love
e1c2380488 (Fcheck_coding_systems_region): Fix type errors. 2003-02-13 22:23:01 +00:00
Kenichi Handa
8dcbea820b (decode_coding_ccl, encode_coding_ccl): Call ccl_driver
with the last arg charset_list acquired from coding.
(Fdefine_coding_system_internal): For ccl-based coding system, fix
the attribute coding_attr_ccl_valids.
2003-01-30 02:23:40 +00:00
Kenichi Handa
ff0dacd733 (CATEGORY_MASK_RAW_TEXT): New macro.
(detect_coding_utf_8, detect_coding_utf_16)
(detect_coding_emacs_mule, detect_coding_iso_2022)
(detect_coding_sjis, detect_coding_big5)
(detect_coding_ccl, detect_coding_charset): Change argument MASK
to DETECT_INFO.  Update DETECT_INFO and return 1 if the byte
sequence is valid in this coding system.  Callers changed.
(MAX_ANNOTATION_LENGTH): New macro.
(ADD_ANNOTATION_DATA): New macro.
(ADD_COMPOSITION_DATA): Argument changed.  Callers changed.  Call
ADD_ANNOTATION_DATA.  The format of annotation data changed.
(ADD_CHARSET_DATA): New macro.
(emacs_mule_char): New argument ID.  Callers changed.
(decode_coding_emacs_mule, decode_coding_iso_2022)
(decode_coding_sjis, decode_coding_big5, decode_coding_charset):
Produce charset annotation data in coding->charbuf.
(encode_coding_emacs_mule, encode_coding_iso_2022): Pay attention
to charset annotation data in coding->charbuf.
(setup_coding_system): Add CODING_ANNOTATE_CHARSET_MASK
coding->common_flags if the coding system is iso-2022 based and
uses designation.
(produce_composition): Adjusted for the new annotation data
format.
(produce_charset): New function.
(produce_annotation): Handle charset annotation.
(handle_composition_annotation, handle_charset_annotation): New
functions.
(consume_chars): Handle charset annotation.  Utilize the above two
functions.
(encode_coding_object): If SRC_OBJECT and DST_OBJECT are the same
buffer, get the deleted text as a string and set
coding->src_object to that string.
(detect_coding, detect_coding_system): Use the new struct
coding_detection_info.
2003-01-06 11:37:17 +00:00
Kenichi Handa
9872508332 (decode_coding_utf_8): When eol_type is Qdos, handle
the case that the last byte is '\r' correctly.
(decode_coding_emacs_mule): Likewise.
(decode_coding_iso_2022): Likewise.
(decode_coding_sjis): Likewise.
(decode_coding_big5): Likewise.
(decode_coding_charset): Likewise.
(produce_chars): Likewise.
(decode_coding): Flushing out the unprocessed data correctly.
(decode_coding_gap): Set CODING_MODE_LAST_BLOCK bit of
coding->mode.
2002-11-06 00:10:42 +00:00
Kenichi Handa
0ce7886f8d (Fdefine_coding_system_internal): Fix previous change. 2002-10-16 09:12:55 +00:00
Kenichi Handa
584948ace5 (detect_coding_charset): If only ASCII bytes are found, return 0.
(detect_coding_system): Fix previous change.
(Fdefine_coding_system_internal): Setup CODING_ATTR_ASCII_COMPAT
(attrs) correctly.
2002-10-16 05:04:10 +00:00
Kenichi Handa
78b82cca67 (detect_coding): Fix previous change. 2002-10-16 02:14:49 +00:00
Dave Love
b054002f4a (Fcheck_coding_system): Doc fix. 2002-10-15 13:03:30 +00:00
Kenichi Handa
da4109a9ec (decode_coding): Fix args to translate_chars. Pay
attention to Vstandard_translation_table_for_decode.
(encode_coding): Fix args to translate_chars.  Pay attention to
Vstandard_translation_table_for_encode.
2002-10-15 01:15:52 +00:00
Kenichi Handa
89528eb3a7 (detect_coding_utf_8): Check incomplete byte sequence.
Don't update *mask when correctly detected.
(detect_coding_utf_16): Likewise.
(detect_coding_emacs_mule): Likewise.
(detect_coding_iso_2022): Likewise.
(detect_coding_sjis): Likewise.
(detect_coding_big5): Likewise.
(detect_coding_ccl): Likewise.
(decode_coding_sjis): Fix decoding of katakana-jisx0201.
(detect_eol): Delete the argument CODING, and add the argument
CATEGORY.
(detect_coding): Adjusted for the changes above.
(detect_coding_system): Likewise.
2002-10-10 09:05:37 +00:00
Dave Love
72fe130161 (decode_coding_utf_8): Treat surrogates as invalid. 2002-10-09 22:00:36 +00:00
Kenichi Handa
28f67a95f7 (coding_set_destination): Fix coding->destination for
the case converting a region.
(encode_coding_utf_8): Encode eight-bit chars as single byte.
(encode_coding_object): Fix coding->dst_pos and
coding->dst_pos_byte for the case converting a region.
2002-08-21 12:53:56 +00:00
Kenichi Handa
c6fb6e9828 (Fdefine_coding_system_internal): Fix category setting
for a coding system of type iso-2022.
2002-08-08 13:01:56 +00:00
Kenichi Handa
9d123124fb * coding.c (make_conversion_work_buffer): Adjusted for the change
of Fset_buffer_multibyte.
(encode_coding_raw_text): Increment p0 in the loop.
2002-07-31 07:09:00 +00:00
Dave Love
9542cb1fc7 Comment fix 2002-07-30 11:36:59 +00:00
Kenichi Handa
48468dac87 (Ffind_coding_systems_region_internal): Detect an
ASCII only string correctly.
2002-07-25 02:01:39 +00:00
Kenichi Handa
7c78e5423a (LEADING_CODE_PRIVATE_11, LEADING_CODE_PRIVATE_12,
LEADING_CODE_PRIVATE_21, LEADING_CODE_PRIVATE_22): Macros
deleted.  Callers changes to use
EMACS_MULE_LEADING_CODE_PRIVATE_11, etc.
(decode_coding_ccl): Add `const' to local variables.
(consume_chars): Likewise.
(Ffind_coding_systems_region_internal): Likewise.
(Fcheck_coding_systems_region): Likewise.
2002-07-22 06:40:36 +00:00
Dave Love
6f197c07d0 (adjust_coding_eol_type): Fix eol_type/eol_seen mixup. 2002-07-17 10:21:01 +00:00
Dave Love
c197f19176 (ENCODE_DESIGNATION, decode_eol)
(make_conversion_work_buffer, code_conversion_restore)
(Fdefine_coding_system_internal): Convert Lisp types.
(code_conversion_restore): Use EQ, not ==.
(Fencode_coding_string): Fix code_convert_string call.
2002-07-16 15:10:13 +00:00
Dave Love
a3f6ee6d06 (Fset_coding_system_priority): Allow null arg list. 2002-07-11 23:15:52 +00:00
Dave Love
5a936b4698 comments 2002-06-16 19:57:54 +00:00
Kenichi Handa
16eafb5da6 (encode_coding_emacs_mule): Pay attention to raw-8-bit chars.
(encode_coding_iso_2022): Likewise.
(encode_coding_sjis): Likewise.
(encode_coding_big5): Likewise.
(encode_coding_charset): Likewise.
2002-05-31 01:03:50 +00:00
Kenichi Handa
bf16eb23a0 (CODING_ISO_FLAG_USE_ROMAN): New macro
(CODING_ISO_FLAG_USE_OLDJIS): New macro.
(CODING_ISO_FLAG_FULL_SUPPORT): Macro definition changed.
(setup_iso_safe_charsets): Fix arguemtns to Fassq.
(DECODE_DESIGNATION): Pay attention to CODING_ISO_FLAG_USE_ROMAN
and CODING_ISO_FLAG_USE_OLDJIS.
(ENCODE_ISO_CHARACTER_DIMENSION1): Likewise.
(ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
(encode_coding_iso_2022): Change the 1st arg to
ENCODE_ISO_CHARACTER to a variable.
2002-05-30 11:02:01 +00:00
Dave Love
b0edb2c59c (decode_coding_utf_8): Reject overlong sequences. 2002-05-27 22:19:17 +00:00
Dave Love
1965cb73a0 (Qmac): Remove (duplicated) definition. 2002-05-26 17:11:04 +00:00
Dave Love
da7db22498 Doc fixes.
(Fcoding_system_aliases): Fix return value.
2002-05-26 17:07:35 +00:00
Dave Love
f0064e1f74 (setup_iso_safe_charsets): Fix arg decl for K&R.
(suffixes): Moved out of make_subsidiaries for K&R.
2002-05-24 15:33:29 +00:00
Kenichi Handa
f9d71dcd06 (Fdefine_coding_system_internal): Fix previous change.
(decode_coding_charset): Workaround for the bug of GCC 2.96.
2002-05-23 10:56:58 +00:00
Kenichi Handa
acb2a96517 (decode_coding_charset): Fix previous change. 2002-05-22 11:30:00 +00:00
Kenichi Handa
c7c66a958b (decode_coding_charset): Adjusted for the change of
Fdefine_coding_system_internal.
(Fdefine_coding_system_internal): For a coding system of
`charset' type, store a list of charset IDs in
`charset_attr_charset_valids' element of coding attributes.
2002-05-22 11:14:45 +00:00
Kenichi Handa
0cbbb5690d (emacs_mule_char): Fix previous change. 2002-05-21 05:09:20 +00:00
Kenichi Handa
781d7a48c4 (ONE_MORE_BYTE_NO_CHECK): Increment consumed_chars.
(emacs_mule_char): New arg src.  Delete arg `composition'.  Caller
changed.  Handle 2-byte and 3-byte charsets correctly.
(DECODE_EMACS_MULE_COMPOSITION_RULE_20): Renamed from
DECODE_EMACS_MULE_COMPOSITION_RULE.  Caller changed.
(DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro.
(DECODE_EMACS_MULE_21_COMPOSITION): Call
DECODE_EMACS_MULE_COMPOSITION_RULE_21.  Produce correct annotation
sequence.
(decode_coding_emacs_mule): Handle composition correctly.  Rewind
`src' and `consumed_chars' correctly before calling
emacs_mule_char.
(DECODE_COMPOSITION_START): Correctly handle the case of altchar
and alt&rule composition.
(decode_coding_iso_2022): Handle composition correctly.
(init_coding_once): Setup emacs_mule_bytes for private charsets.
2002-05-21 04:23:15 +00:00
Kenichi Handa
41cbe562e6 (encode_coding_iso_2022): If coding requires safe
encoding, produce a character specified by
CODING_INHIBIT_CHARACTER_SUBSTITUTION.
(encode_coding_sjis): Likewise.
(encode_coding_big5): Likewise.
(encode_coding_charset): Likewise.
2002-05-20 12:10:04 +00:00
Dave Love
1fcd6c8b99 (Vchar_coding_system_table, Qchar_coding_system):
Removed.
(Fset_coding_system_priority, Fset_coding_system_priority)
(Fdefine_coding_system_internal): Doc fix.
2002-05-17 16:25:23 +00:00
Kenichi Handa
ac87bbef3e (encode_coding_object): Give correct arguments ot
pre-write-conversion.  Ignore the return value of
pre-write-conversion function.  Pay attention for the case that
pre-write-conversion change the current buffer.  If dst_object is
Qt, even if coding->src_bytes is zero, allocate at least one byte
to coding->destination.
2002-05-14 13:03:45 +00:00
Kenichi Handa
c0cc7f7f49 (decode_coding_object): Move point to coding->dst_pos before
calling post-read-conversion function.
2002-05-14 11:47:35 +00:00
Kenichi Handa
004068e4fc (Fdecode_sjis_char): Fix typo (0x7F->0xFF). Fix the
handling of charset list.
(encode_coding_iso_2022): Setup coding->safe_charsets in advance.
2002-05-14 08:00:53 +00:00
Dave Love
5bad079652 Doc fixes.
(Fdefine_coding_system_alias): Use names, not symbols, in
coding-system-alist.
2002-05-13 17:50:19 +00:00
Kenichi Handa
15d143f758 (coding_set_source): Delete the local variable beg_byte.
(encode_coding_charset): Delete the local variable charset.
(Fdefine_coding_system_internal): Likewise.
(Fdefine_coding_system_internal): Setup
attrs[coding_attr_charset_valids] correctly.
2002-05-10 03:56:05 +00:00
Dave Love
b74e4686d5 (coding_inherit_eol_type)
(Fset_terminal_coding_system_internal)
(Fset_safe_terminal_coding_system_internal): Fix arg declarations.
2002-05-09 18:00:40 +00:00