diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-16 07:13:44 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-16 07:13:44 +0400 |
commit | a098c9308eb2abee17d1f800d5895c12f471097e (patch) | |
tree | cd5a85bcfd0d1554fcc0fa5f359fe63074caec58 /src/category.c | |
parent | 8be3a09c4f4ed0eae2902b81e80856e917a81b2d (diff) | |
download | emacs-a098c9308eb2abee17d1f800d5895c12f471097e.tar.gz |
Simple interface to set Lisp_Object fields of chararcter tables.
* lisp.h (CSET): New macro.
(char_table_set_extras, char_table_set_contents)
(sub_char_table_set_contents): New function.
* casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
* syntax.c: Adjust users.
Diffstat (limited to 'src/category.c')
-rw-r--r-- | src/category.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/category.c b/src/category.c index 13c6e46d283..3d5b3cff04a 100644 --- a/src/category.c +++ b/src/category.c @@ -71,11 +71,12 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set) EMACS_UINT hash; if (NILP (XCHAR_TABLE (table)->extras[1])) - XCHAR_TABLE (table)->extras[1] - = make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), - make_float (DEFAULT_REHASH_SIZE), - make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil, Qnil); + char_table_set_extras + (table, 1, + make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), + make_float (DEFAULT_REHASH_SIZE), + make_float (DEFAULT_REHASH_THRESHOLD), + Qnil, Qnil, Qnil)); h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); i = hash_lookup (h, category_set, &hash); if (i >= 0) @@ -238,10 +239,10 @@ copy_category_table (Lisp_Object table) table = copy_char_table (table); if (! NILP (XCHAR_TABLE (table)->defalt)) - XCHAR_TABLE (table)->defalt - = Fcopy_sequence (XCHAR_TABLE (table)->defalt); - XCHAR_TABLE (table)->extras[0] - = Fcopy_sequence (XCHAR_TABLE (table)->extras[0]); + CSET (XCHAR_TABLE (table), defalt, + Fcopy_sequence (XCHAR_TABLE (table)->defalt)); + char_table_set_extras + (table, 0, Fcopy_sequence (XCHAR_TABLE (table)->extras[0])); map_char_table (copy_category_entry, Qnil, table, table); return table; @@ -270,9 +271,9 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table, int i; val = Fmake_char_table (Qcategory_table, Qnil); - XCHAR_TABLE (val)->defalt = MAKE_CATEGORY_SET; + CSET (XCHAR_TABLE (val), defalt, MAKE_CATEGORY_SET); for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++) - XCHAR_TABLE (val)->contents[i] = MAKE_CATEGORY_SET; + char_table_set_contents (val, i, MAKE_CATEGORY_SET); Fset_char_table_extra_slot (val, make_number (0), Fmake_vector (make_number (95), Qnil)); return val; @@ -466,7 +467,7 @@ init_category_once (void) Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil); /* Set a category set which contains nothing to the default. */ - XCHAR_TABLE (Vstandard_category_table)->defalt = MAKE_CATEGORY_SET; + CSET (XCHAR_TABLE (Vstandard_category_table), defalt, MAKE_CATEGORY_SET); Fset_char_table_extra_slot (Vstandard_category_table, make_number (0), Fmake_vector (make_number (95), Qnil)); } |