From: Richard M. Stallman Date: Mon, 25 May 1998 20:28:28 +0000 (+0000) Subject: (CHAR_TABLE_TRANSLATE): New macro. X-Git-Tag: emacs-20.3~838 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=29b7163fa98cfa8e8c4b0d5027737d92f91346c4;p=emacs.git (CHAR_TABLE_TRANSLATE): New macro. --- diff --git a/src/lisp.h b/src/lisp.h index 17f5ef9fb95..2831f8ed346 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -647,6 +647,19 @@ struct Lisp_Vector : XCHAR_TABLE (CT)->defalt) \ : Faref (CT, make_number (IDX))) +/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII + and 8-bit Europeans characters. However, if the result is nil, + return IDX. + + For these characters, do not check validity of CT + and do not follow parent. */ +#define CHAR_TABLE_TRANSLATE(CT, IDX) \ + ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ + ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \ + ? XINT (XCHAR_TABLE (CT)->contents[IDX]) \ + : IDX) \ + : char_table_translate (CT, IDX)) + /* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and 8-bit Europeans characters. Do not check validity of CT. */ #define CHAR_TABLE_SET(CT, IDX, VAL) \