Mercurial > emacs
comparison src/coding.c @ 89429:3c978149859b
(Fdefine_coding_system_internal): Fix for the case that
coding_type is Qcharset.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Tue, 20 May 2003 13:05:14 +0000 |
| parents | c3e67ce6ee0f |
| children | 7349f4473e7f |
comparison
equal
deleted
inserted
replaced
| 89428:eed327e0bad3 | 89429:3c978149859b |
|---|---|
| 7833 CHECK_LIST (val); | 7833 CHECK_LIST (val); |
| 7834 CODING_ATTR_PLIST (attrs) = val; | 7834 CODING_ATTR_PLIST (attrs) = val; |
| 7835 | 7835 |
| 7836 if (EQ (coding_type, Qcharset)) | 7836 if (EQ (coding_type, Qcharset)) |
| 7837 { | 7837 { |
| 7838 Lisp_Object list; | |
| 7838 /* Generate a lisp vector of 256 elements. Each element is nil, | 7839 /* Generate a lisp vector of 256 elements. Each element is nil, |
| 7839 integer, or a list of charset IDs. | 7840 integer, or a list of charset IDs. |
| 7840 | 7841 |
| 7841 If Nth element is nil, the byte code N is invalid in this | 7842 If Nth element is nil, the byte code N is invalid in this |
| 7842 coding system. | 7843 coding system. |
| 7846 | 7847 |
| 7847 If Nth element is a list of charset IDs, N is the first byte | 7848 If Nth element is a list of charset IDs, N is the first byte |
| 7848 of one of them. The list is sorted by dimensions of the | 7849 of one of them. The list is sorted by dimensions of the |
| 7849 charsets. A charset of smaller dimension comes firtst. | 7850 charsets. A charset of smaller dimension comes firtst. |
| 7850 */ | 7851 */ |
| 7852 for (list = Qnil, tail = charset_list; CONSP (tail); tail = XCDR (tail)) | |
| 7853 { | |
| 7854 struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail))); | |
| 7855 | |
| 7856 if (charset->method == CHARSET_METHOD_SUPERSET) | |
| 7857 { | |
| 7858 val = CHARSET_SUPERSET (charset); | |
| 7859 for (; CONSP (val); val = XCDR (val)) | |
| 7860 list = Fcons (XCAR (XCAR (val)), list); | |
| 7861 } | |
| 7862 else | |
| 7863 list = Fcons (XCAR (tail), list); | |
| 7864 } | |
| 7865 | |
| 7851 val = Fmake_vector (make_number (256), Qnil); | 7866 val = Fmake_vector (make_number (256), Qnil); |
| 7852 | 7867 |
| 7853 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) | 7868 for (tail = Fnreverse (list); CONSP (tail); tail = XCDR (tail)) |
| 7854 { | 7869 { |
| 7855 struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail))); | 7870 struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail))); |
| 7856 int dim = CHARSET_DIMENSION (charset); | 7871 int dim = CHARSET_DIMENSION (charset); |
| 7857 int idx = (dim - 1) * 4; | 7872 int idx = (dim - 1) * 4; |
| 7858 | 7873 |
