aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1997-04-07 07:12:13 +0000
committerKenichi Handa1997-04-07 07:12:13 +0000
commitd6f92c04059b81f31497b1564b289e638c0ed621 (patch)
tree391bd55c13abbcb6c31a7d25cafd237013a2022b /src
parentbcf26d6a7d13dd3a49e0ce535aceaa4247bf5af6 (diff)
downloademacs-d6f92c04059b81f31497b1564b289e638c0ed621.tar.gz
emacs-d6f92c04059b81f31497b1564b289e638c0ed621.zip
(CHARSET_TABLE_ENTRY): Handle ASCII charset correctly.
(SPLIT_NON_ASCII_CHAR, SPLIT_CHAR): Return -1 in C2 for DIMENSION1 characters.
Diffstat (limited to 'src')
-rw-r--r--src/charset.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/charset.h b/src/charset.h
index 0dee3d2ed84..ec61e378dc9 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -310,8 +310,9 @@ extern Lisp_Object Vcharset_table;
310 We provide these macros for efficiency. No range check of CHARSET. */ 310 We provide these macros for efficiency. No range check of CHARSET. */
311 311
312/* Return entry of CHARSET (lisp integer) in Vcharset_table. */ 312/* Return entry of CHARSET (lisp integer) in Vcharset_table. */
313#define CHARSET_TABLE_ENTRY(charset) \ 313#define CHARSET_TABLE_ENTRY(charset) \
314 XCHAR_TABLE (Vcharset_table)->contents[charset] 314 XCHAR_TABLE (Vcharset_table)->contents[((charset) == CHARSET_ASCII \
315 ? 0 : (charset) + 128)]
315 316
316/* Return information INFO-IDX of CHARSET. */ 317/* Return information INFO-IDX of CHARSET. */
317#define CHARSET_TABLE_INFO(charset, info_idx) \ 318#define CHARSET_TABLE_INFO(charset, info_idx) \
@@ -464,12 +465,12 @@ extern int width_by_char_head[256];
464 465
465/* The charset of non-ASCII character C is set to CHARSET, and the 466/* The charset of non-ASCII character C is set to CHARSET, and the
466 position-codes of C are set to C1 and C2. C2 of DIMENSION1 character 467 position-codes of C are set to C1 and C2. C2 of DIMENSION1 character
467 is 0. */ 468 is -1. */
468#define SPLIT_NON_ASCII_CHAR(c, charset, c1, c2) \ 469#define SPLIT_NON_ASCII_CHAR(c, charset, c1, c2) \
469 ((c) < MIN_CHAR_OFFICIAL_DIMENSION2 \ 470 ((c) < MIN_CHAR_OFFICIAL_DIMENSION2 \
470 ? (charset = CHAR_FIELD2 (c) + 0x70, \ 471 ? (charset = CHAR_FIELD2 (c) + 0x70, \
471 c1 = CHAR_FIELD3 (c), \ 472 c1 = CHAR_FIELD3 (c), \
472 c2 = 0) \ 473 c2 = -1) \
473 : (charset = ((c) < MIN_CHAR_COMPOSITION \ 474 : (charset = ((c) < MIN_CHAR_COMPOSITION \
474 ? (CHAR_FIELD1 (c) \ 475 ? (CHAR_FIELD1 (c) \
475 + ((c) < MIN_CHAR_PRIVATE_DIMENSION2 ? 0x8F : 0xE0)) \ 476 + ((c) < MIN_CHAR_PRIVATE_DIMENSION2 ? 0x8F : 0xE0)) \
@@ -479,14 +480,14 @@ extern int width_by_char_head[256];
479 480
480/* The charset of character C is set to CHARSET, and the 481/* The charset of character C is set to CHARSET, and the
481 position-codes of C are set to C1 and C2. C2 of DIMENSION1 character 482 position-codes of C are set to C1 and C2. C2 of DIMENSION1 character
482 is 0. */ 483 is -1. */
483#define SPLIT_CHAR(c, charset, c1, c2) \ 484#define SPLIT_CHAR(c, charset, c1, c2) \
484 (SINGLE_BYTE_CHAR_P (c) \ 485 (SINGLE_BYTE_CHAR_P (c) \
485 ? charset = CHARSET_ASCII, c1 = (c), c2 = 0 \ 486 ? charset = CHARSET_ASCII, c1 = (c), c2 = -1 \
486 : SPLIT_NON_ASCII_CHAR (c, charset, c1, c2)) 487 : SPLIT_NON_ASCII_CHAR (c, charset, c1, c2))
487 488
488/* The charset of the character at STR is set to CHARSET, and the 489/* The charset of the character at STR is set to CHARSET, and the
489 position-codes are set to C1 and C2. C2 of DIMENSION1 character is 0. 490 position-codes are set to C1 and C2. C2 of DIMENSION1 character is -1.
490 If the character is a composite character, the upper 7-bit and 491 If the character is a composite character, the upper 7-bit and
491 lower 7-bit of CMPCHAR-ID are set in C1 and C2 respectively. No 492 lower 7-bit of CMPCHAR-ID are set in C1 and C2 respectively. No
492 range checking. */ 493 range checking. */