diff options
| author | Kenichi Handa | 1998-05-18 00:59:38 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-05-18 00:59:38 +0000 |
| commit | b4e9dd77cc1a9627f5cb8a8057f27ad960b039e9 (patch) | |
| tree | 94a889dc5787155df0e3f7586ed4850b7368d8b6 | |
| parent | 62c6686f987dafc0873713b97eda0a342ff65b15 (diff) | |
| download | emacs-b4e9dd77cc1a9627f5cb8a8057f27ad960b039e9.tar.gz emacs-b4e9dd77cc1a9627f5cb8a8057f27ad960b039e9.zip | |
Change terms unify/unification to
translate/translation respectively throughtout the file.
(ONE_BYTE_CHAR_WIDTH): Delete unnecessary continuation line at the
tail.
| -rw-r--r-- | src/charset.c | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/charset.c b/src/charset.c index 5803c50d30c..0017ac1b9bf 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -74,9 +74,9 @@ Lisp_Object Vcharset_symbol_table; | |||
| 74 | /* A list of charset symbols ever defined. */ | 74 | /* A list of charset symbols ever defined. */ |
| 75 | Lisp_Object Vcharset_list; | 75 | Lisp_Object Vcharset_list; |
| 76 | 76 | ||
| 77 | /* Vector of unification table ever defined. | 77 | /* Vector of character translation table ever defined. |
| 78 | An ID of a unification table is an index of this vector. */ | 78 | ID of a character translation table is used to index this vector. */ |
| 79 | Lisp_Object Vcharacter_unification_table_vector; | 79 | Lisp_Object Vcharacter_translation_table_vector; |
| 80 | 80 | ||
| 81 | /* Tables used by macros BYTES_BY_CHAR_HEAD and WIDTH_BY_CHAR_HEAD. */ | 81 | /* Tables used by macros BYTES_BY_CHAR_HEAD and WIDTH_BY_CHAR_HEAD. */ |
| 82 | int bytes_by_char_head[256]; | 82 | int bytes_by_char_head[256]; |
| @@ -103,7 +103,7 @@ 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_translate_table; | 106 | Lisp_Object Vnonascii_translation_table; |
| 107 | 107 | ||
| 108 | #define min(X, Y) ((X) < (Y) ? (X) : (Y)) | 108 | #define min(X, Y) ((X) < (Y) ? (X) : (Y)) |
| 109 | #define max(X, Y) ((X) > (Y) ? (X) : (Y)) | 109 | #define max(X, Y) ((X) > (Y) ? (X) : (Y)) |
| @@ -273,11 +273,12 @@ split_non_ascii_string (str, len, charset, c1, c2) | |||
| 273 | return 0; | 273 | return 0; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | /* Return a character unified with C (or a character made of CHARSET, | 276 | /* Translate character C by character translation table TABLE. If C |
| 277 | C1, and C2) in unification table TABLE. If no unification is found | 277 | is negative, translate a character specified by CHARSET, C1, and C2 |
| 278 | in TABLE, return C. */ | 278 | (C1 and C2 are code points of the character). If no translation is |
| 279 | found in TABLE, return C. */ | ||
| 279 | int | 280 | int |
| 280 | unify_char (table, c, charset, c1, c2) | 281 | translate_char (table, c, charset, c1, c2) |
| 281 | Lisp_Object table; | 282 | Lisp_Object table; |
| 282 | int c, charset, c1, c2; | 283 | int c, charset, c1, c2; |
| 283 | { | 284 | { |
| @@ -307,7 +308,7 @@ unify_char (table, c, charset, c1, c2) | |||
| 307 | } | 308 | } |
| 308 | 309 | ||
| 309 | /* Convert the unibyte character C to multibyte based on | 310 | /* Convert the unibyte character C to multibyte based on |
| 310 | Vnonascii_translate_table or nonascii_insert_offset. If they can't | 311 | Vnonascii_translation_table or nonascii_insert_offset. If they can't |
| 311 | convert C to a valid multibyte character, convert it based on | 312 | convert C to a valid multibyte character, convert it based on |
| 312 | DEFAULT_NONASCII_INSERT_OFFSET which makes C a Latin-1 character. */ | 313 | DEFAULT_NONASCII_INSERT_OFFSET which makes C a Latin-1 character. */ |
| 313 | 314 | ||
| @@ -319,8 +320,8 @@ unibyte_char_to_multibyte (c) | |||
| 319 | { | 320 | { |
| 320 | int c_save = c; | 321 | int c_save = c; |
| 321 | 322 | ||
| 322 | if (! NILP (Vnonascii_translate_table)) | 323 | if (! NILP (Vnonascii_translation_table)) |
| 323 | c = XINT (Faref (Vnonascii_translate_table, make_number (c))); | 324 | c = XINT (Faref (Vnonascii_translation_table, make_number (c))); |
| 324 | else if (nonascii_insert_offset > 0) | 325 | else if (nonascii_insert_offset > 0) |
| 325 | c += nonascii_insert_offset; | 326 | c += nonascii_insert_offset; |
| 326 | if (c >= 0240 && (c < 0400 || ! VALID_MULTIBYTE_CHAR_P (c))) | 327 | if (c >= 0240 && (c < 0400 || ! VALID_MULTIBYTE_CHAR_P (c))) |
| @@ -629,7 +630,7 @@ CHARSET should be defined by `defined-charset' in advance.") | |||
| 629 | /* Return number of different charsets in STR of length LEN. In | 630 | /* Return number of different charsets in STR of length LEN. In |
| 630 | addition, for each found charset N, CHARSETS[N] is set 1. The | 631 | addition, for each found charset N, CHARSETS[N] is set 1. The |
| 631 | caller should allocate CHARSETS (MAX_CHARSET + 1 elements) in advance. | 632 | caller should allocate CHARSETS (MAX_CHARSET + 1 elements) in advance. |
| 632 | It may lookup a unification table TABLE if supplied. */ | 633 | It may lookup a translation table TABLE if supplied. */ |
| 633 | 634 | ||
| 634 | int | 635 | int |
| 635 | find_charset_in_str (str, len, charsets, table) | 636 | find_charset_in_str (str, len, charsets, table) |
| @@ -662,7 +663,7 @@ find_charset_in_str (str, len, charsets, table) | |||
| 662 | c = cmpcharp->glyph[i]; | 663 | c = cmpcharp->glyph[i]; |
| 663 | if (!NILP (table)) | 664 | if (!NILP (table)) |
| 664 | { | 665 | { |
| 665 | if ((c = unify_char (table, c, 0, 0, 0)) < 0) | 666 | if ((c = translate_char (table, c, 0, 0, 0)) < 0) |
| 666 | c = cmpcharp->glyph[i]; | 667 | c = cmpcharp->glyph[i]; |
| 667 | } | 668 | } |
| 668 | if ((charset = CHAR_CHARSET (c)) < 0) | 669 | if ((charset = CHAR_CHARSET (c)) < 0) |
| @@ -686,7 +687,7 @@ find_charset_in_str (str, len, charsets, table) | |||
| 686 | c = STRING_CHAR_AND_LENGTH (str, len, bytes); | 687 | c = STRING_CHAR_AND_LENGTH (str, len, bytes); |
| 687 | if (! NILP (table)) | 688 | if (! NILP (table)) |
| 688 | { | 689 | { |
| 689 | int c1 = unify_char (table, c, 0, 0, 0); | 690 | int c1 = translate_char (table, c, 0, 0, 0); |
| 690 | if (c1 >= 0) | 691 | if (c1 >= 0) |
| 691 | c = c1; | 692 | c = c1; |
| 692 | } | 693 | } |
| @@ -708,7 +709,7 @@ DEFUN ("find-charset-region", Ffind_charset_region, Sfind_charset_region, | |||
| 708 | 2, 3, 0, | 709 | 2, 3, 0, |
| 709 | "Return a list of charsets in the region between BEG and END.\n\ | 710 | "Return a list of charsets in the region between BEG and END.\n\ |
| 710 | BEG and END are buffer positions.\n\ | 711 | BEG and END are buffer positions.\n\ |
| 711 | Optional arg TABLE if non-nil is a unification table to look up.") | 712 | Optional arg TABLE if non-nil is a translation table to look up.") |
| 712 | (beg, end, table) | 713 | (beg, end, table) |
| 713 | Lisp_Object beg, end, table; | 714 | Lisp_Object beg, end, table; |
| 714 | { | 715 | { |
| @@ -754,7 +755,7 @@ Optional arg TABLE if non-nil is a unification table to look up.") | |||
| 754 | DEFUN ("find-charset-string", Ffind_charset_string, Sfind_charset_string, | 755 | DEFUN ("find-charset-string", Ffind_charset_string, Sfind_charset_string, |
| 755 | 1, 2, 0, | 756 | 1, 2, 0, |
| 756 | "Return a list of charsets in STR.\n\ | 757 | "Return a list of charsets in STR.\n\ |
| 757 | Optional arg TABLE if non-nil is a unification table to look up.") | 758 | Optional arg TABLE if non-nil is a translation table to look up.") |
| 758 | (str, table) | 759 | (str, table) |
| 759 | Lisp_Object str, table; | 760 | Lisp_Object str, table; |
| 760 | { | 761 | { |
| @@ -971,8 +972,7 @@ DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0, | |||
| 971 | : ((! NILP (current_buffer->enable_multibyte_characters) \ | 972 | : ((! NILP (current_buffer->enable_multibyte_characters) \ |
| 972 | && BASE_LEADING_CODE_P (c)) \ | 973 | && BASE_LEADING_CODE_P (c)) \ |
| 973 | ? WIDTH_BY_CHAR_HEAD (c) \ | 974 | ? WIDTH_BY_CHAR_HEAD (c) \ |
| 974 | : 4)))) \ | 975 | : 4)))) |
| 975 | |||
| 976 | 976 | ||
| 977 | DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, | 977 | DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, |
| 978 | "Return width of CHAR when displayed in the current buffer.\n\ | 978 | "Return width of CHAR when displayed in the current buffer.\n\ |
| @@ -1751,11 +1751,11 @@ syms_of_charset () | |||
| 1751 | "List of charsets ever defined."); | 1751 | "List of charsets ever defined."); |
| 1752 | Vcharset_list = Fcons (Qascii, Qnil); | 1752 | Vcharset_list = Fcons (Qascii, Qnil); |
| 1753 | 1753 | ||
| 1754 | DEFVAR_LISP ("character-unification-table-vector", | 1754 | DEFVAR_LISP ("character-translation-table-vector", |
| 1755 | &Vcharacter_unification_table_vector, | 1755 | &Vcharacter_translation_table_vector, |
| 1756 | "Vector of cons cell of a symbol and unification table ever defined.\n\ | 1756 | "Vector of cons cell of a symbol and translation table ever defined.\n\ |
| 1757 | An ID of a unification table is an index of this vector."); | 1757 | An ID of a translation table is an index of this vector."); |
| 1758 | Vcharacter_unification_table_vector = Fmake_vector (make_number (16), Qnil); | 1758 | Vcharacter_translation_table_vector = Fmake_vector (make_number (16), Qnil); |
| 1759 | 1759 | ||
| 1760 | DEFVAR_INT ("leading-code-composition", &leading_code_composition, | 1760 | DEFVAR_INT ("leading-code-composition", &leading_code_composition, |
| 1761 | "Leading-code of composite characters."); | 1761 | "Leading-code of composite characters."); |
| @@ -1788,15 +1788,16 @@ for your choice of character set.\n\ | |||
| 1788 | If `nonascii-translate-table' is non-nil, it overrides this variable."); | 1788 | If `nonascii-translate-table' is non-nil, it overrides this variable."); |
| 1789 | nonascii_insert_offset = 0; | 1789 | nonascii_insert_offset = 0; |
| 1790 | 1790 | ||
| 1791 | DEFVAR_LISP ("nonascii-translate-table", &Vnonascii_translate_table, | 1791 | DEFVAR_LISP ("nonascii-translation-table", &Vnonascii_translation_table, |
| 1792 | "Translate table for converting non-ASCII unibyte codes to multibyte.\n\ | 1792 | "Character translation table to convert non-ASCII unibyte codes to multibyte.\n\ |
| 1793 | This is used for converting unibyte text to multibyte,\n\ | 1793 | This is used for converting unibyte text to multibyte,\n\ |
| 1794 | and for inserting character codes specified by number.\n\n\ | 1794 | and for inserting character codes specified by number.\n\n\ |
| 1795 | Conversion is performed only when multibyte characters are enabled,\n\ | 1795 | Conversion is performed only when multibyte characters are enabled,\n\ |
| 1796 | and it serves to convert a Latin-1 or similar 8-bit character code\n\ | 1796 | and it serves to convert a Latin-1 or similar 8-bit character code\n\ |
| 1797 | to the corresponding Emacs character code.\n\n\ | 1797 | to the corresponding Emacs character code.\n\n\ |
| 1798 | If this is nil, `nonascii-insert-offset' is used instead."); | 1798 | If this is nil, `nonascii-insert-offset' is used instead. |
| 1799 | Vnonascii_translate_table = Qnil; | 1799 | See also the docstring of `make-translation-table'."); |
| 1800 | Vnonascii_translation_table = Qnil; | ||
| 1800 | 1801 | ||
| 1801 | DEFVAR_INT ("min-composite-char", &min_composite_char, | 1802 | DEFVAR_INT ("min-composite-char", &min_composite_char, |
| 1802 | "Minimum character code of a composite character."); | 1803 | "Minimum character code of a composite character."); |