Mercurial > emacs
comparison src/charset.c @ 22703:15e0119749cf
(Vgeneric_character_list): New variable.
(init_charset_once): Init and staticpro it.
(Fgeneric_character_list): New function.
(syms_of_charset): defsubr it.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 06 Jul 1998 06:33:55 +0000 |
parents | b4316cd96876 |
children | f0c8af6c2dfd |
comparison
equal
deleted
inserted
replaced
22702:1e265354a43a | 22703:15e0119749cf |
---|---|
102 int nonascii_insert_offset; | 102 int nonascii_insert_offset; |
103 | 103 |
104 /* Translation table for converting non-ASCII unibyte characters | 104 /* Translation table for converting non-ASCII unibyte characters |
105 to multibyte codes, or nil. */ | 105 to multibyte codes, or nil. */ |
106 Lisp_Object Vnonascii_translation_table; | 106 Lisp_Object Vnonascii_translation_table; |
107 | |
108 /* List of all possible generic characters. */ | |
109 Lisp_Object Vgeneric_character_list; | |
107 | 110 |
108 #define min(X, Y) ((X) < (Y) ? (X) : (Y)) | 111 #define min(X, Y) ((X) < (Y) ? (X) : (Y)) |
109 #define max(X, Y) ((X) > (Y) ? (X) : (Y)) | 112 #define max(X, Y) ((X) > (Y) ? (X) : (Y)) |
110 | 113 |
111 void | 114 void |
576 vec[4], vec[5], vec[6], vec[7], vec[8]); | 579 vec[4], vec[5], vec[6], vec[7], vec[8]); |
577 Fput (charset_symbol, Qcharset, CHARSET_TABLE_ENTRY (XINT (charset_id))); | 580 Fput (charset_symbol, Qcharset, CHARSET_TABLE_ENTRY (XINT (charset_id))); |
578 CHARSET_SYMBOL (XINT (charset_id)) = charset_symbol; | 581 CHARSET_SYMBOL (XINT (charset_id)) = charset_symbol; |
579 Vcharset_list = Fcons (charset_symbol, Vcharset_list); | 582 Vcharset_list = Fcons (charset_symbol, Vcharset_list); |
580 return Qnil; | 583 return Qnil; |
584 } | |
585 | |
586 DEFUN ("generic-character-list", Fgeneric_character_list, | |
587 Sgeneric_character_list, 0, 0, 0, | |
588 "Return a list of all possible generic characters.\n\ | |
589 It includes a generic character for a charset not yet defined.") | |
590 () | |
591 { | |
592 return Vgeneric_character_list; | |
581 } | 593 } |
582 | 594 |
583 DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char, | 595 DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char, |
584 Sget_unused_iso_final_char, 2, 2, 0, | 596 Sget_unused_iso_final_char, 2, 2, 0, |
585 "Return an unsed ISO's final char for a charset of DIMENISION and CHARS.\n\ | 597 "Return an unsed ISO's final char for a charset of DIMENISION and CHARS.\n\ |
1660 { | 1672 { |
1661 int i, j, k; | 1673 int i, j, k; |
1662 | 1674 |
1663 staticpro (&Vcharset_table); | 1675 staticpro (&Vcharset_table); |
1664 staticpro (&Vcharset_symbol_table); | 1676 staticpro (&Vcharset_symbol_table); |
1677 staticpro (&Vgeneric_character_list); | |
1665 | 1678 |
1666 /* This has to be done here, before we call Fmake_char_table. */ | 1679 /* This has to be done here, before we call Fmake_char_table. */ |
1667 Qcharset_table = intern ("charset-table"); | 1680 Qcharset_table = intern ("charset-table"); |
1668 staticpro (&Qcharset_table); | 1681 staticpro (&Qcharset_table); |
1669 | 1682 |
1704 WIDTH_BY_CHAR_HEAD (i) = 4; | 1717 WIDTH_BY_CHAR_HEAD (i) = 4; |
1705 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_11) = 1; | 1718 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_11) = 1; |
1706 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_12) = 2; | 1719 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_12) = 2; |
1707 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_21) = 1; | 1720 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_21) = 1; |
1708 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_22) = 2; | 1721 WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_22) = 2; |
1722 | |
1723 { | |
1724 Lisp_Object val = Qnil; | |
1725 | |
1726 for (i = 0x81; i < 0x90; i++) | |
1727 val = Fcons (make_number ((i - 0x70) << 7), val); | |
1728 for (; i < 0x9A; i++) | |
1729 val = Fcons (make_number ((i - 0x8F) << 14), val); | |
1730 for (i = 0xA0; i < 0xF0; i++) | |
1731 val = Fcons (make_number ((i - 0x70) << 7), val); | |
1732 for (; i < 0xFF; i++) | |
1733 val = Fcons (make_number ((i - 0xE0) << 14), val); | |
1734 val = Fcons (make_number (GENERIC_COMPOSITION_CHAR), val); | |
1735 Vgeneric_character_list = Fnreverse (val); | |
1736 } | |
1709 } | 1737 } |
1710 | 1738 |
1711 #ifdef emacs | 1739 #ifdef emacs |
1712 | 1740 |
1713 void | 1741 void |
1735 Qcomposition = intern ("composition"); | 1763 Qcomposition = intern ("composition"); |
1736 staticpro (&Qcomposition); | 1764 staticpro (&Qcomposition); |
1737 CHARSET_SYMBOL (CHARSET_COMPOSITION) = Qcomposition; | 1765 CHARSET_SYMBOL (CHARSET_COMPOSITION) = Qcomposition; |
1738 | 1766 |
1739 defsubr (&Sdefine_charset); | 1767 defsubr (&Sdefine_charset); |
1768 defsubr (&Sgeneric_character_list); | |
1740 defsubr (&Sget_unused_iso_final_char); | 1769 defsubr (&Sget_unused_iso_final_char); |
1741 defsubr (&Sdeclare_equiv_charset); | 1770 defsubr (&Sdeclare_equiv_charset); |
1742 defsubr (&Sfind_charset_region); | 1771 defsubr (&Sfind_charset_region); |
1743 defsubr (&Sfind_charset_string); | 1772 defsubr (&Sfind_charset_string); |
1744 defsubr (&Smake_char_internal); | 1773 defsubr (&Smake_char_internal); |