diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-20 12:20:25 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-08-20 12:20:25 +0400 |
commit | f1a959923a6ead8f3a3e0590c16fa3114d91dc27 (patch) | |
tree | 61e909f354da9074dfde3debb8a2f10279b3f12e | |
parent | e83064befad4b03bae2f873ece63c050f2c4ca22 (diff) | |
download | emacs-f1a959923a6ead8f3a3e0590c16fa3114d91dc27.tar.gz |
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.
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/category.c | 2 | ||||
-rw-r--r-- | src/category.h | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index cc5b2b2eb77..58fa0de36b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 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. * lisp.h (set_hash_key, set_hash_value, set_hash_next) (set_hash_hash, set_hash_index): Rename with _slot suffix. diff --git a/src/category.c b/src/category.c index a9bbf596abc..1c9085fd558 100644 --- a/src/category.c +++ b/src/category.c @@ -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; } diff --git a/src/category.h b/src/category.h index f29034acff1..9fb981ed383 100644 --- a/src/category.h +++ b/src/category.h @@ -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. */ |