diff options
| author | Kenichi Handa | 1997-04-07 07:12:13 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-04-07 07:12:13 +0000 |
| commit | 1f1ff51db02df55c125f20b7ef4020aba36b3900 (patch) | |
| tree | 980980971f8a827c4131d2d60f118b3def68bb88 /src | |
| parent | 57b03282a0f5abaf689a0c411a2f771e1c555d98 (diff) | |
| download | emacs-1f1ff51db02df55c125f20b7ef4020aba36b3900.tar.gz emacs-1f1ff51db02df55c125f20b7ef4020aba36b3900.zip | |
(disp_char_vector): New function to be used from the
macro DISP_CHAR_VECTOR for multibyte characters.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c9aa763edbb..cabdf70f2ab 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1476,6 +1476,43 @@ redisplay_windows (window, preserve_echo_area) | |||
| 1476 | redisplay_window (window, 0, preserve_echo_area); | 1476 | redisplay_window (window, 0, preserve_echo_area); |
| 1477 | } | 1477 | } |
| 1478 | 1478 | ||
| 1479 | /* Return value in display table DP (Lisp_Char_Table *) for character | ||
| 1480 | C. Since a display table doesn't have any parent, we don't have to | ||
| 1481 | follow parent. Do not call this function directly but use the | ||
| 1482 | macro DISP_CHAR_VECTOR. */ | ||
| 1483 | Lisp_Object | ||
| 1484 | disp_char_vector (dp, c) | ||
| 1485 | struct Lisp_Char_Table *dp; | ||
| 1486 | int c; | ||
| 1487 | { | ||
| 1488 | int code[4], i; | ||
| 1489 | Lisp_Object val; | ||
| 1490 | |||
| 1491 | if (SINGLE_BYTE_CHAR_P (c)) return (dp->contents[c]); | ||
| 1492 | |||
| 1493 | SPLIT_NON_ASCII_CHAR (c, code[0], code[1], code[2]); | ||
| 1494 | if (code[0] != CHARSET_COMPOSITION) | ||
| 1495 | { | ||
| 1496 | if (code[1] < 32) code[1] = -1; | ||
| 1497 | else if (code[2] < 32) code[2] = -1; | ||
| 1498 | } | ||
| 1499 | /* Here, the possible range of CODE[0] (== charset ID) is | ||
| 1500 | 128..MAX_CHARSET. Since the top level char table contains data | ||
| 1501 | for multibyte characters after 256th element, we must increment | ||
| 1502 | CODE[0] by 128 to get a correct index. */ | ||
| 1503 | code[0] += 128; | ||
| 1504 | code[3] = -1; /* anchor */ | ||
| 1505 | |||
| 1506 | for (i = 0; code[i] >= 0; i++, dp = XCHAR_TABLE (val)) | ||
| 1507 | { | ||
| 1508 | val = dp->contents[code[i]]; | ||
| 1509 | if (!SUB_CHAR_TABLE_P (val)) | ||
| 1510 | return (NILP (val) ? dp->defalt : val); | ||
| 1511 | } | ||
| 1512 | /* Here, VAL is a sub char table. We return the default value of it. */ | ||
| 1513 | return (dp->defalt); | ||
| 1514 | } | ||
| 1515 | |||
| 1479 | /* Redisplay window WINDOW and its subwindows. */ | 1516 | /* Redisplay window WINDOW and its subwindows. */ |
| 1480 | 1517 | ||
| 1481 | static void | 1518 | static void |