Merge from emacs-24; up to 2012-12-25T11:37:21Z!dmantipov@yandex.ru
[bpt/emacs.git] / src / category.c
index a9bbf59..30ffbd0 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU Emacs routines to deal with category tables.
 
-Copyright (C) 1998, 2001-201 Free Software Foundation, Inc.
+Copyright (C) 1998, 2001-2013 Free Software Foundation, Inc.
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
   2005, 2006, 2007, 2008, 2009, 2010, 2011
   National Institute of Advanced Industrial Science and Technology (AIST)
@@ -32,7 +32,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define CATEGORY_INLINE EXTERN_INLINE
 
-#include <setjmp.h>
 #include "lisp.h"
 #include "character.h"
 #include "buffer.h"
@@ -41,7 +40,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keymap.h"
 
 /* This setter is used only in this file, so it can be private.  */
-static inline void
+static void
 bset_category_table (struct buffer *b, Lisp_Object val)
 {
   b->INTERNAL_FIELD (category_table) = val;
@@ -79,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)
@@ -143,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;
 }
@@ -406,17 +405,17 @@ then delete CATEGORY from the category set instead of adding it.  */)
   return Qnil;
 }
 \f
-/* 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)))