# HG changeset patch # User Kenichi Handa # Date 858727894 0 # Node ID e38cc84db8ab35373a3d12abd265a5be7ae1dcad # Parent 9ab0c08a3359106e91893df69226a5ad7badace9 (CHAR_TABLE_ORDINARY_SLOTS): Change to 384 (== 256 + 128). (CHAR_TABLE_STANDARD_SLOTS): Adjusted for the above change. (CHAR_TABLE_SINGLE_BYTE_SLOTS): New macro. (CHAR_TABLE_REF, CHAR_TABLE_SET): New macros. diff -r 9ab0c08a3359 -r e38cc84db8ab src/lisp.h --- a/src/lisp.h Tue Mar 18 23:31:34 1997 +0000 +++ b/src/lisp.h Tue Mar 18 23:31:34 1997 +0000 @@ -568,19 +568,43 @@ but with a few other slots. For some purposes, it makes sense to handle a chartable with type struct Lisp_Vector. */ -/* This is the number of slots that apply to characters - or character sets. */ -#define CHAR_TABLE_ORDINARY_SLOTS 256 +/* This is the number of slots that apply to characters or character + sets. The first 128 are for ASCII, the next 128 are for 8-bit + European characters, and the last 128 are for multibyte characters. */ +#define CHAR_TABLE_ORDINARY_SLOTS 384 + +/* This is the number of slots that apply to characters of ASCII and + 8-bit Europeans only. */ +#define CHAR_TABLE_SINGLE_BYTE_SLOTS 256 /* This is the number of slots that every char table must have. This counts the ordinary slots and the parent and defalt slots. */ -#define CHAR_TABLE_STANDARD_SLOTS (256+3) +#define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 3) /* Return the number of "extra" slots in the char table CT. */ #define CHAR_TABLE_EXTRA_SLOTS(CT) \ (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) +/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII + and 8-bit Europeans characters. Do not follow parent. */ +#define CHAR_TABLE_REF(CT, IDX) \ + (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS \ + ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \ + ? XCHAR_TABLE (CT)->contents[IDX] \ + : XCHAR_TABLE (CT)->default) \ + : Faref (CT, IDX)) + +/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and + 8-bit Europeans characters. */ +#define CHAR_TABLE_SET(CT, IDX, VAL) \ + do { \ + if (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS) \ + XCHAR_TABLE (CT)->contents[IDX] = VAL; \ + else \ + Faset (CT, IDX, VAL); \ + } while (0) + struct Lisp_Char_Table { /* This is the vector's size field, which also holds the @@ -914,6 +938,10 @@ #define FAST_GLYPH_FACE(g) ((g) & GLYPH_MASK_FACE) #endif /* not HAVE_FACES */ +/* Return 1 iff GLYPH contains valid character code. */ +#define GLYPH_CHAR_VALID_P(glyph) \ + ((GLYPH) (FAST_GLYPH_CHAR (glyph)) <= MAX_CHAR) + /* The ID of the mode line highlighting face. */ #define GLYPH_MODE_LINE_FACE 1