# HG changeset patch # User Kenichi Handa # Date 1233712359 0 # Node ID 11ba351ce12bd0398086e6ba08ee19f7b69e7e72 # Parent 250ce1fa6aed55ff766c2040d195da047f75b4cc (coding_system_charset_list): New function. diff -r 250ce1fa6aed -r 11ba351ce12b src/coding.c --- a/src/coding.c Wed Feb 04 01:48:37 2009 +0000 +++ b/src/coding.c Wed Feb 04 01:52:39 2009 +0000 @@ -5595,6 +5595,39 @@ } +/* Return a list of charsets supported by CODING-SYSTEM. */ + +Lisp_Object +coding_system_charset_list (coding_system) + Lisp_Object coding_system; +{ + int id; + Lisp_Object attrs, charset_list; + + CHECK_CODING_SYSTEM_GET_ID (coding_system, id); + attrs = CODING_ID_ATTRS (id); + + if (EQ (CODING_ATTR_TYPE (attrs), Qiso_2022)) + { + int flags = XINT (AREF (attrs, coding_attr_iso_flags)); + + if (flags & CODING_ISO_FLAG_FULL_SUPPORT) + charset_list = Viso_2022_charset_list; + else + charset_list = CODING_ATTR_CHARSET_LIST (attrs); + } + else if (EQ (CODING_ATTR_TYPE (attrs), Qemacs_mule)) + { + charset_list = Vemacs_mule_charset_list; + } + else + { + charset_list = CODING_ATTR_CHARSET_LIST (attrs); + } + return charset_list; +} + + /* Return raw-text or one of its subsidiaries that has the same eol_type as CODING-SYSTEM. */