Commit graph

273 commits

Author SHA1 Message Date
Kenichi Handa
f30cc6122e (code_convert_string): Give decode_coding correct byte
length of source text.
1998-04-14 01:06:44 +00:00
Kenichi Handa
704c57813e (CHARSET_OK): Don't reject safe charsets.
(DECODE_DESIGNATION): Likewise.
(check_composing_code): Likewise.
1998-04-02 00:25:47 +00:00
Kenichi Handa
12410ef100 (code_convert_region): Handle skipped ASCII characters
at the head and tail of conversion region correctly when adjusting
position keepers.  Call adjust_after_insert to record undo info
and adjust markers when we don't have to change byte sequence of
a buffer.
1998-03-30 06:00:54 +00:00
Richard M. Stallman
f5f9a3da6b (code_convert_region): Call adjust_before_replace
in the no-conversion case.  Adjust GPT, ZV and Z in chars.
1998-03-28 21:55:22 +00:00
Kenichi Handa
de9d083c5d (shrink_decoding_region): If EOL_CONVERSION is nonzero,
don't skip `\r' (instead of `\n').
1998-03-24 05:41:38 +00:00
Richard M. Stallman
bbdf84bda7 (code_convert_string): Use make_string_from_bytes. 1998-03-21 17:59:48 +00:00
Richard M. Stallman
fc932ac6c7 Use STRING_BYTES and SET_STRING_BYTES. 1998-03-21 07:06:14 +00:00
Kenichi Handa
6e44253b80 (code_convert_region): The 6th arg name is changed to
REPLACE.  Even if there's no need of code conversion, call
adjust_after_replace to handle bytes combining.
1998-03-16 05:51:07 +00:00
Kenichi Handa
2b4f9037e3 (code_convert_region): Adjusted for the change of
adjust_after_replace.
1998-03-12 00:44:06 +00:00
Richard M. Stallman
7553d0e19c (code_convert_region): Fix previous change. Adjusted
for the change of adjust_after_replace (see insdel.c change above).
1998-03-10 21:14:08 +00:00
Kenichi Handa
7cf8c582dd (code_convert_region): Fix previous change. 1998-03-04 08:05:14 +00:00
Kenichi Handa
4b5ce59134 (code_convert_region): Handle the case that codes
0240..0377 are generated just after a multibyte character.
1998-03-04 07:41:41 +00:00
Karl Heuer
ddbc19ff25 Reorder args in callers of del_range_2. 1998-02-27 22:09:52 +00:00
Kenichi Handa
fb88bf2d25 (decode_coding_iso2022): Update coding->fake_multibyte.
(ENCODE_SINGLE_SHIFT_2, ENCODE_SINGLE_SHIFT_3,
encode_coding_iso2022, decode_coding_sjis_big5,
encode_coding_sjis_big5, decode_eol, encode_eol, decode_coding,
encode_coding): Likewise.
(shrink_decoding_region, shrink_encoding_region): Do not skip
non-ASCII code in any cases.  Bug fix for getting starting address
from BEG.
(code_convert_region): Sync character positions correctly by
paying attention to coding->fake_multibyte.
(code_convert_string): Set number of character and bytes just
processed in members of CODING.
(code_convert_string): Adjusted for the change of
code_convert_region.
(code_convert_region1): Likewise.
1998-02-20 01:40:47 +00:00
Kenichi Handa
4031e2bf0a (ENCODE_ISO_CHARACTER): Pay attention to
CODING_FLAG_ISO_USE_ROMAN and CODING_FLAG_ISO_USE_OLDJIS.
(code_convert_region1): New function.
(Fdecode_coding_region): Call code_convert_region1.
(Fencode_coding_region): Likewise.
(code_convert_string1): New function.
(Fdecode_coding_string): Call code_convert_string1.
(Fencode_coding_string): Likewise.
/
1998-01-30 11:05:41 +00:00
Kenichi Handa
8cbbac75ae (DECODE_SJIS_BIG5_CHARACTER): Don't have to increase
coding->produced_char here.
(code_convert_region): Initialize LEN_BYTE correctly.
1998-01-28 12:37:25 +00:00
Kenichi Handa
d46c5b1251 Vselect_safe_coding_system_function): New variable.
(coding_category_table): This variable deleted.
(Vcoding_category_table): New variable.
(coding_category_name): Add "coding-category-iso-7-tight".
(detect_coding_iso2022): Check the mask
CODING_FLAG_ISO_DESIGNATION in CODING->FLAGS.  Check a new coding
category coding-category-iso-7-tight.
(DECODE_DESIGNATION): Decode only such designations that CODING
can handle.
(check_composing_code): New function.
(decode_coding_iso2022): Decode only such characters that CODING
can handle.
(encode_coding_iso2022): Before and after encoding composite
characters, reset designation and invocation status.
(detect_coding_sjis): Delete unnecessary check.
(detect_coding_big5): Likewise.
(encode_designation_at_bol): Check the validity of requested
designation register.
(setup_coding_system): Set requested designation registers for
non-supported charsets to
CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION.  Set mask
CODING_FLAG_ISO_DESIGNATION in CODING->FLAGS.  Code tuned for
no-conversion and undecided.
(detect_coding): Adjusted for the new variable
Vcoding_category_table.
(syms_of_coding): Initialize Vcoding_category_table and staticpro
it.  Register select-safe-coding-system as a Lisp variable.

(DECODE_CHARACTER_ASCII): Update coding->produced_char;
(DECODE_CHARACTER_DIMENSION1): Likewise.
(Qraw_text, Qcoding_category): New variables.
(syms_of_coding): Intern and staticpro them.
(coding_system_table): New variable.
(CHARSET_OK, SHIFT_OUT_OK): New macros.
(detect_coding_iso2022): Detection algorithm improved.
(decode_coding_iso2022): Arg CONSUMED deleted, and the meaning of
return value changed.  Update members produced, produced_char,
consumed, consumed_char of the struct *coding.  Pay attention to
CODING_MODE_INHIBIT_INCONSISTENT_EOL.
(encode_coding_iso2022): Likewise.
(decode_coding_sjis_big5, encode_coding_sjis_big5): Likewise.
(decode_eol, encode_eol): Likewise.
(ENCODE_ISO_CHARACTER): Update coding->consumed_char.
(DECODE_SJIS_BIG5_CHARACTER): Update coding->produced_char.
(ENCODE_SJIS_BIG5_CHARACTER): Update coding->consumed_char.
(detect_coding(detect_coding(detect_ITIES and SKIP.
(detect_coding): Adjusted for the change of detect_coding_mask.
Update coding->heading_ascii.
(detect_eol_type): New arg SKIP.
(detect_eol): Adjusted for the change of detect_eol_type.
(ccl_codign_driver): New function.
(decode_coding): Arg CONSUMED deleted, and the meaning of return
value changed.  Update members produced, produced_char, consumed,
consumed_char of the struct *coding.
(encode_coding): Likewise.
(shrink_decoding_region, shrink_encoding_region): New function.
(code_convert_region, code_convert_string): Completely rewritten.
(detect_coding_sy(detect_coding_sy(detect_coding_sy(detect_coding_sy(detect_codiT.
(Fdetect_coding_string): New function.
(Fdecode_coding_region, Fencode_coding_region): Adjusted for the
change of code_convert_region.
(Fdecode_coding_string, Fencode_coding_string): Adjusted for the
change of code_convert_string.
(Fupdate_iso_coding_systems): New function.
(init_coding_once): Initialize coding_system_table.
1998-01-22 01:26:45 +00:00
Richard M. Stallman
4a2f9c6aef Update copyright year. 1998-01-21 23:32:12 +00:00
Richard M. Stallman
3a73fa5d33 (code_convert_region): Always count chars inserted
in accord with value of enable-multilibyte-characters.
(Fcoding_system_p): Doc fix.
(Fcheck_coding_system): Doc fix.
(Fterminal_coding_system): Doc fix.
(Fkeyboard_coding_system): Doc fix.
1998-01-19 19:45:53 +00:00
Karl Heuer
c52d78d521 (code_convert_region): Delete duplicate local `zv_before'. 1998-01-18 04:43:08 +00:00
Richard M. Stallman
5f1cd180aa (code_convert_string): Maybe use make_unibyte_string. 1998-01-09 23:05:12 +00:00
Richard M. Stallman
6289dd10a0 (code_convert_region): Handle bytepos and charpos.
(Fdetect_coding_region): Likewise.
1998-01-01 07:05:26 +00:00
Kenichi Handa
774324d66c (setup_coding_system): Do not set
Vlast_coding_system_used here.
(decode_coding_sjis_big5): Decode Big5 text of CR only end-of-line
correctly.
1997-12-09 04:12:03 +00:00
Kenichi Handa
c952af2245 (setup_coding_system): Initialize common_flags member
instead of require_flushing member of `*coding'.
(code_convert_region): Fix previous change.
1997-11-08 03:05:44 +00:00
Kenichi Handa
70c222451e (encode_designation_at_bol): Fix bug of finding graphic
registers which should be designated at bol.
(Qsafe_charset): New variable.
(syms_of_coding): Initialize and staticpro it.
(detect_coding_iso2022): Handle SS2 and SS3 correctly.
(DECODE_ISO_CHARACTER): Recover from incorrect encoding in less
dangerous way.
(ENCODE_DESIGNATION): Get charset revision number by
CODING_SPEC_ISO_REVISION_NUMBER.
(setup_coding_system): Initialize the member safe_charsets from
the coding systems's safe-charsets property.  Initialize the
member charset_revision_number of struct iso2022_spec.
(ENCODE_ISO_CHARACTER_DIMENSION1): Adjusted for the change of
`safe_charsets' member.
(ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
(code_convert_region): Restore the current point after calling a
function in coding->post_read_conversion.
1997-10-23 12:01:50 +00:00
Kenichi Handa
4608c386ff (Qcoding_system_spec): Deleted.
(Vcoding_system_list, Vcoding_system_alist): New variables.
(setup_coding_system): Adjusted for the change in mule.el.
(detect_eol): Likewise.
(Fcoding_system_spec): Changed to Lisp function in mule.el.
(Fcoding_system_p): Do not call Fcoding_system_spec.
(Fread_coding_system): Give Vcoding_system_alist to
Fcompleting_read as the arg TABLE.
(Fread_non_nil_coding_system): Likewise.  Give
Vcoding_system_history to Fcompleting_read as the arg HIST.
(syms_of_coding): Deleted codes for Qcoding_system and
Fcoding_system_spec.  Set up new Lisp variables.
1997-10-21 10:43:40 +00:00
Richard M. Stallman
35cb86869d (encode_designation_at_bol): Fix type of local vars C1, C2. 1997-09-09 00:46:00 +00:00
Richard M. Stallman
fe487a7128 (Fencode_coding_string, Fdecode_coding_string): Doc fixes. 1997-09-08 10:00:48 +00:00
Kenichi Handa
b19fd4c592 (Ffind_operation_coding_system): If a function in
XXX-coding-system-alist returns a coding system (instead of cons
of coding systems), return cons of it.
1997-09-05 08:07:44 +00:00
Richard M. Stallman
9b787f3ead (Fread_coding_system): New optional arg DEFAULT_CODING_SYSTEM. 1997-09-05 05:38:21 +00:00
Richard M. Stallman
bb0115a22e (Qcoding_system_history): New variable.
(syms_of_coding): Initialize it.
(Fread_coding_system): Use Qcoding_system_history.
1997-09-04 05:58:20 +00:00
Richard M. Stallman
f44d27ceec (setup_coding_system, Ffind_operation_coding_system)
(Fdetect_coding_region, Fread_coding_system):
Don't initialize a Lisp_Object.
1997-09-04 04:55:52 +00:00
Richard M. Stallman
1b2af4b0ba (detect_coding_mask): Re-work previous change.
(detect_eol): Fix use of == instead of -.
1997-09-04 03:31:10 +00:00
Richard M. Stallman
5d648571be (detect_coding_mask): Add in CODING_CATEGORY_MASK_RAW_TEXT
in the detect_coding_iso2022 case.
1997-09-02 20:56:02 +00:00
Kenichi Handa
992f23f203 (detect_eol): Do not select no-conversion even if EOL
format of raw-text file is inconsistent.  Just read it by
raw-text-unix.
(Fdetect_coding_region): Do not select no-conversion even if EOL
format of raw-text file is inconsistent.
1997-08-28 10:54:13 +00:00
Kenichi Handa
27901516b6 (Qno_conversion, Qundecided): New variables.
(syms_of_coding): Initialize and staticpro them.
(coding_category_name): Include "coding-category-raw-test".
(setup_coding_system): Handle coding_type_raw_text.
(detect_coding_mask): Include CODING_CATEGORY_MASK_RAW_TEXT in the
return value instead of CODING_CATEGORY_MASK_BINARY.
(detect_coding): Do not check the case that `mask' is 0, which
never happens now.
(detect_eol_type): If EOL format is inconsistent, return
CODING_EOL_INCONSISTENT.
(detect_eol): If EOL format of raw-text file is inconsistent,
detect it as no-conversion.
(decode_coding): Handle coding_type_raw_text.
(encode_coding): Likewise.
(Fdetect_coding_region): Ajusted for the above changes.
(shrink_conversion_area): Handle coding_type_raw_text.
1997-08-28 10:51:12 +00:00
Kenichi Handa
61e011d971 (Fread_non_nil_coding_system): Supply the arg
INHERIT-INPUT-METHOD to Fcompleting_read.
(Fread_coding_system): Likewise.
1997-08-26 11:42:33 +00:00
Kenichi Handa
fb3903d3c2 (detect_eol): If the coding system an alias, get
eol-type from the base of it.
1997-08-22 03:33:51 +00:00
Kenichi Handa
3f0039811c (CODING_FLAG_ISO_LATIN_EXTRA): New macro. 1997-08-16 01:54:37 +00:00
Kenichi Handa
6e85d753e7 (Fset_terminal_coding_system_internal): Set
CODING_FLAG_ISO_SAFE in terminal_coding.flags.
(ENCODE_ISO_CHARACTER_DIMENSION1): Check
CODING_SPEC_ISO_EXPECTED_CHARSETS.
(ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
1997-08-10 05:54:48 +00:00
Kenichi Handa
c482535825 (ENCODE_ISO_CHARACTER_DIMENSION1): Pay attention to
CODING_FLAG_ISO_SAFE.
(ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
(safe_terminal_coding): New variable.
(Fset_safe_terminal_coding_system_internal): New function.
(init_coding_once): Initilize safe_terminal_coding.
(syms_of_coding): Declare set-safe-terminal-coding-system as a
Lisp function.
(Vmicrosoft_code_table): New variable.
(syms_of_coding): Declare it as a Lisp variable and initialize it.
(detect_coding_mask): Pay attention to Vmicrosoft_code_table.
1997-08-10 04:13:19 +00:00
Richard M. Stallman
2ebb362dc5 (syms_of_coding): Doc syntax fixes. 1997-08-06 18:54:05 +00:00
Kenichi Handa
85a02ca454 (detect_eol_type): Fix previous change. 1997-08-06 01:09:16 +00:00
Richard M. Stallman
bc4bc72a9a (detect_eol_type): If EOL representation does not
seem consistent, use no conversion.
1997-08-05 18:19:33 +00:00
Kenichi Handa
bf9cdd4e0c (detect_coding_iso2022): Do not exclude posibility of
7-bit encoding when designation to G1 occurs.  If CSI, SS2, or SS3
is found, return CODING_CATEGORY_MASK_ISO_8_ELSE.
(Fdetect_coding_region): Doc-string modified.
1997-08-04 06:59:57 +00:00
Richard M. Stallman
10bff6f19d (detect_coding_mask): Include CODING_CATEGORY_MASK_BINARY in the
return value if any 8-bit code is found.

Doc fix.
1997-08-04 03:01:57 +00:00
Kenichi Handa
76376439f3 (encode_coding_iso2022): When source data ends not at
character boundardy, set data in coding->carryover correctly, and
set SRC to SRC_END.
(encode_coding_sjis_big5): Likewise.
(encode_coding): Don't set coding->carryover_size to 0.
1997-08-01 01:36:20 +00:00
Kenichi Handa
19a8d9e0f8 (encode_coding_iso2022): Write out invalid multibyte
forms in a buffer as is.
(detect_coding_mask): If ISO_CODE_CSI appears in an invalid
sequence, ignore it.
1997-07-31 05:55:12 +00:00
Richard M. Stallman
a67a9c6694 (syms_of_coding): Doc fix. 1997-07-22 20:40:29 +00:00
Richard M. Stallman
465edc86d1 (Ffind_operation_coding_system): Use Ffboundp to
check for a function entry.
1997-07-18 22:55:49 +00:00