X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/31ca4639ad1bfaa355a3f30ef92eb977bd2c6b78..742af32f280f9e0051691a34874d6a7de693239c:/src/category.c
diff --git a/src/category.c b/src/category.c
index a59ad3da53..8a7d4d4076 100644
--- a/src/category.c
+++ b/src/category.c
@@ -29,11 +29,13 @@ along with GNU Emacs. If not, see . */
table. Read comments in the file category.h to understand them. */
#include
-#include
+
+#define CATEGORY_INLINE EXTERN_INLINE
+
#include
#include "lisp.h"
-#include "buffer.h"
#include "character.h"
+#include "buffer.h"
#include "charset.h"
#include "category.h"
#include "keymap.h"
@@ -50,9 +52,6 @@ static int category_table_version;
static Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, Qcategory_table_p;
-/* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */
-Lisp_Object _temp_category_set;
-
/* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
nil) CATEGORY. */
#define SET_CATEGORY_SET(category_set, category, val) \
@@ -71,11 +70,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 +238,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]);
+ set_char_table_defalt (table,
+ 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 +270,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;
+ set_char_table_defalt (val, 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;
@@ -285,7 +285,7 @@ Return TABLE. */)
{
int idx;
table = check_category_table (table);
- BVAR (current_buffer, category_table) = table;
+ BSET (current_buffer, category_table, table);
/* Indicate that this buffer now has a specified category table. */
idx = PER_BUFFER_VAR_IDX (category_table);
SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
@@ -466,7 +466,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;
+ set_char_table_defalt (Vstandard_category_table, MAKE_CATEGORY_SET);
Fset_char_table_extra_slot (Vstandard_category_table, make_number (0),
Fmake_vector (make_number (95), Qnil));
}