X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/34dabdb7701594b83a5b35b034bba55855d256a5..ea6de9b1f867a49a1ad062ca54e461cd3b1e003f:/src/category.c diff --git a/src/category.c b/src/category.c index ee48ce442e..31cc90bca6 100644 --- a/src/category.c +++ b/src/category.c @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see . */ #define CATEGORY_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" @@ -40,6 +39,13 @@ along with GNU Emacs. If not, see . */ #include "category.h" #include "keymap.h" +/* This setter is used only in this file, so it can be private. */ +static void +bset_category_table (struct buffer *b, Lisp_Object val) +{ + b->INTERNAL_FIELD (category_table) = val; +} + /* The version number of the latest category table. Each category table has a unique version number. It is assigned a new number also when it is modified. When a regular expression is compiled @@ -72,10 +78,10 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set) if (NILP (XCHAR_TABLE (table)->extras[1])) set_char_table_extras (table, 1, - make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), + make_hash_table (hashtest_equal, make_number (DEFAULT_HASH_SIZE), make_float (DEFAULT_REHASH_SIZE), make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil, Qnil)); + Qnil)); h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); i = hash_lookup (h, category_set, &hash); if (i >= 0) @@ -136,7 +142,7 @@ the current buffer's category table. */) error ("Category `%c' is already defined", (int) XFASTINT (category)); if (!NILP (Vpurify_flag)) docstring = Fpurecopy (docstring); - CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring; + SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring); return Qnil; } @@ -285,7 +291,7 @@ Return TABLE. */) { int idx; table = check_category_table (table); - BSET (current_buffer, category_table, table); + bset_category_table (current_buffer, 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); @@ -399,17 +405,17 @@ then delete CATEGORY from the category set instead of adding it. */) return Qnil; } -/* Return 1 if there is a word boundary between two word-constituent - characters C1 and C2 if they appear in this order, else return 0. +/* Return true if there is a word boundary between two word-constituent + characters C1 and C2 if they appear in this order. Use the macro WORD_BOUNDARY_P instead of calling this function directly. */ -int +bool word_boundary_p (int c1, int c2) { Lisp_Object category_set1, category_set2; Lisp_Object tail; - int default_result; + bool default_result; if (EQ (CHAR_TABLE_REF (Vchar_script_table, c1), CHAR_TABLE_REF (Vchar_script_table, c2)))