aboutsummaryrefslogtreecommitdiffstats
path: root/src/chartab.c
diff options
context:
space:
mode:
authorPaul Eggert2011-09-03 16:03:38 -0700
committerPaul Eggert2011-09-03 16:03:38 -0700
commitb49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch)
tree9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /src/chartab.c
parent74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff)
parentbc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff)
downloademacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz
emacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.zip
Merge from trunk.
Diffstat (limited to 'src/chartab.c')
-rw-r--r--src/chartab.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/chartab.c b/src/chartab.c
index efe23eca83f..1d4ac04312a 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -589,8 +589,6 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
589 (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) 589 (Lisp_Object char_table, Lisp_Object n, Lisp_Object value)
590{ 590{
591 CHECK_CHAR_TABLE (char_table); 591 CHECK_CHAR_TABLE (char_table);
592 if (EQ (XCHAR_TABLE (char_table)->purpose, Qchar_code_property_table))
593 error ("Can't change extra-slot of char-code-property-table");
594 CHECK_NUMBER (n); 592 CHECK_NUMBER (n);
595 if (XINT (n) < 0 593 if (XINT (n) < 0
596 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) 594 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
@@ -1095,22 +1093,31 @@ map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
1095 1093
1096/* Unicode character property tables. 1094/* Unicode character property tables.
1097 1095
1098 This section provides a convenient and efficient way to get a 1096 This section provides a convenient and efficient way to get Unicode
1099 Unicode character property from C code (from Lisp, you must use 1097 character properties of characters from C code (from Lisp, you must
1100 get-char-code-property). 1098 use get-char-code-property).
1101 1099
1102 The typical usage is to get a char-table for a specific property at 1100 The typical usage is to get a char-table object for a specific
1103 a proper initialization time as this: 1101 property like this (use of the "bidi-class" property below is just
1102 an example):
1104 1103
1105 Lisp_Object bidi_class_table = uniprop_table (intern ("bidi-class")); 1104 Lisp_Object bidi_class_table = uniprop_table (intern ("bidi-class"));
1106 1105
1107 and get a property value for character CH as this: 1106 (uniprop_table can return nil if it fails to find data for the
1107 named property, or if it fails to load the appropriate Lisp support
1108 file, so the return value should be tested to be non-nil, before it
1109 is used.)
1108 1110
1109 Lisp_Object bidi_class = CHAR_TABLE_REF (CH, bidi_class_table); 1111 To get a property value for character CH use CHAR_TABLE_REF:
1112
1113 Lisp_Object bidi_class = CHAR_TABLE_REF (bidi_class_table, CH);
1110 1114
1111 In this case, what you actually get is an index number to the 1115 In this case, what you actually get is an index number to the
1112 vector of property values (symbols nil, L, R, etc). 1116 vector of property values (symbols nil, L, R, etc).
1113 1117
1118 The full list of Unicode character properties supported by Emacs is
1119 documented in the ELisp manual, in the node "Character Properties".
1120
1114 A table for Unicode character property has these characteristics: 1121 A table for Unicode character property has these characteristics:
1115 1122
1116 o The purpose is `char-code-property-table', which implies that the 1123 o The purpose is `char-code-property-table', which implies that the
@@ -1122,7 +1129,7 @@ map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
1122 means that we don't have to decode values. 1129 means that we don't have to decode values.
1123 1130
1124 o The third extra slot is a Lisp function, an index (integer) to 1131 o The third extra slot is a Lisp function, an index (integer) to
1125 the array uniprop_enncoder[], or nil. If it is a Lisp function, we 1132 the array uniprop_encoder[], or nil. If it is a Lisp function, we
1126 can't use such a table from C (at the moment). If it is nil, it 1133 can't use such a table from C (at the moment). If it is nil, it
1127 means that we don't have to encode values. */ 1134 means that we don't have to encode values. */
1128 1135
@@ -1310,7 +1317,7 @@ uniprop_get_encoder (Lisp_Object table)
1310 function may load a Lisp file and thus may cause 1317 function may load a Lisp file and thus may cause
1311 garbage-collection. */ 1318 garbage-collection. */
1312 1319
1313static Lisp_Object 1320Lisp_Object
1314uniprop_table (Lisp_Object prop) 1321uniprop_table (Lisp_Object prop)
1315{ 1322{
1316 Lisp_Object val, table, result; 1323 Lisp_Object val, table, result;