aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-25 20:28:28 +0000
committerRichard M. Stallman1998-05-25 20:28:28 +0000
commit29b7163fa98cfa8e8c4b0d5027737d92f91346c4 (patch)
tree3709409371740bae1be57ac20bd03d4dba8d7ecc /src
parent44eba967fcc650b939c6b5d3d19724135fc26e1e (diff)
downloademacs-29b7163fa98cfa8e8c4b0d5027737d92f91346c4.tar.gz
emacs-29b7163fa98cfa8e8c4b0d5027737d92f91346c4.zip
(CHAR_TABLE_TRANSLATE): New macro.
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h13
1 files changed, 13 insertions, 0 deletions
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
647 : XCHAR_TABLE (CT)->defalt) \ 647 : XCHAR_TABLE (CT)->defalt) \
648 : Faref (CT, make_number (IDX))) 648 : Faref (CT, make_number (IDX)))
649 649
650/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
651 and 8-bit Europeans characters. However, if the result is nil,
652 return IDX.
653
654 For these characters, do not check validity of CT
655 and do not follow parent. */
656#define CHAR_TABLE_TRANSLATE(CT, IDX) \
657 ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
658 ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \
659 ? XINT (XCHAR_TABLE (CT)->contents[IDX]) \
660 : IDX) \
661 : char_table_translate (CT, IDX))
662
650/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and 663/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
651 8-bit Europeans characters. Do not check validity of CT. */ 664 8-bit Europeans characters. Do not check validity of CT. */
652#define CHAR_TABLE_SET(CT, IDX, VAL) \ 665#define CHAR_TABLE_SET(CT, IDX, VAL) \