2008-05-23 Kenichi Handa <handa@m17n.org>
+ * charset.c (Qemacs, charset_emacs): New variables.
+ (char_charset): Fix for non-Unicode characters.
+ (syms_of_charset): Define charset_emacs.
+
* w32term.c (x_draw_glyph_string): Be sure to update
s->underline_thickness and s->underline_position. Be sure to draw
underline within the current line area.
Lisp_Object Qeight_bit;
Lisp_Object Qiso_8859_1;
Lisp_Object Qunicode;
+Lisp_Object Qemacs;
/* The corresponding charsets. */
int charset_ascii;
int charset_eight_bit;
int charset_iso_8859_1;
int charset_unicode;
+int charset_emacs;
/* The other special charsets. */
int charset_jisx0201_roman;
if (NILP (charset_list))
charset_list = Vcharset_ordered_list;
- while (CONSP (charset_list)
- && ! EQ (charset_list, Vcharset_non_preferred_head))
+ while (CONSP (charset_list))
{
struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
unsigned code = ENCODE_CHAR (charset, c);
return charset;
}
charset_list = XCDR (charset_list);
+ if (c <= MAX_UNICODE_CHAR
+ && EQ (charset_list, Vcharset_non_preferred_head))
+ return CHARSET_FROM_ID (charset_unicode);
}
- return (c <= MAX_UNICODE_CHAR ? CHARSET_FROM_ID (charset_unicode)
+ return (c <= MAX_5_BYTE_CHAR ? CHARSET_FROM_ID (charset_emacs)
: CHARSET_FROM_ID (charset_eight_bit));
}
DEFSYM (Qascii, "ascii");
DEFSYM (Qunicode, "unicode");
+ DEFSYM (Qemacs, "emacs");
DEFSYM (Qeight_bit, "eight-bit");
DEFSYM (Qiso_8859_1, "iso-8859-1");
charset_unicode
= define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10",
0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0);
+ charset_emacs
+ = define_charset_internal (Qemacs, 3, "\x00\xFF\x00\xFF\x00\x3F",
+ 0, MAX_5_BYTE_CHAR, -1, 0, -1, 1, 1, 0);
charset_eight_bit
= define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00",
128, 255, -1, 0, -1, 0, 1,