aboutsummaryrefslogtreecommitdiffstats
path: root/src/chartab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chartab.c')
-rw-r--r--src/chartab.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/chartab.c b/src/chartab.c
index 16017f4a49a..bf8e34b2529 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1321,22 +1321,25 @@ and put an element value. */)
1321 return Fcdr (Fassq (prop, Vchar_code_property_alist)); 1321 return Fcdr (Fassq (prop, Vchar_code_property_alist));
1322} 1322}
1323 1323
1324Lisp_Object
1325get_unicode_property (Lisp_Object char_table, int ch)
1326{
1327 Lisp_Object val = CHAR_TABLE_REF (char_table, ch);
1328 uniprop_decoder_t decoder = uniprop_get_decoder (char_table);
1329 return (decoder ? decoder (char_table, val) : val);
1330}
1331
1324DEFUN ("get-unicode-property-internal", Fget_unicode_property_internal, 1332DEFUN ("get-unicode-property-internal", Fget_unicode_property_internal,
1325 Sget_unicode_property_internal, 2, 2, 0, 1333 Sget_unicode_property_internal, 2, 2, 0,
1326 doc: /* Return an element of CHAR-TABLE for character CH. 1334 doc: /* Return an element of CHAR-TABLE for character CH.
1327CHAR-TABLE must be what returned by `unicode-property-table-internal'. */) 1335CHAR-TABLE must be what returned by `unicode-property-table-internal'. */)
1328 (Lisp_Object char_table, Lisp_Object ch) 1336 (Lisp_Object char_table, Lisp_Object ch)
1329{ 1337{
1330 Lisp_Object val;
1331 uniprop_decoder_t decoder;
1332
1333 CHECK_CHAR_TABLE (char_table); 1338 CHECK_CHAR_TABLE (char_table);
1334 CHECK_CHARACTER (ch); 1339 CHECK_CHARACTER (ch);
1335 if (! UNIPROP_TABLE_P (char_table)) 1340 if (! UNIPROP_TABLE_P (char_table))
1336 error ("Invalid Unicode property table"); 1341 error ("Invalid Unicode property table");
1337 val = CHAR_TABLE_REF (char_table, XFIXNUM (ch)); 1342 return get_unicode_property (char_table, XFIXNUM (ch));
1338 decoder = uniprop_get_decoder (char_table);
1339 return (decoder ? decoder (char_table, val) : val);
1340} 1343}
1341 1344
1342DEFUN ("put-unicode-property-internal", Fput_unicode_property_internal, 1345DEFUN ("put-unicode-property-internal", Fput_unicode_property_internal,