Commit graph

292 commits

Author SHA1 Message Date
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
Andreas Schwab
68e3a8f141 (code_convert_region): Call adjust_after_insert also
in unibyte mode.
1998-04-14 10:21:04 +00:00
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