diff options
| author | Kenichi Handa | 1997-05-16 00:43:05 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-05-16 00:43:05 +0000 |
| commit | e1335ba2439cb8377ea4430b1788427dda689f83 (patch) | |
| tree | 8145392e8bbe04dbabcd2adf5be11476623f30fc /src | |
| parent | f613a4c8568065d8d10c78f7bc545f287652d5ba (diff) | |
| download | emacs-e1335ba2439cb8377ea4430b1788427dda689f83.tar.gz emacs-e1335ba2439cb8377ea4430b1788427dda689f83.zip | |
(copy_sub_char_table): Declare the argument ARG as
Lisp_Object.
(Fset_char_table_default): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 50 |
1 files changed, 50 insertions, 0 deletions
| @@ -297,6 +297,7 @@ Each argument may be a list, vector or string.") | |||
| 297 | nested sub char table are not copied. */ | 297 | nested sub char table are not copied. */ |
| 298 | static Lisp_Object | 298 | static Lisp_Object |
| 299 | copy_sub_char_table (arg) | 299 | copy_sub_char_table (arg) |
| 300 | Lisp_Object arg; | ||
| 300 | { | 301 | { |
| 301 | Lisp_Object copy = make_sub_char_table (XCHAR_TABLE (arg)->defalt); | 302 | Lisp_Object copy = make_sub_char_table (XCHAR_TABLE (arg)->defalt); |
| 302 | int i; | 303 | int i; |
| @@ -1366,6 +1367,54 @@ or a character code.") | |||
| 1366 | 1367 | ||
| 1367 | return value; | 1368 | return value; |
| 1368 | } | 1369 | } |
| 1370 | |||
| 1371 | DEFUN ("set-char-table-default", Fset_char_table_default, | ||
| 1372 | Sset_char_table_default, 3, 3, 0, | ||
| 1373 | "Set the default value in CHAR-TABLE for a generic character CHAR to VALUE.\n\ | ||
| 1374 | The generic character specifies the group of characters.\n\ | ||
| 1375 | See also the documentation of make-char.") | ||
| 1376 | (char_table, ch, value) | ||
| 1377 | Lisp_Object char_table, ch, value; | ||
| 1378 | { | ||
| 1379 | int c, i, charset, code1, code2; | ||
| 1380 | Lisp_Object temp; | ||
| 1381 | |||
| 1382 | CHECK_CHAR_TABLE (char_table, 0); | ||
| 1383 | CHECK_NUMBER (ch, 1); | ||
| 1384 | |||
| 1385 | c = XINT (ch); | ||
| 1386 | SPLIT_NON_ASCII_CHAR (c, charset, code1, code2); | ||
| 1387 | if (! CHARSET_DEFINED_P (charset)) | ||
| 1388 | error ("Invalid character: %d", c); | ||
| 1389 | |||
| 1390 | if (charset == CHARSET_ASCII) | ||
| 1391 | return (XCHAR_TABLE (char_table)->defalt = value); | ||
| 1392 | |||
| 1393 | /* Even if C is not a generic char, we had better behave as if a | ||
| 1394 | generic char is specified. */ | ||
| 1395 | if (CHARSET_DIMENSION (charset) == 1) | ||
| 1396 | code1 = 0; | ||
| 1397 | temp = XCHAR_TABLE (char_table)->contents[charset + 128]; | ||
| 1398 | if (!code1) | ||
| 1399 | { | ||
| 1400 | if (SUB_CHAR_TABLE_P (temp)) | ||
| 1401 | XCHAR_TABLE (temp)->defalt = value; | ||
| 1402 | else | ||
| 1403 | XCHAR_TABLE (char_table)->contents[charset + 128] = value; | ||
| 1404 | return value; | ||
| 1405 | } | ||
| 1406 | char_table = temp; | ||
| 1407 | if (! SUB_CHAR_TABLE_P (char_table)) | ||
| 1408 | char_table = (XCHAR_TABLE (char_table)->contents[charset + 128] | ||
| 1409 | = make_sub_char_table (temp)); | ||
| 1410 | temp = XCHAR_TABLE (char_table)->contents[code1]; | ||
| 1411 | if (SUB_CHAR_TABLE_P (temp)) | ||
| 1412 | XCHAR_TABLE (temp)->defalt = value; | ||
| 1413 | else | ||
| 1414 | XCHAR_TABLE (char_table)->contents[code1] = value; | ||
| 1415 | return value; | ||
| 1416 | } | ||
| 1417 | |||
| 1369 | 1418 | ||
| 1370 | /* Map C_FUNCTION or FUNCTION over SUBTABLE, calling it for each | 1419 | /* Map C_FUNCTION or FUNCTION over SUBTABLE, calling it for each |
| 1371 | character or group of characters that share a value. | 1420 | character or group of characters that share a value. |
| @@ -1955,6 +2004,7 @@ Used by `featurep' and `require', and altered by `provide'."); | |||
| 1955 | defsubr (&Sset_char_table_extra_slot); | 2004 | defsubr (&Sset_char_table_extra_slot); |
| 1956 | defsubr (&Schar_table_range); | 2005 | defsubr (&Schar_table_range); |
| 1957 | defsubr (&Sset_char_table_range); | 2006 | defsubr (&Sset_char_table_range); |
| 2007 | defsubr (&Sset_char_table_default); | ||
| 1958 | defsubr (&Smap_char_table); | 2008 | defsubr (&Smap_char_table); |
| 1959 | defsubr (&Snconc); | 2009 | defsubr (&Snconc); |
| 1960 | defsubr (&Smapcar); | 2010 | defsubr (&Smapcar); |