aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-20 12:20:25 +0400
committerDmitry Antipov2012-08-20 12:20:25 +0400
commitf1a959923a6ead8f3a3e0590c16fa3114d91dc27 (patch)
tree61e909f354da9074dfde3debb8a2f10279b3f12e /src
parente83064befad4b03bae2f873ece63c050f2c4ca22 (diff)
downloademacs-f1a959923a6ead8f3a3e0590c16fa3114d91dc27.tar.gz
emacs-f1a959923a6ead8f3a3e0590c16fa3114d91dc27.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/category.c2
-rw-r--r--src/category.h8
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 @@
12012-08-20 Dmitry Antipov <dmantipov@yandex.ru> 12012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Use AREF and ASET for docstrings of category tables.
4 * category.h (CATEGORY_DOCSTRING): Use AREF.
5 (SET_CATEGORY_DOCSTRING): Use ASET.
6 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7
82012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
9
3 Inline setter functions for hash table members. 10 Inline setter functions for hash table members.
4 * lisp.h (set_hash_key, set_hash_value, set_hash_next) 11 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5 (set_hash_hash, set_hash_index): Rename with _slot suffix. 12 (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. */)
143 error ("Category `%c' is already defined", (int) XFASTINT (category)); 143 error ("Category `%c' is already defined", (int) XFASTINT (category));
144 if (!NILP (Vpurify_flag)) 144 if (!NILP (Vpurify_flag))
145 docstring = Fpurecopy (docstring); 145 docstring = Fpurecopy (docstring);
146 CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring; 146 SET_CATEGORY_DOCSTRING (table, XFASTINT (category), docstring);
147 147
148 return Qnil; 148 return Qnil;
149} 149}
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)
96#define Vstandard_category_table BVAR (&buffer_defaults, category_table) 96#define Vstandard_category_table BVAR (&buffer_defaults, category_table)
97 97
98/* Return the doc string of CATEGORY in category table TABLE. */ 98/* Return the doc string of CATEGORY in category table TABLE. */
99#define CATEGORY_DOCSTRING(table, category) \ 99#define CATEGORY_DOCSTRING(table, category) \
100 XVECTOR (Fchar_table_extra_slot (table, make_number (0)))->contents[(category) - ' '] 100 AREF (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '))
101
102/* Set the doc string of CATEGORY to VALUE in category table TABLE. */
103#define SET_CATEGORY_DOCSTRING(table, category, value) \
104 ASET (Fchar_table_extra_slot (table, make_number (0)), ((category) - ' '), value)
101 105
102/* Return the version number of category table TABLE. Not used for 106/* Return the version number of category table TABLE. Not used for
103 the moment. */ 107 the moment. */