diff options
| author | Kim F. Storm | 2008-02-27 22:48:58 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2008-02-27 22:48:58 +0000 |
| commit | ea92fc1a436175578c9bccec7417cd75fc4fddc7 (patch) | |
| tree | e37b05863126555dd6c0f8e3002bc59c8b24ad1e | |
| parent | 3fc809e2a2a420b80bc6c7cc553f0166fc3c8a83 (diff) | |
| download | emacs-ea92fc1a436175578c9bccec7417cd75fc4fddc7.tar.gz emacs-ea92fc1a436175578c9bccec7417cd75fc4fddc7.zip | |
(GLYPH_SIMPLE_P): Rewrite.
(GLYPH_ALIAS): Delete.
(GLYPH_ALIAS_P, GLYPH_FOLLOW_ALIASES): Rewrite.
(GLYPH_LENGTH, GLYPH_STRING): Use GLYPH_CHAR.
(GLYPH_FROM_CHAR): Replace macro by ...
(SET_GLYPH_FROM_CHAR): ... this macro. Change users.
| -rw-r--r-- | src/disptab.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/disptab.h b/src/disptab.h index 6d96f51f81e..76af4f83ffe 100644 --- a/src/disptab.h +++ b/src/disptab.h | |||
| @@ -74,38 +74,37 @@ extern Lisp_Object Vglyph_table; | |||
| 74 | /* Given BASE and LEN returned by the two previous macros, | 74 | /* Given BASE and LEN returned by the two previous macros, |
| 75 | return nonzero if the GLYPH code G should be output as a single | 75 | return nonzero if the GLYPH code G should be output as a single |
| 76 | character with code G. Return zero if G has a string in the table. */ | 76 | character with code G. Return zero if G has a string in the table. */ |
| 77 | #define GLYPH_SIMPLE_P(base,len,g) ((g) >= (len) || !STRINGP (base[g])) | 77 | #define GLYPH_SIMPLE_P(base,len,g) \ |
| 78 | (GLYPH_FACE (g) != DEFAULT_FACE_ID || GLYPH_CHAR (g) >= (len) || !STRINGP (base[GLYPH_CHAR (g)])) | ||
| 78 | 79 | ||
| 79 | /* Given BASE and LEN returned by the two previous macros, | 80 | /* Given BASE and LEN returned by the two previous macros, |
| 80 | return nonzero if GLYPH code G is aliased to a different code. */ | 81 | return nonzero if GLYPH code G is aliased to a different code. */ |
| 81 | #define GLYPH_ALIAS_P(base,len,g) ((g) < (len) && INTEGERP (base[g])) | 82 | #define GLYPH_ALIAS_P(base,len,g) \ |
| 82 | 83 | (GLYPH_FACE (g) == DEFAULT_FACE_ID && GLYPH_CHAR (g) < (len) && INTEGERP (base[GLYPH_CHAR (g)])) | |
| 83 | /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 1, | ||
| 84 | return the alias for G. */ | ||
| 85 | #define GLYPH_ALIAS(base, g) XINT (base[g]) | ||
| 86 | 84 | ||
| 87 | /* Follow all aliases for G in the glyph table given by (BASE, | 85 | /* Follow all aliases for G in the glyph table given by (BASE, |
| 88 | LENGTH), and set G to the final glyph. */ | 86 | LENGTH), and set G to the final glyph. */ |
| 89 | #define GLYPH_FOLLOW_ALIASES(base, length, g) \ | 87 | #define GLYPH_FOLLOW_ALIASES(base, length, g) \ |
| 90 | do { \ | 88 | do { \ |
| 91 | while (GLYPH_ALIAS_P ((base), (length), (g))) \ | 89 | while (GLYPH_ALIAS_P ((base), (length), (g))) \ |
| 92 | (g) = GLYPH_ALIAS ((base), (g)); \ | 90 | SET_GLYPH_CHAR ((g), XINT ((base)[GLYPH_CHAR (g)])); \ |
| 93 | if (!GLYPH_CHAR_VALID_P (FAST_GLYPH_CHAR (g))) \ | 91 | if (!GLYPH_CHAR_VALID_P (g)) \ |
| 94 | g = FAST_MAKE_GLYPH (' ', FAST_GLYPH_FACE (g)); \ | 92 | SET_GLYPH_CHAR (g, ' '); \ |
| 95 | } while (0) | 93 | } while (0) |
| 96 | 94 | ||
| 97 | /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, | 95 | /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, |
| 98 | return the length and the address of the character-sequence | 96 | return the length and the address of the character-sequence |
| 99 | used for outputting GLYPH G. */ | 97 | used for outputting GLYPH G. */ |
| 100 | #define GLYPH_LENGTH(base,g) SCHARS (base[g]) | 98 | #define GLYPH_LENGTH(base,g) SCHARS (base[GLYPH_CHAR (g)]) |
| 101 | #define GLYPH_STRING(base,g) SDATA (base[g]) | 99 | #define GLYPH_STRING(base,g) SDATA (base[GLYPH_CHAR (g)]) |
| 102 | 100 | ||
| 103 | /* GLYPH for a space character. */ | 101 | /* GLYPH for a space character. */ |
| 104 | 102 | ||
| 105 | #define SPACEGLYPH 040 | 103 | #define SPACEGLYPH 040 |
| 106 | #define NULL_GLYPH 00 | 104 | #define NULL_GLYPH 00 |
| 107 | 105 | ||
| 108 | #define GLYPH_FROM_CHAR(c) (c) | 106 | #define SET_GLYPH_FROM_CHAR(glyph, c) \ |
| 107 | SET_GLYPH (glyph, c, DEFAULT_FACE_ID) | ||
| 109 | 108 | ||
| 110 | /* arch-tag: d7f792d2-f59c-4904-a91e-91522e3ab349 | 109 | /* arch-tag: d7f792d2-f59c-4904-a91e-91522e3ab349 |
| 111 | (do not change this comment) */ | 110 | (do not change this comment) */ |