diff options
Diffstat (limited to 'src/category.c')
| -rw-r--r-- | src/category.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/category.c b/src/category.c index 7d0f72d284d..3d5b3cff04a 100644 --- a/src/category.c +++ b/src/category.c | |||
| @@ -29,6 +29,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 29 | table. Read comments in the file category.h to understand them. */ | 29 | table. Read comments in the file category.h to understand them. */ |
| 30 | 30 | ||
| 31 | #include <config.h> | 31 | #include <config.h> |
| 32 | |||
| 33 | #define CATEGORY_INLINE EXTERN_INLINE | ||
| 34 | |||
| 32 | #include <ctype.h> | 35 | #include <ctype.h> |
| 33 | #include <setjmp.h> | 36 | #include <setjmp.h> |
| 34 | #include "lisp.h" | 37 | #include "lisp.h" |
| @@ -68,11 +71,12 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set) | |||
| 68 | EMACS_UINT hash; | 71 | EMACS_UINT hash; |
| 69 | 72 | ||
| 70 | if (NILP (XCHAR_TABLE (table)->extras[1])) | 73 | if (NILP (XCHAR_TABLE (table)->extras[1])) |
| 71 | XCHAR_TABLE (table)->extras[1] | 74 | char_table_set_extras |
| 72 | = make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), | 75 | (table, 1, |
| 73 | make_float (DEFAULT_REHASH_SIZE), | 76 | make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), |
| 74 | make_float (DEFAULT_REHASH_THRESHOLD), | 77 | make_float (DEFAULT_REHASH_SIZE), |
| 75 | Qnil, Qnil, Qnil); | 78 | make_float (DEFAULT_REHASH_THRESHOLD), |
| 79 | Qnil, Qnil, Qnil)); | ||
| 76 | h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); | 80 | h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); |
| 77 | i = hash_lookup (h, category_set, &hash); | 81 | i = hash_lookup (h, category_set, &hash); |
| 78 | if (i >= 0) | 82 | if (i >= 0) |
| @@ -235,10 +239,10 @@ copy_category_table (Lisp_Object table) | |||
| 235 | table = copy_char_table (table); | 239 | table = copy_char_table (table); |
| 236 | 240 | ||
| 237 | if (! NILP (XCHAR_TABLE (table)->defalt)) | 241 | if (! NILP (XCHAR_TABLE (table)->defalt)) |
| 238 | XCHAR_TABLE (table)->defalt | 242 | CSET (XCHAR_TABLE (table), defalt, |
| 239 | = Fcopy_sequence (XCHAR_TABLE (table)->defalt); | 243 | Fcopy_sequence (XCHAR_TABLE (table)->defalt)); |
| 240 | XCHAR_TABLE (table)->extras[0] | 244 | char_table_set_extras |
| 241 | = Fcopy_sequence (XCHAR_TABLE (table)->extras[0]); | 245 | (table, 0, Fcopy_sequence (XCHAR_TABLE (table)->extras[0])); |
| 242 | map_char_table (copy_category_entry, Qnil, table, table); | 246 | map_char_table (copy_category_entry, Qnil, table, table); |
| 243 | 247 | ||
| 244 | return table; | 248 | return table; |
| @@ -267,9 +271,9 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table, | |||
| 267 | int i; | 271 | int i; |
| 268 | 272 | ||
| 269 | val = Fmake_char_table (Qcategory_table, Qnil); | 273 | val = Fmake_char_table (Qcategory_table, Qnil); |
| 270 | XCHAR_TABLE (val)->defalt = MAKE_CATEGORY_SET; | 274 | CSET (XCHAR_TABLE (val), defalt, MAKE_CATEGORY_SET); |
| 271 | for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++) | 275 | for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++) |
| 272 | XCHAR_TABLE (val)->contents[i] = MAKE_CATEGORY_SET; | 276 | char_table_set_contents (val, i, MAKE_CATEGORY_SET); |
| 273 | Fset_char_table_extra_slot (val, make_number (0), | 277 | Fset_char_table_extra_slot (val, make_number (0), |
| 274 | Fmake_vector (make_number (95), Qnil)); | 278 | Fmake_vector (make_number (95), Qnil)); |
| 275 | return val; | 279 | return val; |
| @@ -282,7 +286,7 @@ Return TABLE. */) | |||
| 282 | { | 286 | { |
| 283 | int idx; | 287 | int idx; |
| 284 | table = check_category_table (table); | 288 | table = check_category_table (table); |
| 285 | BVAR (current_buffer, category_table) = table; | 289 | BSET (current_buffer, category_table, table); |
| 286 | /* Indicate that this buffer now has a specified category table. */ | 290 | /* Indicate that this buffer now has a specified category table. */ |
| 287 | idx = PER_BUFFER_VAR_IDX (category_table); | 291 | idx = PER_BUFFER_VAR_IDX (category_table); |
| 288 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); | 292 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); |
| @@ -463,7 +467,7 @@ init_category_once (void) | |||
| 463 | 467 | ||
| 464 | Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil); | 468 | Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil); |
| 465 | /* Set a category set which contains nothing to the default. */ | 469 | /* Set a category set which contains nothing to the default. */ |
| 466 | XCHAR_TABLE (Vstandard_category_table)->defalt = MAKE_CATEGORY_SET; | 470 | CSET (XCHAR_TABLE (Vstandard_category_table), defalt, MAKE_CATEGORY_SET); |
| 467 | Fset_char_table_extra_slot (Vstandard_category_table, make_number (0), | 471 | Fset_char_table_extra_slot (Vstandard_category_table, make_number (0), |
| 468 | Fmake_vector (make_number (95), Qnil)); | 472 | Fmake_vector (make_number (95), Qnil)); |
| 469 | } | 473 | } |