]> code.delx.au - gnu-emacs/commitdiff
Use AREF and ASET for docstrings of category tables.
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 20 Aug 2012 08:20:25 +0000 (12:20 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 20 Aug 2012 08:20:25 +0000 (12:20 +0400)
* category.h (CATEGORY_DOCSTRING): Use AREF.
(SET_CATEGORY_DOCSTRING): Use ASET.
* category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.

src/ChangeLog
src/category.c
src/category.h

index cc5b2b2eb771cab3b673c7047b1be40feeb69b2e..58fa0de36b2c0f46e90bea523317e21006e7dac6 100644 (file)
@@ -1,3 +1,10 @@
+2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use AREF and ASET for docstrings of category tables.
+       * category.h (CATEGORY_DOCSTRING): Use AREF.
+       (SET_CATEGORY_DOCSTRING): Use ASET.
+       * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
+
 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Inline setter functions for hash table members.
index a9bbf596abc03578ce9e1528e3f1bab70957b237..1c9085fd558c44cd65361aa6ce9b9533432b1814 100644 (file)
@@ -143,7 +143,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;
 }
index f29034acff1ca793978127b51b7c1b25789ce5cf..9fb981ed3832a7ef3f88ccfd4376f330a05496ca 100644 (file)
@@ -96,8 +96,12 @@ CHAR_HAS_CATEGORY (int ch, int category)
 #define Vstandard_category_table BVAR (&buffer_defaults, category_table)
 
 /* Return the doc string of CATEGORY in category table TABLE.  */
-#define CATEGORY_DOCSTRING(table, category) \
-  XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' ']
+#define CATEGORY_DOCSTRING(table, category)                            \
+  AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '))
+
+/* Set the doc string of CATEGORY to VALUE in category table TABLE.  */
+#define SET_CATEGORY_DOCSTRING(table, category, value)                 \
+  ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value)
 
 /* Return the version number of category table TABLE.  Not used for
    the moment.  */