diff options
| author | Kenichi Handa <handa@m17n.org> | 2003-04-08 11:27:28 +0000 |
|---|---|---|
| committer | Kenichi Handa <handa@m17n.org> | 2003-04-08 11:27:28 +0000 |
| commit | 7de6cd0aee512d54a8758a632afa0bd7ea97fcc0 (patch) | |
| tree | f3b5bef34dd0cb08c08fdb84f6aa03e352220ecb /src/coding.c | |
| parent | 24a948a7819c2a8132569eee53ad6a3cd15a6d9e (diff) | |
(coding_system_accept_latin_extra_p): New function.
(find_safe_codings): Pay attention to characters registered in
latin-extra-code-table.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 85072d63b8f..9d1298ffff2 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6397,6 +6397,26 @@ highest priority. */) STRING_MULTIBYTE (string)); } +static int coding_system_accept_latin_extra_p P_ ((Lisp_Object)); + +static int +coding_system_accept_latin_extra_p (coding_system) + Lisp_Object coding_system; +{ + Lisp_Object coding_spec, coding_type, flags; + + coding_spec = Fget (coding_system, Qcoding_system); + if (! VECTORP (coding_spec) + || ASIZE (coding_spec) != 5) + return 0; + coding_type = AREF (coding_spec, 0); + if (! EQ (coding_type, make_number (2))) + return 0; + flags = AREF (coding_spec, 4); + return (VECTORP (flags) + && ! NILP (AREF (flags, CODING_FLAG_ISO_LATIN_EXTRA))); +} + /* Subroutine for Fsafe_coding_systems_region_internal. Return a list of coding systems that safely encode the multibyte @@ -6444,7 +6464,11 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found) for (prev = tail = safe_codings; CONSP (tail); tail = XCDR (tail)) { val = XCAR (tail); - if (NILP (Faref (XCDR (val), ch))) + if (NILP (Faref (XCDR (val), ch)) + && !(SINGLE_BYTE_CHAR_P (c) + && VECTORP (Vlatin_extra_code_table) + && ! NILP (AREF (Vlatin_extra_code_table, c)) + && coding_system_accept_latin_extra_p (XCAR (val)))) { /* Exclued this coding system from SAFE_CODINGS. */ if (EQ (tail, safe_codings)) |
