diff options
| author | Kenichi Handa | 1997-05-28 04:36:22 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-05-28 04:36:22 +0000 |
| commit | 7e798f25b730162c8c69d88fa0d29c79f81d59fa (patch) | |
| tree | 8de300ed903c1e3d1b2cf4ae25871a59c461854a /src | |
| parent | afbee0fa30ce6494899b9dc690147c11f68ac223 (diff) | |
| download | emacs-7e798f25b730162c8c69d88fa0d29c79f81d59fa.tar.gz emacs-7e798f25b730162c8c69d88fa0d29c79f81d59fa.zip | |
(map_char_table): For sub char-table, index should be
start from 0 (not from 32) considering a composite character.
(Fmap_char_table): Doc-string adjusted. The variable indices is
declared as an array of Lisp_Object.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -1439,11 +1439,11 @@ map_char_table (c_function, function, subtable, arg, depth, indices) | |||
| 1439 | } | 1439 | } |
| 1440 | else | 1440 | else |
| 1441 | { | 1441 | { |
| 1442 | i = 32; | 1442 | i = 0; |
| 1443 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; | 1443 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; |
| 1444 | } | 1444 | } |
| 1445 | 1445 | ||
| 1446 | for (i; i < to; i++) | 1446 | for (; i < to; i++) |
| 1447 | { | 1447 | { |
| 1448 | Lisp_Object elt = XCHAR_TABLE (subtable)->contents[i]; | 1448 | Lisp_Object elt = XCHAR_TABLE (subtable)->contents[i]; |
| 1449 | 1449 | ||
| @@ -1453,8 +1453,7 @@ map_char_table (c_function, function, subtable, arg, depth, indices) | |||
| 1453 | { | 1453 | { |
| 1454 | if (depth >= 3) | 1454 | if (depth >= 3) |
| 1455 | error ("Too deep char table"); | 1455 | error ("Too deep char table"); |
| 1456 | map_char_table (c_function, function, elt, arg, | 1456 | map_char_table (c_function, function, elt, arg, depth + 1, indices); |
| 1457 | depth + 1, indices); | ||
| 1458 | } | 1457 | } |
| 1459 | else | 1458 | else |
| 1460 | { | 1459 | { |
| @@ -1476,15 +1475,16 @@ map_char_table (c_function, function, subtable, arg, depth, indices) | |||
| 1476 | 1475 | ||
| 1477 | DEFUN ("map-char-table", Fmap_char_table, Smap_char_table, | 1476 | DEFUN ("map-char-table", Fmap_char_table, Smap_char_table, |
| 1478 | 2, 2, 0, | 1477 | 2, 2, 0, |
| 1479 | "Call FUNCTION for each range of like characters in CHAR-TABLE.\n\ | 1478 | "Call FUNCTION for each (normal and generic) characters in CHAR-TABLE.\n\ |
| 1480 | FUNCTION is called with two arguments--a key and a value.\n\ | 1479 | FUNCTION is called with two arguments--a key and a value.\n\ |
| 1481 | The key is always a possible RANGE argument to `set-char-table-range'.") | 1480 | The key is always a possible IDX argument to `aref'.") |
| 1482 | (function, char_table) | 1481 | (function, char_table) |
| 1483 | Lisp_Object function, char_table; | 1482 | Lisp_Object function, char_table; |
| 1484 | { | 1483 | { |
| 1485 | Lisp_Object keyvec; | ||
| 1486 | /* The depth of char table is at most 3. */ | 1484 | /* The depth of char table is at most 3. */ |
| 1487 | Lisp_Object *indices = (Lisp_Object *) alloca (3 * sizeof (Lisp_Object)); | 1485 | Lisp_Object indices[3]; |
| 1486 | |||
| 1487 | CHECK_CHAR_TABLE (char_table, 1); | ||
| 1488 | 1488 | ||
| 1489 | map_char_table (NULL, function, char_table, char_table, 0, indices); | 1489 | map_char_table (NULL, function, char_table, char_table, 0, indices); |
| 1490 | return Qnil; | 1490 | return Qnil; |