Commit graph

324 commits

Author SHA1 Message Date
Kenichi Handa
0007bdd098 (code_convert_region): Kill the work buffer created by
pre-write-conversion.
1998-10-26 08:00:11 +00:00
Kenichi Handa
6abb9bd967 (code_convert_region): While preserving the orignal
point, pay attention to the byte combining problem.
1998-10-24 01:17:09 +00:00
Kenichi Handa
e133c8fabc (setup_coding_system): Fix setting up
coding->spec.ccl.valid_codes for CCL based coding system.
(code_convert_region): Set point to FROM before inserting the
result of pre-write-funciton.  Preserve original point.
(code_convert_string): If coding->type is coding_type_ccl, do
conversion even if the length of conversion region is zero.
1998-10-21 11:50:56 +00:00
Kenichi Handa
174a4cbee1 (decode_coding_iso2022): Set coding->fake_multibyte to
1 when encountered with a code of the range 0x80..0x9F.
1998-10-17 01:58:01 +00:00
Kenichi Handa
622fece532 (shrink_decoding_region): If a charset other than ascii
is initially designated to G0, don't shrink the region.
(shrink_encoding_region): Likewise.
1998-10-12 12:00:44 +00:00
Kenichi Handa
55d8d76935 (code_convert_region): Set inhibit_modification_hooks
to 1 before calling Fset_text_properties.
1998-10-08 06:48:42 +00:00
Kenichi Handa
88993dfd4e (check_composing_code): Fix previous change. Now it
alwasy returns 0 or -1.
(decode_coding_iso2022): Adjusted for the above change.
(encode_coding_iso2022): When encoding the last block, flush out
tailing garbage bytes.
(setup_coding_system): Delete unnecessary code.
(shrink_decoding_region): Check translation table.  If ASCII
should be translated, give up shrinking.
(shrink_encoding_region): Likewise.
(SHRINK_CONVERSION_REGION_THRESHHOLD): New macro.
(SHRINK_CONVERSION_REGION): New macro.
(code_convert_region): Call SHRINK_CONVERSION_REGION.  Delete text
properties here.
(code_convert_region): In the case of encoding, always calulate
correct character number.
(code_convert_string): Call SHRINK_CONVERSION_REGION.
(code_convert_region1): Don't delete text properties here.
(check_composing_code): Fix previous change.  Now it
alwasy returns 0 or -1.
(decode_coding_iso2022): Adjusted for the above change.
(encode_coding_iso2022): When encoding the last block, flush out
tailing garbage bytes.
(setup_coding_system): Delete unnecessary code.
(shrink_decoding_region): Check translation table.  If ASCII
should be translated, give up shrinking.
(shrink_encoding_region): Likewise.
(SHRINK_CONVERSION_REGION_THRESHHOLD): New macro.
(SHRINK_CONVERSION_REGION): New macro.
(code_convert_region): Call SHRINK_CONVERSION_REGION.  Delete text
properties here.
(code_convert_region): In the case of encoding, always calulate
correct character number.
(code_convert_string): Call SHRINK_CONVERSION_REGION.
(code_convert_region1): Don't delete text properties here.
1998-09-28 11:52:53 +00:00
Kenichi Handa
de79a6a5ed (check_composing_code): If the current composing
sequence doesn't end properly, return -1.
(DECODE_CHARACTER_ASCII): Update coding->composed_chars.
(DECODE_CHARACTER_DIMENSION1): Likewise.
(decode_coding_iso2022): Check validity of a composing sequence.
(code_convert_string): If the length of text to be converted is
shrunk to zero, don't perform code conversion.
(shrink_decoding_region): Fix previous change.
1998-09-26 04:20:48 +00:00
Kenichi Handa
fdfcf19d01 (decode_eol): While decoding DOS-like eol, handle a
single CR code correctly.
(shrink_decoding_region) <CODING_CATEGORY_IDX_ISO_7 or
CODING_CATEGORY_IDX_ISO_7_TIGHT>: Skip also 8-bit codes.
1998-09-25 07:32:05 +00:00
Kenichi Handa
9864ebcee4 (ccl_coding_driver): If ccl_driver is interrupted by a
user or the CCL program executed an invalid command, return
CODING_FINISH_INTERRUPT.
(code_convert_region): Pay attention to the converters return
value CODING_FINISH_NORMAL and CODING_FINISH_INTERRUPT.
1998-09-18 13:10:40 +00:00
Kenichi Handa
f2558efddd (code_convert_region): Update beg_unchanged and
end_unchanged after we delete the source text.
1998-09-16 07:21:31 +00:00
Kenichi Handa
69f7652519 (ccl_coding_driver): Always calculate correct mulibyte
chars in produced byte sequence.
(Ffind_operation_coding_system): Doc-string fixed.
1998-09-07 13:39:15 +00:00
Kenichi Handa
d4e57bcd5b (decode_coding): Even if SRC_BYTES is zero, try
processing if CODING requires flushing.
(encode_coding): Likewise.
(code_convert_region): Likewise.
(code_convert_string): Likewise.
1998-08-31 03:50:17 +00:00
Kenichi Handa
df2ddb2d28 (code_convert_region1): Remove all text properties of the region. 1998-08-28 12:33:52 +00:00
Kenichi Handa
ae9ff118cb (detect_coding_iso2022): Handle ESC N and ESC O
correctly.  They are for SS2 and SS3 respectively.
(ccl_coding_driver): Fix previous change.
1998-08-27 07:47:15 +00:00
Andreas Schwab
a85a871a33 (file-coding-system-alist, select-safe-coding-system-function): Doc fix. 1998-08-24 10:05:10 +00:00
Kenichi Handa
f46869e46f (detect_coding_iso2022): Don't check the byte length of
succeeding codes (0xa0..0xFF) if the codes follows single shit
code.
1998-08-24 06:42:56 +00:00
Kenichi Handa
25b026986f (detect_coding_system): If detect_eol_type returns
CODING_EOL_INCONSISTENT, set eol_type to CODING_EOL_UNDECIDED
correctly.
1998-08-21 06:34:13 +00:00
Kenichi Handa
7b179c2dc2 (ccl_coding_driver): Setup ccl->last_block properly.
(setup_coding_system): Correctly setup `valid_codes' member.
1998-08-18 13:15:18 +00:00
Kenichi Handa
89fa8b3669 (coding_category_name): Fix the order of initial
contents.
(detect_coding_mask): Fix previous change.
1998-08-15 01:28:14 +00:00
Kenichi Handa
6bc51348fd (default_buffer_file_coding): New variable.
(init_coding_once): Initialize default_buffer_file_coding.
1998-08-10 06:29:02 +00:00
Richard M. Stallman
f024b6aac0 (CHARSET_OK): Check that coding_system_table[IDX] != 0. 1998-08-09 05:28:02 +00:00
Richard M. Stallman
84d602979c Avoid using initializers for Lisp_Object. 1998-08-08 21:32:57 +00:00
Kenichi Handa
1397dc18d5 (Qvalid_codes): New variable.
(coding_category_name): Include "coding-category-ccl".
(detect_coding_ccl): New function.
(setup_coding_system): Setup coding->spec.ccl.valid_codes from the
coding system priority `valid-codes' for CCL based coding systesm.
(detect_coding_mask): Check also a CCL based coding system.
(Fupdate_coding_systems_internal): Renamed from
Fupdate_iso_coding_systems.
(syms_of_coding): Change property char-table-extra-slot of
translation-table to 1.  Initialize and static pro Qvalid_codes.
1998-08-02 01:06:57 +00:00
Kenichi Handa
eda284acb2 (syms_of_coding): Mention auto-coding-alist in the
docstring of file-coding-system-alist.
1998-07-25 04:23:13 +00:00
Kenichi Handa
6d74c3aa20 (init_coding): New function.
(init_coding_once): Don't initialize conversion_buffer here.  It
is done in init_coding.
1998-07-21 01:42:40 +00:00
Kenichi Handa
826bfb8b08 (code_convert_string): Count characters again if we
encounter some invalid code while decoding.
1998-07-09 04:33:00 +00:00
Kenichi Handa
85bbb1345a (DECODE_ISO_CHARACTER): While decoding two-byte code,
if the sencond byte is invalid, produce the first byte as is.
1998-07-09 02:02:33 +00:00
Kenichi Handa
54f7817141 (setup_raw_text_coding_system): New function.
(decode_coding_sjis_big5): Bug for handling invalid code fixed.
1998-06-26 03:29:15 +00:00
Karl Heuer
94487c4e37 Doc fixes. 1998-06-20 22:06:30 +00:00
Richard M. Stallman
993824c9b3 (encode_eol): Fix typo that prevented converting to Mac
line endings.  Always update dst_bytes to number of bytes actually copied.
(decode_eol): Fix value of coding->produced when decoding Unix
line endings (in case this function is ever used for that).
1998-06-16 04:50:57 +00:00
Kenichi Handa
80e803b4e7 (detect_coding_system): Always return a list of HIGHEST is zero.
(Fdetect_coding_region): Doc-string adjusted for the above change.
(Fdetect_coding_string): Likewise.
1998-06-13 01:41:23 +00:00
Karl Heuer
ecec61c199 (code_convert_string_norecord): New function.
Does encoding or decoding but doesn't set Vlast_coding_system_used.
1998-06-03 14:41:07 +00:00
Kenichi Handa
8a8147d64b (detect_coding_mask): Initilize local variable C. 1998-06-02 03:54:18 +00:00
Richard M. Stallman
65059037ab (detect_coding_system): Treat CODING_EOL_INCONSISTENT
like CODING_EOL_UNDECIDED.
1998-05-26 20:46:31 +00:00
Kenichi Handa
66cfb53089 (ascii_skip_code): New variable.
(detect_coding_mask): Skip ASCII codes at the head according to
ascii_skip_code.
(coding_priorities): New variable.
(Fset_coding_priority_internal): New function.
(detect_coding): Call set_coding_mask with coding_priorities as
arg CODING.
(init_coding_once): Initialize ascii_skip_code.
(syms_of_coding): Declare set-coding-priority-internal as a Lisp
function.
1998-05-25 08:08:07 +00:00
Kenichi Handa
f967223b11 Change term "character translation table" to "translation table". 1998-05-22 09:45:34 +00:00
Kenichi Handa
aa60dea617 (shrink_decoding_region): No short cut by
coding->heading_ascii if eol conversion is necessary.
1998-05-21 01:48:52 +00:00
Kenichi Handa
84fbb8a002 Change terms unify/unification to
translate/translation respectively throughtout the file.
(encode_coding_iso2022): Fix bug in encoding a text ending by a
composite character.
(check_composing_code): If we are decoding the last block of data,
return 0 even if the source doesn't end by an escape sequence
which terminates the current composing sequence.
(decode_coding_iso2022): Decode correctly even if the source
doesn't end by an escape sequence which terminates the current
composing sequence.
1998-05-18 00:59:38 +00:00
Richard M. Stallman
f072a3e84c (code_convert_region1): Set Vlast_coding_system_used.
(code_convert_string1): Likewise.
(Fdecode_coding_region, Fencode_coding_region): Doc fixes.
(Fdecode_coding_string, Fencode_coding_string): Doc fixes.
1998-05-10 21:52:08 +00:00
Richard M. Stallman
5ab13dd02e (detect_coding_mask): Check also coding-category-binary. 1998-05-09 21:47:17 +00:00
Richard M. Stallman
38cf95df42 (encode_coding_iso2022): Don't skip a code following some invalid code. 1998-05-04 22:33:38 +00:00
Kenichi Handa
49cb52b45c (encode_coding_iso2022): If encoding a last block,
reset graphic planes and registers.
1998-05-01 04:15:48 +00:00
Andreas Schwab
f82423d721 (setup_coding_system): Properly check for nil. 1998-04-29 09:33:53 +00:00
Richard M. Stallman
ee59c65fd0 (shrink_decoding_region): Do not consider LF as ascii
if preceded by CR, since that confuses eol decoding.
(code_convert_region): When conversion fails with
CODING_FINISH_INSUFFICIENT_SRC, was overwriting src with garbage
from dst instead of copying from src to dst.
1998-04-24 01:05:25 +00:00
Kenichi Handa
d21ca14d48 (setup_coding_system): For a type 4 coding system,
FLAGS member of coding spec is a cons of CCL program symbols.
1998-04-20 02:14:57 +00:00
Kenichi Handa
83fa074f8d (code_convert_region): If point in the conversion
region, move it to FROM in advance.
1998-04-15 23:49:52 +00:00
Eli Zaretskii
ed29121d27 (syms_of_coding): Declare and define inherit-process-coding-system. 1998-04-15 15:52:41 +00:00
Andreas Schwab
b39f748c48 (code_convert_region): Fix mixing of Lisp_Object and
int.
1998-04-14 12:55:11 +00:00
Andreas Schwab
dfcf069d56 Fix -Wimplicit warnings. 1998-04-14 12:25:56 +00:00