From e9f91eced18281955dac85f38fb432577bd49742 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 4 Feb 2009 01:52:39 +0000 Subject: [PATCH] (coding_system_charset_list): New function. --- src/coding.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/coding.c b/src/coding.c index 38cb360546..d35ece7f27 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5595,6 +5595,39 @@ coding_charset_list (coding) } +/* 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. */ -- 2.20.1