diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/charset.c | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 77bbfef6620..61e4eed5c11 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -10,6 +10,10 @@ | |||
| 10 | 10 | ||
| 11 | 2008-05-23 Kenichi Handa <handa@m17n.org> | 11 | 2008-05-23 Kenichi Handa <handa@m17n.org> |
| 12 | 12 | ||
| 13 | * charset.c (Qemacs, charset_emacs): New variables. | ||
| 14 | (char_charset): Fix for non-Unicode characters. | ||
| 15 | (syms_of_charset): Define charset_emacs. | ||
| 16 | |||
| 13 | * w32term.c (x_draw_glyph_string): Be sure to update | 17 | * w32term.c (x_draw_glyph_string): Be sure to update |
| 14 | s->underline_thickness and s->underline_position. Be sure to draw | 18 | s->underline_thickness and s->underline_position. Be sure to draw |
| 15 | underline within the current line area. | 19 | underline within the current line area. |
diff --git a/src/charset.c b/src/charset.c index e0bddf4eebd..e5e8c56541e 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -74,12 +74,14 @@ Lisp_Object Qascii; | |||
| 74 | Lisp_Object Qeight_bit; | 74 | Lisp_Object Qeight_bit; |
| 75 | Lisp_Object Qiso_8859_1; | 75 | Lisp_Object Qiso_8859_1; |
| 76 | Lisp_Object Qunicode; | 76 | Lisp_Object Qunicode; |
| 77 | Lisp_Object Qemacs; | ||
| 77 | 78 | ||
| 78 | /* The corresponding charsets. */ | 79 | /* The corresponding charsets. */ |
| 79 | int charset_ascii; | 80 | int charset_ascii; |
| 80 | int charset_eight_bit; | 81 | int charset_eight_bit; |
| 81 | int charset_iso_8859_1; | 82 | int charset_iso_8859_1; |
| 82 | int charset_unicode; | 83 | int charset_unicode; |
| 84 | int charset_emacs; | ||
| 83 | 85 | ||
| 84 | /* The other special charsets. */ | 86 | /* The other special charsets. */ |
| 85 | int charset_jisx0201_roman; | 87 | int charset_jisx0201_roman; |
| @@ -1814,8 +1816,7 @@ char_charset (c, charset_list, code_return) | |||
| 1814 | if (NILP (charset_list)) | 1816 | if (NILP (charset_list)) |
| 1815 | charset_list = Vcharset_ordered_list; | 1817 | charset_list = Vcharset_ordered_list; |
| 1816 | 1818 | ||
| 1817 | while (CONSP (charset_list) | 1819 | while (CONSP (charset_list)) |
| 1818 | && ! EQ (charset_list, Vcharset_non_preferred_head)) | ||
| 1819 | { | 1820 | { |
| 1820 | struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (charset_list))); | 1821 | struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (charset_list))); |
| 1821 | unsigned code = ENCODE_CHAR (charset, c); | 1822 | unsigned code = ENCODE_CHAR (charset, c); |
| @@ -1827,8 +1828,11 @@ char_charset (c, charset_list, code_return) | |||
| 1827 | return charset; | 1828 | return charset; |
| 1828 | } | 1829 | } |
| 1829 | charset_list = XCDR (charset_list); | 1830 | charset_list = XCDR (charset_list); |
| 1831 | if (c <= MAX_UNICODE_CHAR | ||
| 1832 | && EQ (charset_list, Vcharset_non_preferred_head)) | ||
| 1833 | return CHARSET_FROM_ID (charset_unicode); | ||
| 1830 | } | 1834 | } |
| 1831 | return (c <= MAX_UNICODE_CHAR ? CHARSET_FROM_ID (charset_unicode) | 1835 | return (c <= MAX_5_BYTE_CHAR ? CHARSET_FROM_ID (charset_emacs) |
| 1832 | : CHARSET_FROM_ID (charset_eight_bit)); | 1836 | : CHARSET_FROM_ID (charset_eight_bit)); |
| 1833 | } | 1837 | } |
| 1834 | 1838 | ||
| @@ -2073,6 +2077,7 @@ syms_of_charset () | |||
| 2073 | 2077 | ||
| 2074 | DEFSYM (Qascii, "ascii"); | 2078 | DEFSYM (Qascii, "ascii"); |
| 2075 | DEFSYM (Qunicode, "unicode"); | 2079 | DEFSYM (Qunicode, "unicode"); |
| 2080 | DEFSYM (Qemacs, "emacs"); | ||
| 2076 | DEFSYM (Qeight_bit, "eight-bit"); | 2081 | DEFSYM (Qeight_bit, "eight-bit"); |
| 2077 | DEFSYM (Qiso_8859_1, "iso-8859-1"); | 2082 | DEFSYM (Qiso_8859_1, "iso-8859-1"); |
| 2078 | 2083 | ||
| @@ -2154,6 +2159,9 @@ the value may be a list of mnemonics. */); | |||
| 2154 | charset_unicode | 2159 | charset_unicode |
| 2155 | = define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10", | 2160 | = define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10", |
| 2156 | 0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0); | 2161 | 0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0); |
| 2162 | charset_emacs | ||
| 2163 | = define_charset_internal (Qemacs, 3, "\x00\xFF\x00\xFF\x00\x3F", | ||
| 2164 | 0, MAX_5_BYTE_CHAR, -1, 0, -1, 1, 1, 0); | ||
| 2157 | charset_eight_bit | 2165 | charset_eight_bit |
| 2158 | = define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00", | 2166 | = define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00", |
| 2159 | 128, 255, -1, 0, -1, 0, 1, | 2167 | 128, 255, -1, 0, -1, 0, 1, |