Mercurial > emacs
comparison src/keymap.c @ 29013:b9565b4bcdf8
(Fsingle_key_description): Use SPLIT_CHAR instead of
SPLIT_NON_ASCII_CHAR.
(describe_vector): Use MAKE_CHAR instead of MAKE_NON_ASCII_CHAR.
(Faccessible_keymaps): Use FETCH_STRING_CHAR_ADVANCE
unconditionally.
(Fkey_description): Likewise.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Sat, 20 May 2000 00:03:16 +0000 |
| parents | b89eb8bbaff1 |
| children | 59f2b30d577b |
comparison
equal
deleted
inserted
replaced
| 29012:9e67ee582342 | 29013:b9565b4bcdf8 |
|---|---|
| 1500 | 1500 |
| 1501 copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil); | 1501 copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil); |
| 1502 for (i = 0, i_byte = 0; i < XSTRING (prefix)->size;) | 1502 for (i = 0, i_byte = 0; i < XSTRING (prefix)->size;) |
| 1503 { | 1503 { |
| 1504 int i_before = i; | 1504 int i_before = i; |
| 1505 if (STRING_MULTIBYTE (prefix)) | 1505 |
| 1506 FETCH_STRING_CHAR_ADVANCE (c, prefix, i, i_byte); | 1506 FETCH_STRING_CHAR_ADVANCE (c, prefix, i, i_byte); |
| 1507 else | 1507 if (SINGLE_BYTE_CHAR_P (c) && (c & 0200)) |
| 1508 { | 1508 c ^= 0200 | meta_modifier; |
| 1509 c = XSTRING (prefix)->data[i++]; | |
| 1510 if (c & 0200) | |
| 1511 c ^= 0200 | meta_modifier; | |
| 1512 } | |
| 1513 XVECTOR (copy)->contents[i_before] = make_number (c); | 1509 XVECTOR (copy)->contents[i_before] = make_number (c); |
| 1514 } | 1510 } |
| 1515 prefix = copy; | 1511 prefix = copy; |
| 1516 } | 1512 } |
| 1517 maps = Fcons (Fcons (prefix, tem), Qnil); | 1513 maps = Fcons (Fcons (prefix, tem), Qnil); |
| 1736 for (i = 0, i_byte = 0; i < XSTRING (keys)->size; ) | 1732 for (i = 0, i_byte = 0; i < XSTRING (keys)->size; ) |
| 1737 { | 1733 { |
| 1738 int c; | 1734 int c; |
| 1739 int i_before = i; | 1735 int i_before = i; |
| 1740 | 1736 |
| 1741 if (STRING_MULTIBYTE (keys)) | 1737 FETCH_STRING_CHAR_ADVANCE (c, keys, i, i_byte); |
| 1742 FETCH_STRING_CHAR_ADVANCE (c, keys, i, i_byte); | 1738 if (SINGLE_BYTE_CHAR_P (c) && (c & 0200)) |
| 1743 else | 1739 c ^= 0200 | meta_modifier; |
| 1744 { | |
| 1745 c = XSTRING (keys)->data[i++]; | |
| 1746 if (c & 0200) | |
| 1747 c ^= 0200 | meta_modifier; | |
| 1748 } | |
| 1749 | |
| 1750 XSETFASTINT (XVECTOR (vector)->contents[i_before], c); | 1740 XSETFASTINT (XVECTOR (vector)->contents[i_before], c); |
| 1751 } | 1741 } |
| 1752 keys = vector; | 1742 keys = vector; |
| 1753 } | 1743 } |
| 1754 | 1744 |
| 1929 int without_bits = XINT (key) & ~((-1) << CHARACTERBITS); | 1919 int without_bits = XINT (key) & ~((-1) << CHARACTERBITS); |
| 1930 | 1920 |
| 1931 if (SINGLE_BYTE_CHAR_P (without_bits)) | 1921 if (SINGLE_BYTE_CHAR_P (without_bits)) |
| 1932 charset = 0; | 1922 charset = 0; |
| 1933 else | 1923 else |
| 1934 SPLIT_NON_ASCII_CHAR (without_bits, charset, c1, c2); | 1924 SPLIT_CHAR (without_bits, charset, c1, c2); |
| 1935 | 1925 |
| 1936 if (charset | 1926 if (charset |
| 1937 && CHARSET_DEFINED_P (charset) | 1927 && CHARSET_DEFINED_P (charset) |
| 1938 && ((c1 >= 0 && c1 < 32) | 1928 && ((c1 >= 0 && c1 < 32) |
| 1939 || (c2 >= 0 && c2 < 32))) | 1929 || (c2 >= 0 && c2 < 32))) |
| 3032 character = i; | 3022 character = i; |
| 3033 indices[0] = i - 128; | 3023 indices[0] = i - 128; |
| 3034 } | 3024 } |
| 3035 else if (complete_char) | 3025 else if (complete_char) |
| 3036 { | 3026 { |
| 3037 character | 3027 character = MAKE_CHAR (indices[0], indices[1], indices[2]); |
| 3038 = MAKE_NON_ASCII_CHAR (indices[0], indices[1], indices[2]); | |
| 3039 } | 3028 } |
| 3040 else | 3029 else |
| 3041 character = 0; | 3030 character = 0; |
| 3042 } | 3031 } |
| 3043 else | 3032 else |
| 3176 insert1 (Fsingle_key_description (make_number (i))); | 3165 insert1 (Fsingle_key_description (make_number (i))); |
| 3177 } | 3166 } |
| 3178 else if (complete_char) | 3167 else if (complete_char) |
| 3179 { | 3168 { |
| 3180 indices[char_table_depth] = i; | 3169 indices[char_table_depth] = i; |
| 3181 character | 3170 character = MAKE_CHAR (indices[0], indices[1], indices[2]); |
| 3182 = MAKE_NON_ASCII_CHAR (indices[0], indices[1], indices[2]); | |
| 3183 insert_char (character); | 3171 insert_char (character); |
| 3184 } | 3172 } |
| 3185 else | 3173 else |
| 3186 { | 3174 { |
| 3187 /* We need an octal representation for this block of | 3175 /* We need an octal representation for this block of |
