/* List of charsets ordered by the priority. */
Lisp_Object Vcharset_ordered_list;
+/* Sub-list of Vcharset_ordered_list that contains all non-preferred
+ charsets. */
+Lisp_Object Vcharset_non_preferred_head;
+
/* Incremented everytime we change Vcharset_ordered_list. This is
unsigned short so that it fits in Lisp_Int and never matches
-1. */
Lisp_Object Vchar_unified_charset_table;
+Lisp_Object Vcurrent_iso639_language;
+
/* Defined in chartab.c */
extern void
map_char_table_for_charset P_ ((void (*c_function) (Lisp_Object, Lisp_Object),
if (NILP (charset_list))
charset_list = Vcharset_ordered_list;
- while (CONSP (charset_list))
+ while (CONSP (charset_list)
+ && ! EQ (charset_list, Vcharset_non_preferred_head))
{
struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
unsigned code = ENCODE_CHAR (charset, c);
}
charset_list = XCDR (charset_list);
}
- return NULL;
+ return (c <= MAX_UNICODE_CHAR ? CHARSET_FROM_ID (charset_unicode)
+ : CHARSET_FROM_ID (charset_eight_bit));
}
}
}
arglist[0] = Fnreverse (new_head);
- arglist[1] = old_list;
+ arglist[1] = Vcharset_non_preferred_head = old_list;
Vcharset_ordered_list = Fnconc (2, arglist);
charset_ordered_list_tick++;
doc: /* List of all charsets ever defined. */);
Vcharset_list = Qnil;
+ DEFVAR_LISP ("current-iso639-language", &Vcurrent_iso639_language,
+ doc: /* ISO639 language mnemonic symbol for the current language environment.
+If the current language environment is for multiple languages (e.g. "Latin-1"),
+the value may be a list of mnemonics. */);
+ Vcurrent_iso639_language = Qnil;
+
charset_ascii
= define_charset_internal (Qascii, 1, "\x00\x7F\x00\x00\x00\x00",
0, 127, 'B', -1, 0, 1, 0, 0);