diff options
author | Kenichi Handa <handa@m17n.org> | 1997-05-28 04:36:36 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 1997-05-28 04:36:36 +0000 |
commit | 47d2a6da9f8c56ccd47930c838f6e108b858f810 (patch) | |
tree | 1bc5fc4e8e66a93c3c31c5d36abeada1cc7bff03 /src/lisp.h | |
parent | 4806ea60535a3f5acbc4b89dcae91414b19995cc (diff) | |
download | emacs-47d2a6da9f8c56ccd47930c838f6e108b858f810.tar.gz |
(CHAR_TABLE_REF): Do not check validity of CT.
(CHAR_TABLE_SET): Likewise.
(DOWNCASE_TABLE): Return case-table instead of the contents field.
(UPCASE_TABLE): Likewise.
(DOWNCASE): Use CHAR_TABLE_REF.
(NOCASEP): Use UPCASE1.
(UPCASE1): Use CHAR_TABLE_REF.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/src/lisp.h b/src/lisp.h index cf2f4b30d86..2571036963c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -608,22 +608,23 @@ struct Lisp_Vector (((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)->defalt) \ + and 8-bit Europeans characters. For these characters, do not check + validity of CT. Do not follow parent. */ +#define CHAR_TABLE_REF(CT, IDX) \ + (XFASTINT (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ + ? (!NILP (XCHAR_TABLE (CT)->contents[XFASTINT (IDX)])\ + ? XCHAR_TABLE (CT)->contents[XFASTINT (IDX)] \ + : XCHAR_TABLE (CT)->defalt) \ : 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); \ + 8-bit Europeans characters. Do not check validity of CT. */ +#define CHAR_TABLE_SET(CT, IDX, VAL) \ + do { \ + if (XFASTINT (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS) \ + XCHAR_TABLE (CT)->contents[XFASTINT (IDX)] = VAL; \ + else \ + Faset (CT, IDX, VAL); \ } while (0) struct Lisp_Char_Table @@ -1315,17 +1316,24 @@ extern char *stack_bottom; #define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) +/* Variables used locally in the following case handling macros. */ +extern Lisp_Object case_temp1, case_temp2; + /* Current buffer's map from characters to lower-case characters. */ -#define DOWNCASE_TABLE XCHAR_TABLE (current_buffer->downcase_table)->contents +#define DOWNCASE_TABLE current_buffer->downcase_table /* Current buffer's map from characters to upper-case characters. */ -#define UPCASE_TABLE XCHAR_TABLE (current_buffer->upcase_table)->contents +#define UPCASE_TABLE current_buffer->upcase_table /* Downcase a character, or make no change if that cannot be done. */ -#define DOWNCASE(CH) (XFASTINT (DOWNCASE_TABLE[CH])) +#define DOWNCASE(CH) \ + ((case_temp1 = (CH), \ + case_temp2 = CHAR_TABLE_REF (DOWNCASE_TABLE, case_temp1), \ + NATNUMP (case_temp2)) \ + ? XFASTINT (case_temp2) : case_temp1) /* 1 if CH is upper case. */ @@ -1333,7 +1341,7 @@ extern char *stack_bottom; /* 1 if CH is neither upper nor lower case. */ -#define NOCASEP(CH) (XFASTINT (UPCASE_TABLE[CH]) == (CH)) +#define NOCASEP(CH) (UPCASE1 (CH) == (CH)) /* 1 if CH is lower case. */ @@ -1345,7 +1353,11 @@ extern char *stack_bottom; /* Upcase a character known to be not upper case. */ -#define UPCASE1(CH) (XFASTINT (UPCASE_TABLE[CH])) +#define UPCASE1(CH) \ + ((case_temp1 = (CH), \ + case_temp2 = CHAR_TABLE_REF (UPCASE_TABLE, case_temp1), \ + NATNUMP (case_temp2)) \ + ? XFASTINT (case_temp2) : case_temp1) extern Lisp_Object Vascii_downcase_table; |